TinyOS System Components

AM handler sets -- Application level component (use or build multiple) 

AM_BEACON.c -- Application that periodically broadcasts out identity information.  On each clock interrupt, it sends out a predetermined packet of information.  

AM_BOUNCER.c -- Equivalent to a 'ping' handler.  Accepts a packet coming in from the network and responds with a packet sent back to the original sender.

AM_ECHO.c -- A component that forwards data through a node. Essentially, this is a router for a source based routing algorithm.  The packet already contains the route to the destination. This handler receives the packet and retransmits it out to the next hop on the list.  The handler also modifies the list so that the packet contains the return address by the time it arrives at the recipient. 

AM_LIGHT.c -- A component that I have no idea what it does. It probably accepts a messages request to check the light sensor and send back the result.

AM_ROUTE.c -- A multi-hop routing application designed to discover a minimum depth spanning tree and forward the use the tree to send sensor readings back to a central base station.  Each node listens for data that it needs to retransmit on behalf of other nodes.  Distant nodes use intermediate nodes as stepping stones for their data.  Each re-transmission brings the data closer to the base station.

AM_temp.c  -- A component that I have no idea what it does. It probably accepts a messages request to check the light sensor and send back the result.

"Main" level object 

MAIN.c  Required component that initializes the system and starts the scheduler. All applications must include this component.  Additionally, currently, the node's ID number is encoded in this file.

sched.c  System Scheduler, must be included in all applications.  This is a simple fifo scheduler that is used to schedule the tasks.  When a component calls POST_TASK, the scheduler places that task in a FIFO queue.  When there is nothing else for the CPU to do, a task is pulled off the front of the FIFO queue and executed to completion.

Active Message Layers (use one) 

AM.c - stand alone NSD AM layer.  When a packet arrives the this module checks the address of the packet and then dispatches the message to the appropriate message handler.  In the event that the handler is not present on the device, the packet is dropped.  This layer checks that either the address is equal to the local address or it is equal to the broadcast address (0xff).

AM_BASE.c - base station NSD with UART forwarding.  This component behaves the same as the AM.c component EXCEPT that if a packet is sent to the address 0x7e, it is directed to the UART instead of the RADIO.  The address 0x7e is permanently assigned to the UART of a computer attached to a base station.  This component that both a Radio Packet Transport layer component and a UART Packet Transport component are present.

Radio Packet Transport Layer (use one) 

PACKETOBJ.c -raw 30 byte packet.  This component takes a pointer to a 30 byte array to be sent down to the byte level component below it.  It hands the bytes down to the byte level component one at a time.  As the byte level component completes the transmission of a byte, a subsequent byte is handed down.  Additionally, as bytes arrive up from the network, this component accepts the bytes one at a time until all 30 have arrived.  Once a full packet is sent/received the component fires the packet_send_done or packet_receive_done event.

CRCPACKETOBJ.c -packet layer component that checks for CRC validity.  This component performs the same function as the basic PACKETOBJ.c component except that it transmits and additional two bytes.  These two bytes are a CRC calculation performed over the packet. On the receiving end, the CRC is recalculated and compared with the CRC value that was received.  If they do not match, the packet is dropped.  If they do match the component fires the packet_recieved_event.  

REDPACKET redundancy  packet - This packet level component takes in 10 BYTE PACKETS and then sends the data out in triplicate.  The ten bytes are transmitted 3 times to form a 30 byte packet.  Upon arrival the three copies are used to perform error correction. In the event that two of the three copies are the same (on a byte-by-byte basis), majority vote wins.  In the event that all three copies are different, then the packet is dropped.

UART Packet Transport Layer 

UART_PACKET.c -sends packets to the UART   this packet level component is almost identical to the PACKETOBJ.c component except it is designed to be used with the UART.c byte level component.

Radio Byte Engine (use one)  -- all devices in the network must use the same radio encoding component.

FOUR_B_RADIO_BYTE.c - 4b/6b encoding - A byte level component used  with the RFM component. This component accepts bytes from the packet layer componet, encodes them for transmission, and passes the bits down to the RFM component one at a time.  This component uses a 4b/6b encoding scheme. Each 8bit byte is transformed into 12 bits for transmission. This is done in order to satisfy the radio's DC-balance requirement.  As bits arrive from the radio, this component first checks to see if a valid start symbol arrives from the network.  One a start symbol is found, the component collects the bits together into a byte worth, decodes the byte and then sends the decoded byte up to the packet layer.

RADIO_BYTE.c - manchester encoding  This performs the same function as the FOUR_B_RADIO_BYTE except it uses a Manchester encoding scheme that takes in a 8-bit symbol and produces a 16 bit symbol, once again, this is done in order to satisfy the radio's dc-balance requirement.

UART Byte Engine 

UART.c --This component takes bytes one at a time and transmitts them over the UART.  When the component is ready to handle another byte, it fires the tx_done event. When a byte arrives from the UART, the component fires the byte_arrival event.

Lower level device components

CLOCK.c - signals periodic events.  It initialized with the interval with witch to fire the event and then periodically fires the CLOCK_EVENT at that rate. The possible initialization values are:

  1. 0x0 - disable the event
  2. 0x1 - fire once every 1/256 of a second
  3. 0x2
  4. 0x3
  5. 0x4
  6. 0x5
  7. 0x6
  8. 0x7

 

 

 

PHOTO.c - access photo sensor

RFM.c - RFM radio interface

RFM_LOW_POWER.c - low power interface to RFM radio.

Temp.c - temperature sensor

MOTE_I2C_obj.c