|
Thanks for your comments Erik,
These bytes, I directly write them to serial port of PC, I mean
they are inside a byte array, so I guess it should be counted as
serial line. I am really confused with these layer stuff. What do
you mean if it is coming from upper layer (I mean what is upper
layer?) it is bad? I think since this is directly being written
into serial port so I guess it is the serial line you mentioned.
It at least toggles the Led0 of telosb motes, I reviewed the code
for BaseStation app and I think if a packet being transmitted in ,
maybe!, correct format the BaseStation app toggles that LED.
In TEP113 there are two bytes '7d 5d', I assume this is a case of delimiter usage (so
when converting to integer or ascii to it should be treaded as a
single byte '7d' I guess).
Would you mind giving some comments about my new discoveries!!
if you mind?!
Regards,
Sean.
On 17-10-2012 0:04, Eric Decker wrote:
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. 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
|
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help