I wrote a simple program to test the protocol today, and I got the answer by
myself:

1. The sequence number isn't insert in the package from mote to PC, but it
is required in the one that transmitted from PC to mote;

2. CRC should be calculated just after the delimiting byte;

3. Thanks to jpaek, I just forward his message to answer my previous
question:


> ---------- Forwarded message ----------
> From: Jeongyeup Paek
> Date: Fri, Apr 11, 2008 at 1:34 AM
> Subject: Re: [Tinyos-help] How to send a message from PC to mote through
> UART?
> To: Li Jianfeng
> Cc: Greg Hackmann, [email protected]
>
>
> There are two levels of packet formatting.
> First is related to 'Serial.h', and second is related to delimiting
> and escaping.
>
> Serial.h has been modified (2.0.0->2.0.2->2.HEAD)...
> so you might have problems if you have different versions of code...
> or TEPS might not have been updated.
>
> Regarding the delimiting and escaping stuff, you can forget about them
> if you use the c code in support/sdk/c/sf/*...
> use 'write_serial_packet' to send packets, or look at the the examples
> in that directory.
>
> If you have the cvs head, then this is how you might want to structure
> the packet (in your C# code) before you sending it down to the
> 'write_serial_packet' or 'write_sf_packet' function in support/sdk/c/sf/*;
>
> typedef struct message_t {
>  uint8_t pad;                // must set this to zero
>  uint16_t addr;
>  uint16_t src;
>  uint8_t length;
>  uint8_t group;
>  uint8_t type;
>  uint8_t data[TOSH_DATA_LENGTH];
> } __attribute((packed)) message_t;
>
> Thanks
>
> - jpaek


And I also noticed that the packet type MUST be set as 0x44.

May this message help!

Regards,
Jennifer

On Thu, Apr 10, 2008 at 8:39 PM, Li Jianfeng <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I have three questions about TEP 113:
>
> 1. In section 3.3, it is mentioned that in the default implementation, a
> sequence number sending is not activated. Does it mean that when I send a
> message from PC to mote through UART, I should not include this byte in my
> data package if I use SerialActiveMessageC.Receive on my mote?
>
> In section 3.6
>
> 2.  It is said that two-byte CRC is calculated over S to end of Payload,
> however, in net.tinyos.packet.Packetizer, CRC is calculated just after the
> delimiting byte. So from which byte should we start to calculate the CRC?
>
> 3. The document illustrate an example at the end of this section.
> Shouldn't there be two bytes between destination_byte and data_length_byte
> as the Serial.h defined?
>
> Thank you for your time!
>
> Regards,
> Jennifer
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to