Sample binary datagram description
The sample datagram contains sample data from each "ping". The datagram may have different size and contain different kinds of data, depending on the DataType parameter. This is a binary datagram. The type is RAW3.
Format
struct SampleDatagram
  {
  DatagramHeaderDgHeader;
  char ChannelID[128];
  short Datatype;
  char Spare[2];
  long Offset;
  long Count;
  byte Samples[];
  };
Description
•  DatagramHeader DgHeader: This is the binary datagram in use. The type is RAW3.
•  ChannelID[128]: This is the channel identification.
•  Datatype:
–  Bit 0 = Power
–  Bit 1 = Angle
–  Bit 2 = ComplexFloat16
–  Bit 3 = ComplexFloat32
–  Bit 8 - 10 = Number of Complex per Samples
•  Spare[2]: This is a parameter for future expansions
•  Offset: This is the first sample number.
•  Count: This is the total number of samples.
•  Samples[]: These are the received sample values.
The number of values in Samples[] depends on the value of Count and the Datatype.
The sample values S(i,n) are arranged as:
Real(S(1,1)), Imag(S(1,1)),
Real(S(2,1)), Imag(S(2,1)),
Real(S(3,1)), Imag(S(3,1)),
Real(S(4,1)), Imag(S(4,1)),
Real(S(1,2)), Imag(S(1,2)), ...
Example
We have a DataType decimal value of 1032.
Decimal number 1032 = Hexadecimal 0408 = Binary 0000 0100 0000 1000.
•  Bit 3 is set to "1", so this is ComplexFloat32 data.
•  Bits 8 to 10 are 100, which means that we have four complex values per sample.
The decimal value of 1032 means that Samples[] contains ComplexFloat32 samples. Each sample consists of four complex numbers (one from each of the four transducer sectors). In this case Samples[] consists of 4*2*Count values of 32 bit floats. This is because each sample consists of four complex numbers, and each of these consists of one real part and one imaginary part.
Record of changes
1 1.23: No changes made
2 1.22: No changes made
3 1.21: No changes made
4 1.20: No changes made