Command Write Configure - Control UART_1 and UART_2 on ESPrtk

 

‘T’

‘U’

PL2

Control UART_1 and UART_2 on ESPrtk

8

 

‘0’

U_Start_UART

 

‘1’

U_Check_UART_Started

 

‘2’

U_Send_String

 

‘3’

U_Send_Binary

 

‘4’

U_Available

 

‘5’

U_Read_String

 

‘6’

U_Read_Binary

 

‘7’

U_Clear_Buffer

 

HOST send Control U_Start_UART

 

 

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_Check_UART_Started

 

 

PL3

INTEGER

1

2

-

-

Select UART1 or UART2 for UART_CF

 

 

PL4

INTEGER

2400

1000000

-

-

Baudrate UART_CF

bps

 

PL5

INTEGER

255

2000

-

-

Buffer size RX of UART_CF

byte

 

ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘0’

 

ID Control : U_Check_UART_Started

 

 

PL3

INTEGER

-1

1

-

-

Status Control

 

-1

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

0

-

1

OK

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 

 

Example

 

Message :

HOST Send

$ESP_OK|19|T|U|0|1|57600|1000|*2051

ACK Respond

$ESP_OK|61|T|U|0|1|Start UART_1 success,Baudrate = 57600,RX_Size = 1000|*4C2E

NACK Respond

 

Other NACK

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

 

 

HOST send Control U_Check_UART_Started

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_Check_UART_Started

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘1’

 

ID Control : U_Check_UART_Started

 

 

PL3

INTEGER

-1

1

-

-

Status Control

 

-1

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

0

UART not started

1

UART started

 

PL4

STRING

-

-

-

-

Describe status respond control as text

 


Example

 

Message :

HOST Send

$ESP_OK|6|T|U|1|*6726

ACK Respond

$ESP_OK|31|T|U|1|1|UART Connected success|*4C0F

NACK Respond

 

Other NACK

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

 

 

HOST send Control U_Send_String

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_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 : U_Send_String

 

 

PL3

INTEGER

-1

2

-

-

Status Control

 

-1

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

0

Error : UART_CF was not started .

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|U|2|My String out UART\r\n|*645B

ACK Respond

$ESP_OK|33|T|U|2|2|UART Send String success|*3844

 

NACK Respond

 

Other NACK

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

 

 

HOST send Control U_Send_Binary

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_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 : U_Send_Binary

 

 

PL3

INTEGER

-1

2

-

-

Status Control

 

-1

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

0

Error : UART_CF was not started .

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|17|T|U|3|A0B0D0E12F|*5E6F

ACK Respond

$ESP_OK|33|T|U|3|2|UART Send Binary success|*2354

 

NACK Respond

 

Other NACK

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

 

 

 

HOST send Control U_Available

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_Available

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘4’

 

ID Control : U_Available

 

 

PL3

INTEGER

-1

1000

-

-

Status Control

 

-1

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

[0,1000]

Size available RX buffer UART


Example

 

Message :

HOST Send

$ESP_OK|6|T|U|4|*6226

ACK Respond

$ESP_OK|11|T|U|4|1000|*295F

NACK Respond

 

Other NACK

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

 

 

HOST send Control U_Read_String

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_Read_String

 

 

PL3

INTEGER

1

1000

-

-

Size read buffer UART

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘5’

 

ID Control : U_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|U|5|12|*1307

ACK Respond

$ESP_OK|22|T|U|5|12|$GPGGA,06350|*3827

NACK Respond

 

Other NACK

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

 

 

HOST send Control U_Read_Binary

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_Read_Binary

 

 

PL3

INTEGER

1

1000

-

-

Size read buffer UART

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘6’

 

ID Control : U_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|U|6|12|*1004

ACK Respond

$ESP_OK|34|T|U|6|12|332E3030302C323033342E36|*203B

NACK Respond

 

Other NACK

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

 

 

HOST send Control U_Clear_Buffer

 

<Header> +

<Payload_length>

<Payload>

PL0

PL1

PL2

PL3

PL4

PL5

$ESP_OK|xx|

‘T’

‘U’

‘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 : U_Clear_Buffer

 


ESPrtk Respond

 

Payload

Index

 

Type value

Min

Value

Max

Value

Min Length

Max Length

Describe

Unit

PL2

‘7’

 

ID Control : U_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|U|7|*6126

ACK Respond

$ESP_OK|34|T|U|7|1|UART Clear Buffer Success|*6931

NACK Respond

 

Other NACK

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