cybiko:macimpl:rfdescription

The RF Physical Layer

This document presents an overview of the Cybiko RF-based physical layer and its interface.

Experience with the native Cybiko RF communications layer has demonstrated that simultaneous transmissions do not necessarily lead to collisions, perhaps due to the use of subchannels. Thus, a system has been built upon the basic RF mechanism that can reliably detect overlapping transmissions. It also slows the data rate so as to make communications events more easily observable, and adds a channel sense facility. The enhanced RF service works by sending many copies of the specified data, but letting the channel become idle between duplicates. If any of the copies are lost, or sequences interleave, a collision is declared and all affected sequences are discarded. The implementation requires that the RF layer get frequent attention from the layers above, so that it can monitor the system clock and process incoming data in a timely manner.

void RF_Init(struct module_t *main, char *name)

This routine must be called before any of the other RF routines are used. It is passed a pointer to the application's main module, and the application's name.

void RF_Service()

Service must be called periodically to ensure the RF layer catches timeouts. (These are used to find the end of a sequence of duplicates, in the case that one or more at the end have been lost to an actual collision.)

bool RF_Handler(struct Message *ptr_message)

The layer above must pass events to this function so that the RF layer has a chance to process incoming messages. It returns TRUE if the event was handled by the RF layer.

int RF_Tx(char *data, int size)

This function takes data from the layer above and broadcasts it to all participating Cybikos. No addresses are involved, as the simulated physical layer is broadcast based. The arguments are a pointer to a data buffer, and an integer specifying the number of bytes to be sent. The function returns the number of bytes actually broadcast. Note that this does not guarantee that they arrived safely at any or all remote machines.

MSG_RF_ARRIVAL

There is no corresponding function for receiving data. Instead, in keeping with the Cybiko model, data is presented to the layer above via message. Data from the RF layer arrives in a buffer attached to message with a msgid of MSG_RF_ARRIVAL. The sender can be determined via Message_get_sender_id, and the data size found with Buffer_get_size.

bool RF_InUse()

This function returns TRUE Code Text if the shared channel is in use.

clock_t RF_IdleTime()

Returns the # of milliseconds since channel was last used.


Brad Richards 2002

  • cybiko/macimpl/rfdescription.txt
  • Last modified: 2009/11/27 17:56
  • by 127.0.0.1