| Hello all: I am working on a simple system of Telos B Motes to do some distance ranging experiments. I realize that this subject has been beat dead on this board, but I am stuck and would appreciate any insight. I have several motes programmed with CntToRfm. No problems there. I can install TOSBase on a Base mote and see that those are in fact transmitting a counter over the radio. I am working on a modification to the Base Mote that extracts the RSSI information and replaces the payload (ie the counter data) with the RSSI for that packet. I know that the command to get this information is Msg->strength; However, replacing the payload is where I am stuck. I am having difficulties understanding NesC enough to make this happen. I tried to use the TOSBase app in $TOSHOME/apps/TOSBase/ without any luck. I searched the archives of this board and came across a guy who modified the TOSBase located in $TOSHOME/apps/TransparentBase/ as such 1> event TOS_MsgPtr RadioReceive.receive(TOS_MsgPtr Msg) { 2> TOS_MsgPtr pBuf; 3> dbg(DBG_USR1, "TOSBase received radio packet.\n"); 4> if (Msg->crc) { 5> /* Filter out messages by group id */ 6> if (Msg->group != TOS_AM_GROUP) 7> return Msg; 8> atomic { 9> pBuf = gRxBufPoolTbl[gRxHeadIndex]; 10> if (pBuf->length == 0) { 11> gRxBufPoolTbl[gRxHeadIndex] = Msg; 12> gRxBufPoolTbl[gRxHeadIndex]->data[20] = Msg->strength; //ADDED IN 13> gRxHeadIndex++; gRxHeadIndex %= QUEUE_SIZE; 14> } 15> else { 16> pBuf = NULL; 17> } 18> } 19> 20> if (pBuf) { 21> post RadioRcvdTask(); 22> } 23> else { 24> pBuf = Msg; 25> } 26> } 27> else { 28> pBuf = Msg; 29> } 30> return pBuf; 31> } It is clear that in line #12 we are getting the rssi and it looks to me like we are storing that in gRxBufPoolTbl[gRxHeadIndex]->data[20] However, when I load this program and view the serial output with serial forwarder I still only get the counter coming through. Is there some way I could modify the above code so that the counter is replaced with just the rssi data? Thanks. Paul ***************************************** Paul David Kavan 329 Walter Scott Engineering Center University of Nebraska 402-472-2764 ***************************************** |
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
