Joey Wilson wrote: > Now, the problem that I am having is that the alignment of each packet > coming in can be different. For example, if I know the 3rd byte is the > node ID, I try to read the 3rd byte. This shifts around though, so I > can't parse the data consistently. I think it is happening whenever a > packet is corrupted/dropped over the radio. Does the basestation > program do something to compensate for corrupted packets that I am not > taking into account in my matlab code?
TinyOS doesn't use constant-sized serial packets, which is probably what's causing your problem. Even if your payloads are always the same type and size, the TinyOS serial stack does escaping that can add some bytes to the packet. If you're using TinyOS 2.x, then TEP 113 gives pretty good documentation of the TinyOS serial format. > Is there a better way to read the serial data directly into matlab > without having these parsing issues? Any help is appreciated. Thanks. Since MATLAB has the ability to embed Java code, you could try using TinyOS's Java SDK. I don't know if/how MATLAB handles callbacks from Java to MATLAB, but it's worth looking into at least. Greg Hackmann _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
