[Tinyos-devel] RE: Bug in C_Serial Forwarder
Devan Rehunathan
rehunathan at gmail.com
Fri Feb 15 02:26:29 PST 2008
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.
Devan R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20080215/230a21ac/attachment.html
More information about the Tinyos-devel
mailing list