When on TCP protocol, at first, device is going to send its IMEI to server. It will be send it like: 000F313233343536373839313233343536
- "000F" is the IMEI lenght (15bytes long)
- 313233343536373839313233343536 is the device IMEI but codified (IMEI: 123456789123456)
When device connects to server, it must response "00 or 01" for connection. The "00" rejects the IMEI and "01" accepts the IMEI.
Note that confirmation should be sent as binary packet.
When server accepts it, device will start to send the AVL Data packet. After the server receives a packet and parses it, server must report to the module the number of received data as integer. (four bytes)
For example: if server received 1 packet, server must respond: 00000001, if 2 packets are received, server must respond: 00000002
Hope this can help you