Hi, I just want to make packets in C# and send to a TelosB mote. As simple as that but I couldn' make this packet yet. Can you please check what I am doing wrong?
Here is the struct that I have defined and programmed into TelosB mote: typedef nx_struct pc_serial_msg { nx_uint8_t sequenceNumber; nx_uint16_t controlCommand; } pc_serial_msg; And here is the code that responsible to make the packet: private Byte[] MakePacket(byte command) { //Increment the sequence _sequenceNumber++; var pkt = new byte[10]; //START FLAG pkt[0] = 0x7E; //HEADER pkt[1] = 0xf; //Destination pkt[2] = 0xf; //Source pkt[3] = 0xf; //Length ??? pkt[4] = 0x1; //Group pkt[5] = 0x1; //Type //PAYLOAD pkt[6] = _sequenceNumber; pkt[7] = command; //Generating CRC pkt[8] = 0x1; //END pkt[9] = 0x7E; //END return pkt; } Can you tell me what I have to put in Destination, Source, Group and Type bytes? What is Length? is it the length of the packet that is going to be transmitet and equals number of bytes in the packet? Am I atleast in the right track or this is totaly wrong? Thanks, Sean.
_______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help