Polaroid

Command Write Configure - Control TCP Client Task communicate with Server

 

 

‘T’

‘T’

PL2

Control TCP Client Task communicate with Server

9

 

‘0’

T_Connect_to_Server

 

‘1’

T_Check_Connected_to_Server

 

‘2’

T_Send_String

 

‘3’

T_Send_Binary

 

‘4’

T_Available

 

‘5’

T_Read_String

 

‘6’

T_Read_Binary

 

‘7’

T_Clear_Buffer

 

‘8’

T_Diconnect_to_Server

 

 

HOST send Control T_Connect_to_Server

 


<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘0’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘0’

 

ID Control : T_Connect_to_Server

 

 

PL3

STRING

-

-

1

200

TCP IP address of Server

 

 

PL4

INTEGER

1

65354

-

-

TCP Port number of Server

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘0’

 

ID Control : T_Connect_to_Server

 

 

PL3

INTEGER

-1

2

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

0

Error: No WiFi/Ethernet connection

1

Error: TCP cannot connect to this IP

2

OK : TCP Connected success

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|20|T|T|0|google.com|80|*1D52

ACK Respond

$ESP_OK|50|T|T|0|2|TCP Connected , IP=google.com , Port = 80|*307D

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Check_Connected_to_Server

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘1’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘1’

STRING

-

-

1

1

ID Control : T_Check_Connected_to_Server

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘1’

 

ID Control : T_Check_Connected_to_Server

 

 

PL3

INTEGER

-1

1

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

0

TCP Client-No connection

1

TCP Client- Connected

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|6|T|T|1|*6626

ACK Respond

$ESP_OK|37|T|T|1|1|TCP Client Connected success|*074F

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Send_String

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘2’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘2’

 

ID Control : T_Send_String

 

 

PL3

STRING

-

-

1

1500

Data send in string format

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘2’

 

ID Control : T_Send_String

 

 

PL3

INTEGER

-1

2

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

0

Error : Not connect to Server .

1

Error: Busy TX is sending

2

OK: Send String success

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|29|T|T|2|GET / HTTP/1.1\r\n\r\n|*4470

ACK Respond

$ESP_OK|39|T|T|2|2|TCP Client Send String success|*7F08

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Send_Binary

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘3’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘3’

 

ID Control : T_Send_Binary

 

 

PL3

HEX

-

-

2

1400

Data send in string format

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘3’

 

ID Control : T_Send_Binary

 

 

PL3

INTEGER

-1

2

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

0

Error : Not connect to Server .

1

Error: Busy TX is sending

2

OK: Send Binary success

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|43|T|T|3|474554202f20485454502F312F310D0A0D0A|*775C

ACK Respond

$ESP_OK|39|T|T|3|2|TCP Client Send Binary success|*6418

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Available

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘4’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘4’

STRING

-

-

1

1

ID Control : T_Available

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘4’

 

ID Control : T_Available

 

 

PL3

INTEGER

-1

1000

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

[0,1000]

Size available RX buffer TCP


Example

 

Message :

HOST Send

$ESP_OK|6|T|T|4|*6326

ACK Respond

$ESP_OK|11|T|T|4|5744|*2B5E

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

HOST send Control T_Read_String

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘5’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘5’

 

ID Control : T_Read_String

 

 

PL3

INTEGER

1

1000

-

-

Size read buffer TCP

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘5’

 

ID Control : T_Read_String

 

 

PL3

INTEGER

-1

1000

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

[0,1000]

Size of string respond

 

PL4

STRING

-

-

0

1000

Data read buffer in String format

 


Example

 

Message :

HOST Send

$ESP_OK|9|T|T|5|60|*1701

ACK Respond

$ESP_OK|70|T|T|5|60|abs: -1 Cache-Control: private, max-age=0 Content-Type: text|*123A

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Read_Binary

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘6’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘6’

 

ID Control : T_Read_Binary

 

 

PL3

INTEGER

1

1000

-

-

Size read buffer TCP

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘6’

 

ID Control : T_Read_Binary

 

 

PL3

INTEGER

-1

1000

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

[0,1000]

Size of string respond

 

PL4

STRING

-

-

-

-

Data read buffer in HEX format

 


Example

 

Message :

HOST Send

$ESP_OK|9|T|T|6|60|*1402

ACK Respond

$ESP_OK|130|T|T|6|60|485454502F312E3120323030204F4B0D0A446174653A204D6F6E2C203230204A616E20323032302031333A30373A313620474D540D0A457870697265|*685F

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Clear_Buffer

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘7’

Infor 1

Infor 2

Infor 3

...

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘7’

STRING

-

-

1

1

ID Control : T_Clear_Buffer

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘7’

 

ID Control : T_Clear_Buffer

 

 

PL3

INTEGER

-1

1

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

0

-

1

Clear Buffer Success

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|6|T|T|7|*6026

ACK Respond

$ESP_OK|40|T|T|7|1|TCP Client Clear Buffer Success|*273D

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…

 

 

HOST send Control T_Diconnect_to_Server

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘T’

‘8’

Infor 1

Infor 2

Infor 3

...



 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘8’

STRING

-

-

1

1

ID Control : T_Diconnect_to_Server

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘8’

 

ID Control : T_Diconnect_to_Server

 

 

PL3

INTEGER

-1

1

-

-

Status Control

 

-1

NACK: Invalid input /wrong format / out of range …?

0

-

1

TCP Disconnected Success

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|6|T|T|8|*6F26

ACK Respond

$ESP_OK|25|T|T|8|1|TCP Disconnected|*2952

NACK Respond

 

Other NACK

$ESP_ER|… or $ESS_ER|… or $AES_ER|…