Hy Yip Chi Chung, take a look at opt /moteiv/tos/lib/MultiHopLQI/MultiHopLQIM.nc.
The neighbour ID 0xFFFF (=65535) represents the broadcast address (TOS_BCAST_ADDR). This constant is originally defined in /moteiv/tos/lib/CC2420Radio/AM.h and the value is copied to MHOP_INVALID_PARENT at line 38 in MultiHopLQIM.nc. At line 39 you can see, that the link quality 0x7FFF (=32767) indicates MHOP_INVALID_COST. Both are initial values for an entry in the neighbours table, so I think your table has no (or no valid) entry. I assume that your WSN contains only one mote, because you send your data directly over the UART. In that case the table would be empty. Also note that the link quality represents the costs of the whole end-to-end connection. The LQI value of every mote (in a multihop WSN) will be summed up. Regards, OLE -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Hui KANG Gesendet: Donnerstag, 12. April 2007 02:26 An: [EMAIL PROTECTED]; [EMAIL PROTECTED] Betreff: Re: [Tinyos-help] Problem in getting neighbor ID and link quality Probably the value of neighborsize is greater than MHOP_PARENT_SIZE. I am not so sure. > uint8_t retransmissions; > uint16_t neighbors[MHOP_PARENT_SIZE]; > uint16_t quality[MHOP_PARENT_SIZE]; >} DataMsg; >.... > > for (i = 0; i < neighborsize; i++) { > message->neighbors[i] = neighbors[i]; > message->quality[i] = quality[i]; > } On 4/11/2007, "YIP Chi Chung" <[EMAIL PROTECTED]> wrote: >Hi, > >I am writing a program to get the information like temperature, neighbor >ID and link quality etc. from tmote. Collected data will send back to PC >through UART. > >However, I failed to get the neighbor ID and link quality from mote. My >program is modify from Delta. It keep returning 65535 for neighbor ID and >32767 for link quality. And someone tell me how to solve it? > >Thank you very much > >Here is my code: > >DataMsg.h >#ifndef H_DataMsg_h >#define H_DataMsg_h > >#include "MultiHop.h" > >enum { > AM_DATAMSG = 26 >}; > >typedef struct DataMsg { > uint16_t src; > uint16_t humidity; > uint16_t temperature; > uint16_t par; > uint16_t intTemp; > uint16_t intVoltage; > uint8_t neighborsize; > uint8_t retransmissions; > uint16_t neighbors[MHOP_PARENT_SIZE]; > uint16_t quality[MHOP_PARENT_SIZE]; >} DataMsg; > >#endif > > >MoteDataM.nc >... >//function for sending data back to PC > task void SendData() { > > TOS_Msg msg; > uint8_t neighborsize; > > uint16_t neighbors[MHOP_PARENT_SIZE]; > uint16_t quality[MHOP_PARENT_SIZE]; > > int i; > > DataMsg *message = (DataMsg *)msg.data; > > message->src = TOS_LOCAL_ADDRESS; > message->humidity = humidity; > message->temperature = temperature; > message->par = par; > message->intTemp = itemp; > message->intVoltage = ivolt; > > neighborsize = call RouteStatistics.getNeighborSize(); > > call RouteStatistics.getNeighbors(neighbors, neighborsize); > call RouteStatistics.getNeighborQuality(quality, neighborsize); > > for (i = 0; i < neighborsize; i++) { > message->neighbors[i] = neighbors[i]; > message->quality[i] = quality[i]; > } > > message->neighborsize = neighborsize; > message->retransmissions = call RouteStatistics.getRetransmissions(); > > if (call SendUART.send(TOS_UART_ADDR, sizeof(DataMsg), &msg)) { > call Leds.redToggle(); > } > > } >... > >Yip Chi Chung > >_______________________________________________ >Tinyos-help mailing list >[EMAIL PROTECTED] >https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _______________________________________________ Tinyos-help mailing list [EMAIL PROTECTED] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _______________________________________________ Tinyos-help mailing list [EMAIL PROTECTED] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
