1. TCP packet protocol flow.

When a device as a client, the interval between connection servers is 1~3 minutes, and in extreme cases 11~13 minutes.

The flow chart is shown below:(Please disable all virtual NICs, otherwise LocalSetting may not be able to find the device.)

  .1 Negotiate the transport protocol version.

The transmission protocol version negotiation consists of two aspects: the upper computer sends the protocol version request to the lower computer; the lower computer sends the return protocol version response to the upper computer.

Request

 

Field

packet length

command

Version

byte

2

2

4

value

8

kSDKServiceAsk

LOCAL_TCP_VERSION

 

Respond

Field

packet length

command

Version

byte

2

2

4

value

8

kSDKServiceAnswer

(current version)

 1. If the error code returned is kVersionTooLow, the connection should be disconnected.

2.2 Negotiate the SDK protocol version.

SDK protocol version negotiation uses "SDK protocol interaction" for communication. The upper computer sends the "SDK protocol version request" to the lower computer then the lower computer sends the "SDK protocol version response" to the upper computer.

   

             See GetIFVersion for details.

2.3 SDK protocol interaction.

The SDK protocol interaction consists of two aspects: the upper computer sends the "SDK interface request" to the lower computer, and the lower computer sends the "SDK interface response" to the upper computer. 

SDK interface request

Field

packet length

command

XmlData length

index

XmlData

byte

2

2

4

4

N

value

kSDKCmdAsk

Description

1.  packet length: 2+2+4+4+N;

2.  XmlData length:  The total length of the xml data.(maxlen = 2*1024*1024).

3.  indexThe index position of XmlData in the current data packet in the SDK interface data.

4.  XmlDataSDK interface data content; XmlData has a maximum length of 9*1024 (2 + 2 + 4 + 4) bytes in the current packet.

 

SDK interface response

Field

packet length

command

XmlData length

index

XmlData

byte

2

2

4

4

N

value

kSDKCmdAnswer

Description

Same as the SDK interface request description.

 

 

2.UDP packet protocol flow.

   

Description

    1.The packet format is a normal UDP packet.

    2.  Use only udp packets to search for devices on the LAN, and TCP is used in all other cases.

 

Use UDP to send broadcast data to find LAN devices, not required.

A、 Request

Field

Version

Command

 

byte

4

2

value

LOCAL_UDP_VERSION

kSearchDeviceAsk

 

B、 Respond

Field

Version

Command

Device ID

change flag

byte

4

2

15

4

value

LOCAL_UDP_VERSION

kSearchDeviceAnswer

ID

change

Description:

a)   When the device ID string is less than 15 bytes, the remaining bytes are filled with '\0'.

b)    The field change flag indicates a device information change flag. When the device information in the control card changes, the value is automatically incremented by one, and the initial value of change is 0.