Hi, You might want to look at MsgReader. I also created a class based on MsgReader where I receive packets from serial (byte[]) and convert to my own message (using the class generated in mig). You should look specifically (if I remember correctly...) at the packetizer class. Best regards,
Joao On 2008/10/29, at 08:26, Carolin Latze wrote: > Hello everybody, > > I implemented a SerialForwarder like message forwarder where I read > packets using packetReceived and send them to my clients using > writePacket inside packetReceived. My forwarder should not only > forward, but also filter messages according to their types (my > sensors send debug and sensor messages and I only want to forward > the sensor messages). Is there any easy way to convert the byte[] > packet into a Message? I tried several things but got lost in all > those offsets... I also found out, that there is an example in > net.tinyos.message.Receiver but that uses protected methods of > Message. > > Any hints are appreciated! > Regards > Carolin > _______________________________________________ > 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
