Interface: tos.chips.cc1000.ByteRadio

interface ByteRadio

Radio logic is split between Csma (media-access control, low-power listening and general control) and SendReceive (packet reception and transmission). This interface specifies the interaction between these two components.

Author:
David Gay

Commands
command void cts() Access to the media granted.
command uint16_t getPreambleLength() Get message preamble length.
command message_t *getTxMessage() Between the rts() and sendDone() events, this must return the message under transmission.
command void listen() Enable listening for incoming packets.
command void off() Disable listening for incoming packets.
command void setPreambleLength(uint16_t bytes) Set message preamble length.
command bool syncing() Detect if SendReceive is attempting to sync with an incoming packet.

Events
event void idleByte(bool preamble) SendReceive signals this event for every radio-byte-time while listening is enabled and a message isn't being received or transmitted.
event void rts(message_t *msg) SendReceive wants to send a packet.
event void rx() A message is being received
event void rxDone() Message reception is complete.
event void sendDone() Transmission complete.

Commands - Details

cts

command void cts()

Access to the media granted. Start sending. SendReceive must signal sendDone when transmission is complete. Note: the media-access-contro layer must have enabled listening before calling cts().

getPreambleLength

command uint16_t getPreambleLength()

Get message preamble length.

Returns:
Preamble length in bytes

getTxMessage

command message_t *getTxMessage()

Between the rts() and sendDone() events, this must return the message under transmission.

Returns:
Message being transmitted.

listen

command void listen()

Enable listening for incoming packets.

off

command void off()

Disable listening for incoming packets.

setPreambleLength

command void setPreambleLength(uint16_t bytes)

Set message preamble length.

Parameters:
bytes - Preamble length in bytes

syncing

command bool syncing()

Detect if SendReceive is attempting to sync with an incoming packet. During sync, idleByte events are not signaled. If sync is successful, an rx() event will be signaled, if it fails, idleByte events will resume. If syncing() returns TRUE, the last idleByte() event must have had preamble = TRUE.

Returns:
TRUE if a sync attempt is in progress, FALSE if not.

Events - Details

idleByte

event void idleByte(bool preamble)

SendReceive signals this event for every radio-byte-time while listening is enabled and a message isn't being received or transmitted.

Parameters:
preamble - TRUE if a message preamble byte has been received

rts

event void rts(message_t *msg)

SendReceive wants to send a packet.

Parameters:
msg - Message to be sent.

rx

event void rx()

A message is being received

rxDone

event void rxDone()

Message reception is complete.

sendDone

event void sendDone()

Transmission complete.