1 ;; -*- scheme -*- ; not really, but tells emacs how to format this
3 ;; Copyright 2007 Free Software Foundation, Inc.
5 ;; This file is part of GNU Radio
7 ;; GNU Radio is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; GNU Radio is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License along
18 ;; with this program; if not, write to the Free Software Foundation, Inc.,
19 ;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 ;; ----------------------------------------------------------------
23 ;; This is an mblock header file
25 ;; The format is very much a work-in-progress.
26 ;; It'll be compiled to C++.
27 ;; ----------------------------------------------------------------
29 ;; In the outgoing messages described below, invocation-handle is an
30 ;; identifier provided by the client to tag the method invocation.
31 ;; The identifier will be returned with the response, to provide the
32 ;; client with a mechanism to match asynchronous responses with the
33 ;; commands that generate them. The value of the invocation-handle is
34 ;; opaque the the server, and is not required by the server to be
37 ;; In the incoming messages described below, invocation-handle is the
38 ;; identifier provided by the client in the prompting invocation. The
39 ;; identifier is returned with the response, so that the client has a
40 ;; mechanism to match asynchronous responses with the commands that
43 ;; status is either #t, indicating success, or a symbol indicating an error.
44 ;; All symbol's names shall begin with %error-
47 ;; ----------------------------------------------------------------
50 ;; The protocol class is defined from the client's point-of-view.
51 ;; (The client port is unconjugated, the server port is conjugated.)
53 (define-protocol-class gmac-tx
57 ;; Transmitting packets can carry an invocation handle so the application
58 ;; can get TX results on specific packets, such as whether a packet tagged
59 ;; as #1 was successfully transmitted or not. This would allow the
60 ;; application to implement something sliding window like.
62 ;; 'dst' is the destination MAC address (given a MAC addressing scheme)
64 ;; 'data' will be treated transparently and passed on as samples.
66 ;; 'properties' can be used in the future to set per-packet options such as
67 ;; carrier sense overriding functionality.
68 (cmd-tx-pkt invocation-handle dst data properties)
74 ;; The response will carry the same invocation-handle passed with cmd-tx-pkt
75 (response-tx-pkt invocation-handle status)
80 ;; ----------------------------------------------------------------
83 ;; The protocol class is defined from the client's point-of-view.
84 ;; (The client port is unconjugated, the server port is conjugated.)
86 (define-protocol-class gmac-rx
90 ;; There are currently no outgoing commands, I believe that the RX
91 ;; should always be enabled, there is no point in having an enable/disable
98 ;; Contains packets decoded by the MAC destined for this machine, sent by
99 ;; the specified address.
100 (response-rx-pkt invocation-handle src data)
106 ;; ----------------------------------------------------------------
109 ;; The protocol class is defined from the client's point-of-view.
110 ;; (The client port is unconjugated, the server port is conjugated.)
112 ;; This defines a control/status interface to the MAC layer, for control over
113 ;; functionality such as carrier sense and future functionality such as channel
117 (define-protocol-class gmac-cs
121 ;; Threshold represents the carrier sense threshold based on the digital
122 ;; reading out of the DAC. If the threshold is set to PMT_NIL then the
123 ;; MAC will use averaging to determine an appropriate threshold.
124 (cmd-carrier-sense-enable invocation-handle threshold deadline)
125 (cmd-carrier-sense-threshold invocation-handle threshold)
126 (cmd-carrier-sense-disable invocation-handle)
128 ;; Setting the number of fast transmission retries on a failure before
129 ;; reporting a loss back to the application.
130 (cmd-set-tx-retries invocation-handle retries)
136 (response-gmac-initialized invocation-handle status)
138 (response-carrier-sense-enable invocation-handle status)
139 (response-carrier-sense-threshold invocation-handle status)
140 (response-carrier-sense-deadline invocation-handle status)
141 (response-carrier-sense-disable invocation-handle status)
143 (response-set-tx-retries invocation-handle status)