[Tinyos-help] Reading from Log using LogRead

Anbu Sorna sorna.anbu at yahoo.com
Wed Aug 15 22:25:03 PDT 2012


Hi,


I installed BlinkToRadio application in one telosb mote..
and installed another application that uses LogWrite and LogRead..This application receives packet(nodeid 2 bytes and counter 2 bytes) from BlinkToRadio..
While reading from Log using LogRead.read,  how to separate message as 2 bytes...ie how to retrieve nodeid and counter separately from log...
My sample code..

typedef nx_struct logentry_t{
            nx_unit8_t len;
            message_t msg;
}logentry_t;

logentry_t  m_entry;
........
........
event LogRead.readDone(void* buf, storage_len_t len, error_t err)
{
logentry_t m_entry = (logentry_t*)buf;
printf("Message %u",m_entry->msg);
printfflush();
.....
...}

it returns default value 16657 for all messages...
i also tried using another structure
typedef nx_struct logentry_t{
            nx_unit8_t len;
            nx_unit16_t nodeid;
            nx_uint16_t counter;
}logentry_t;

but it didn't work...and how to currrentoffset here...
Plz help..
Thanks in Advance...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20120816/7ea56048/attachment.htm 


More information about the Tinyos-help mailing list