On Tue, Oct 16, 2012 at 3:22 AM, Sean Dekker <[email protected]> wrote:
> Hello, > > If anyone remember I was asking for serial packet format quite a while > ago. I managed to make a packet and send it to BaseStation app, by sending > this packet, the Led0 (Red LED) of the telosb mote toggles. I assume this > means the packet has been transfred from PC to mote in correct format. Is > this right? > > Here is the packet I managed to make: > Where are you observing these bytes? 7e is an hdlc start/end delimiter, 7d is the hdlc escape that is used to escape both 7e and 7d which can't occur in the body of the packet. If you are sending this bytes from an upper layer then it is wrong. If this is what you are observing on the serial line then that is much better. I'm not sure where you are getting your data from. Take a look at the bottom of TEP 113 <http://www.tinyos.net/tinyos-2.x/doc/html/tep113.html>. The format you have listed below is wrong. Its close though. The sequence number is 1 byte. It is followed by what they call the dispatch byte but really is packet format identifier. 00 says the packet payload is in the AM format (Active Messaging). > 7E 44 00 00 FF FF 00 00 02 06 00 00 64 7B 7E > > byte[0] = 0x7E //start bit > byte[1] = 0x44 //Message Type > byte[2,3] = 0x0000 //Sequence number > byte[4,5] = 0xFFFF //Destination Address (AM_BROADCAST = 65535) > byte[6,7] = 0x0000 //Source Address > byte[8] = 0x02 //Payload size, in this case payload is 2 bytes both zero > byte[9,10] = 0x0000 //My messege (payload) to be sent > byte[11,12] = 0x647B //Calculated CRC from byte[1] to byte [10] > byte[13] = 0x7E //end bit > > > Can somone please confirm that I am making a correct packet and if it is > accodring to the format? also is the byte[2,3] really the Sequence Number!? > What are they being used for? How can I take care of escape sequence? Does > somone have a C/C# code for this case?! > > Regards, > Sean. > > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Eric B. Decker Senior (over 50 :-) Researcher
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
