just use and/or operations, define a 2 byte message field. modify the concerned fields using shift operations, for example this code will divide your 8 bit value into 2, 4-bit values
part1=8bitvalue/128; // lower half part2=8bitvalue-part1*128; // upper half On Wed, Oct 27, 2010 at 4:15 PM, lucky eyes <[email protected]>wrote: > > Hi, > > I want to broadcast a message from one mote to other motes but I want to > divide its data field into 3 parts so that i can define my own values > > for example: > > 4 bits for any value,4 bits for another value and some bits for another > value so that recipient can separately analyze these information > > What is technique to apply this procedure? > > Thanks in advance > > Best Wishes > > A.Q.Ansari > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Wasif Masood
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
