[Tinyos-devel] RE: Bug in C_Serial Forwarder

Philip Levis pal at cs.stanford.edu
Fri Feb 15 08:17:15 PST 2008


On Feb 15, 2008, at 2:26 AM, Devan Rehunathan wrote:

> Hello,
>
> this is my first post, so please forgive me if this is not the  
> correct place.
>
> I'm currently using the C version of the Tmote Serial Forwarder 
> (sf.c) for a project. I believe there is a bug in the forward()  
> function of sf.c. The return values of write_serial_packet() are  
> mismatched. Unacknowledged packets produce a "Note:write failed"  
> error. The correct return values of write_serial_packet() can be  
> found in serialsource.c. Here is my corrected version:
>
> void forward_packet(const void *packet, int len)//Changed bug in  
> error messages->serialsource.c
> {
>   int ok = write_serial_packet(src, packet, len);
>
>   packets_written++;
>   if (ok == 1){
>     fprintf(stderr, "Note: written without ACK\n");
>     }
>   if (ok == 0){
>     fprintf(stderr, "Note: written with ACK\n");
>     }
>   if (ok < 0)
>     fprintf(stderr, "Note: write failed\n");
> }
>
> Any feedback is welcome.

Generally, -help is a better place for simple bug reports. Not that - 
devel is completely inappropriate or anything; it's just that at some  
point -- but clearly not this one -- the distinction between "bug"  
and "I can't get it to work" becomes blurry.

Phil


More information about the Tinyos-devel mailing list