Reputation: 41
I have a very basic question regarding how the whole system works for TelosB. I have gone through the data manual and how TelosB operates.
Now I need to send some specific data through the TelosB nodes. I saw the packet format of the TinyOS. and defined the payload.
typedef nx_struct packet {
nx_uint16_t id; /* Mote id of sending mote. */
nx_uint16_t count; } packet_t;
In the radio count leds code I changed few small things
#include "Timer.h"
#include "RadioCountToLeds.h"
module RadioCountToLedsC @safe() {
uses {
interface Leds;
interface Boot;
interface Receive;
interface AMSend;
interface Timer<TMilli> as MilliTimer;
interface SplitControl as AMControl;
interface Packet;
}
}
implementation {
message_t packet;
bool locked;
uint16_t counter = 0;
event void Boot.booted() {
call AMControl.start();
}
event void AMControl.startDone(error_t err) {
if (err == SUCCESS) {
call MilliTimer.startPeriodic(250);
}
else {
call AMControl.start();
}
}
event void AMControl.stopDone(error_t err) {
// do nothing
}
event void MilliTimer.fired() {
counter++;
dbg("RadioCountToLedsC", "RadioCountToLedsC: timer fired, counter is
%hu.\n", counter);
if (locked) {
return;
}
else {
radio_count_msg_t* rcm = (radio_count_msg_t*)call
Packet.getPayload(&packet, sizeof(radio_count_msg_t));
if (rcm == NULL) {
return;
}
rcm->counter = 11110000;
if (call AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(radio_count_msg_t)) == SUCCESS) {
dbg("RadioCountToLedsC", "RadioCountToLedsC: packet sent.\n", counter);
locked = TRUE;
}
}
}
The counter is the data I want to transmit. It is 11110000. When this TinyOS code is run in the Telosb mote, how is the 11110000 interpreted? I need to be very specific about what data is going into the DAC of the telosb or OQPSK.
I want to know in details how the data is read and interpreted.
Upvotes: 0
Views: 102
Reputation: 41
I guess I got my answer. cc2420 chip
http://www.ti.com/lit/ds/symlink/cc2420.pdf
Upvotes: 0