A prototype implementation of Reins-MAC has been developped on top
of TinyOS
2.1.1, for the TelosB hardware platform. This prototype is
open
source, and is made available through the
GNU Lesser General Public License.
The files can be downloaded from
SourceForge here.
How To Use Reins-MAC
Reins-MAC provides, through the ReinsMacC main
configuration, the common AMSend[am_id_t] and
Receive[am_id_t] interfaces (the sendDone event
is signaled once the message has been effectively sent), as well
as the ReinsControl interface (rename for
the SplitControl interface) to start and stop the
scheduling and the radio stack. Finally, Reins-MAC provides a
dedicated interface, called ReinsMac, composed by:
- event void emptyBuffer(void), which signals a
buffer just emptied and available to send new messages, as the
transmission slot has not finished yet;
- command void setPosition(uint16_t prev_node_id, uint16_t
next_node_id), which sets the desired position inside the
communication frame, or no constraint if the local address is
used;
- command uint16_t setDuration(uint16_t
max_slot_size), which sets the desired duration of the
slot; if the requirement cannot be satisfied, the maximum
possible allocation is provided at the moment of the request;
the value 0 corresponds to the revocation of the reservation (in
which case the default minimum slot size is used); the returned
value equals the actual reservation.
In order to successfully wire Reins-MAC into your application and
compile it, the main Makefile of the application needs to be
modified so to provide the information of where the code of
Reins-MAC is and include the corresponding compilation
rules. Assuming that the reinsmac downloaded directory is at the
same level of the one where the main Makefile resides, the
following two lines must be added:
REINS_MAC_DIR = ../reinsmac
include $(REINS_MAC_DIR)/Makefile
Finally, the Reins-MAC configuration, e.g., the length of the
frame, can be tuned by changing the values in the
reinsmac/conf/Configuration.h file.
A simple PingPong application can also be downloaded, which
provides an example of usage of Reins-MAC.