06-25-2008 09:32 AM
06-25-2008 11:01 AM
07-11-2008 12:19 PM
07-11-2008 02:02 PM
07-11-2008 03:31 PM
07-11-2008 03:31 PM
One complication you will have to deal with if you want to
listen to the packets coming out of the transmitter: The transmitter packs
multiple data packets into one UDP packet. The UDP packet format is as follows:
UDP_Packet_Counter [Int32, starts at zero and increases monotonically, 4 bytes]
Data_Packet_1
Data_Packet_2
Data_Packet_3
..
Data_Packet_N
Each Data_Packet has the following format:
AT0, AT1, AT2, AT3, AT4, AT5, AT6, AT7, Acquisition time [8 bytes]
0,0,0,0, Packet_Type_ID [0->packet_wrapper, 4 bytes]
PL1, PL2, Packet_Length = PL2 * 256 + PL1
Packet_Wrapper_Body Packet wrapper body, total of Packet_Length bytes
The Packet_Wrapper_Body has the following format:
TS1, TS2, TS3, TS4, Toolstring number for the toolstring that will receive the packet. For your case TS1 through TS4 are all zeros.
PT1, PT2, PT3, PT4, Packet_Type_ID. The packet you are looking for has values 237, 255, 255, 255.
NPL1, NPL2, NPL3, NPL4, Net_Packet_Length = NPL4 * 16777216 + NPL3 * 65536 + NPL2 * 256 + NPL1.
Packet_Body Packet body, total of Net_Packet_Length bytes.
07-11-2008 03:32 PM
The Packet_Body format is different for each packet type. For packet type -19 (=acquisition started successfully), it is as follows:
4,0,0,0,d,c,b,a, Encoded IP address of sender (in this case, the transmitter)
DEFA,0,0,0, Decimation factor.
So to detect the “acquisition started successfully” packet, you will have to do the following:
Foreach UDP packet
Ignore first 4 bytes
Foreach Data packet (loop until no more bytes are available)
Ignore first 12 bytes
Calculate Packet_Length from the next 2 bytes so you know where the next packet starts.
Ignore next 4 bytes
Verify that next 4 bytes are 237, 255, 255 and 255.
Ignore next 9 bytes
Verify that DEFA equals the DEFA you used when you started acquisition
Skip “Packet_Length – 18” bytes to advance to next packet
07-11-2008 04:18 PM
07-18-2008 11:36 AM
07-18-2008 01:13 PM