GS Data Handling Quick Reference Guide

GainSpan Data Handling Features

In a serial to Wi-Fi application, the data transfers are managed by using various escape sequences. Each starts with the ASCII character 27(0x1B); this is equivalent to the .

1. Normal The Serial to Wi-Fi application supports the following mode of data handling: 2. Bulk mode 1. UART 2. SPI (Byte Stuffing) The embedded host uses one of the following interfaces to connect to the Serial-to-WiFi Application: 3. SPI (Command & Response) 4. SDIO 1. CID 2. IP Address The Serial 2 Wi-Fi application validates the data transfer in the following events: 3. Port Number 4. End of Data

Events

Sl No Mode Protocol Event_4 Event_1 Event_2 Event_3 Escape Command Description Response_1 Response_2 Response_3 (End Of Data Response_4 (CID Validation) (IP Validation) (Port Validation) Validation)

Data handling commands and validation events for the UART Interface

Valid CID O Send Success O

This sequence is used to send data from TCP Server/Client and UDP Client. Example : S0GainSpanE TCP Server/Client and Where, i Normal NA NA UDP Client. S E 0 - Connection Identifier GainSpan - Data E - End Of Data

Invalid CID F Send Fail F

1VV0301434 Rev. 0 1 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server. Example : U0192.168.1.124:8010:GainSpanE Where, 0 - Connection Identifier 192.168.1.124 - IP address Valid CID O Valid IP O Valid Port O Send Success O 8010 - Port Number GainSpan - Data E - End Of Data Note: ESC>F is expected in the following scenario: • During an IP address parsing. U:: range otherwise it sends failure sequence. E 2. It can arise due to an invalid IP address Example : If the IP address is of more than 4 bytes or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). Invalid CID F Invalid IP F Invalid Port F Send Fail F 2. The ':' character is not missing at the end of the port number.

Valid CID O

This sequence is used to send data from TCP Server/Client and UDP Client.

TCP Server/Client and Example : Z00008GainSpan ii Bulk Z NA NA NA UDP Client. Where, 0 - Connection Identifier 0008 - Length of data in 4 ASCII characters GainSpan - Data of above mentioned length

Invalid CID F

1VV0301434 Rev. 0 2 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server EX: Y0:192.168.1.124:8010:0008GainSpan Where, 0 - Connection Idenntifier 192.168.1.124 - IP address 8010 - Port Number 0008 - Length of data in 4 ASCII charecters Valid CID O Valid IP O Valid Port O GainSpan - Data of above mentioned length Note: ESC>F is expected in the following scenario: • During an IP address parsing. 1. Make sure that each byte should be in 0-255 range otherwise it sends failure sequence. Y::: or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). 2. The ':' character is not missing at the end of the port number. Invalid CID F Invalid IP F Invalid Port F

Data handling commands and validation events for the SPI (Byte Stuffing) Interface

Valid CID O Send Success O

This sequence is used to send data from TCP Server/Client and UDP Client. Example : S0GainSpanE TCP Server/Client and i Normal Where, NA NA UDP Client. SE 0 - Connection Idenntifier GainSpan - Data E - End Of Data

Invalid CID F Send Fail F

1VV0301434 Rev. 0 3 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server Example : U0192.168.1.124:8010:GainSpanE Where, Valid CID O Valid IP O Valid Port O Send Success O 0 - Connection Idenntifier 192.168.1.124 - IP address 8010 - Port Number GainSpan - Data E - End Of Data Note: ESC>F is expected in the following scenario: UDP server U:: 1. Make sure that each byte should be in 0-255 E range otherwise it sends failure sequence. 2. It can arise due to an invalid IP address Example : If the IP address is of more than 4 bytes or not sending ':' character at the end of an IP address. • During port number parsing state Invalid CID F Invalid IP F Invalid Port F Send Fail F 1. Make sure that the value should be in range (<65535). 2. The ':' character is not missing at the end of the port number.

Valid CID O

This sequence is used send data from TCP Server/Client and UDP Client.

For example : Z00008GainSpan TCP Server/Client and ii Bulk Z Where, NA NA NA UDP Client. 0 - Connection Identifier 0008 - Length of data in 4 ASCII charecters GainSpan - Data of above mentioned length

Invalid CID F

1VV0301434 Rev. 0 4 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server Example : Y0:192.168.1.124:8010:0008GainSpan Where, 0 - Connection Idenntifier 192.168.1.124 - IP address 8010 - Port Number Valid CID O Valid IP O Valid Port O 0008 - Length of data in 4 ASCII charecters GainSpan - Data of above mentioned length Note: ESC>F is expected in the following scenario: • During an IP address parsing. Y::: 2. It can arise due to an invalid IP address Example : If the IP address is of more than 4 bytes or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). 2. The ':' character is not missing at the end of the Invalid CID F Invalid IP F Invalid Port F port number.

Data handling commands and validation events for the SPI DMA (Command and Response) Interface

Valid CID No Response No Response No Response Send Success No Response

This sequence is used to send data from TCP Server/Client and UDP Client.

TCP Server/Client and Ex: S0GainSpanE i Normal Valid IP Valid Port UDP Client. Where, SE 0 - Connection Idenntifier GainSpan - Data E - End Of Data

Invalid CID F F F Send Fail F

1VV0301434 Rev. 0 5 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server

Example : U0192.168.1.124:8010:GainSpanE Where, 0 - Connection Idenntifier 192.168.1.124 - IP address Valid CID No Response Valid IP O Valid Port O Send Success O 8010 - Port Number GainSpan - Data E - End Of Data

Note: ESC>F is expected in the following scenario: U:: 1. Make sure that each byte should be in 0-255 E range otherwise it sends failure sequence. 2. It can arise due to an invalid IP address Example : If the IP address is of more than 4 bytes or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). Invalid CID F Invalid IP F Invalid Port F Send Fail F 2. The ':' character is not missing at the end of the port number.

Valid CID No Response

This sequence is used to send data from TCP Server/Client and UDP Client.

TCP Server/Client and Example : Z00008GainSpan ii Bulk NA NA NA UDP Client. Where, Z 0 - Connection Identifier 0008 - Length of data in 4 ASCII characters GainSpan - Data of above mentioned length

Invalid CID F

1VV0301434 Rev. 0 6 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server Example : Y0:192.168.1.124:8010:0008GainSpan Where, 0 - Connection Idenntifier 192.168.1.124 - IP address 8010 - Port Number Valid CID No Response Valid IP No Response Valid Port No Response 0008 - Length of data in 4 ASCII charecters GainSpan - Data of above mentioned length Note: ESC>F is expected in the following scenario: • During an IP address parsing. Y::: 2. It can arise due to an invalid IP address Example : If the IP address is of more than 4 bytes or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). Invalid CID F Invalid IP F Invalid Port F 2. The ':' character is not missing at the end of the port number.

Data handling commands and validation events for the SDIO Interface

Valid CID No Response Send Success No Response

This sequence is used send data from TCP Server/Client and UDP Client.

TCP Server/Client and Example : S0GainSpanE i Normal NA NA UDP Client. SE Where, 0 - Connection Idenntifier GainSpan - Data E - End Of Data

Invalid CID F Send Fail F

1VV0301434 Rev. 0 7 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server Example : U0192.168.1.124:8010:GainSpanE Where, 0 - Connection Idenntifier 192.168.1.124 - IP address 8010 - Port Number Valid CID No Response Valid IP No Response Valid Port No Response Send Success No Response GainSpan - Data E - End Of Data Note: ESC>F is expected in the following scenario: • During an IP address parsing. 1. Make sure that each byte should be in 0-255 range otherwise it sends failure sequence. UDP server U:: Example : If the IP address is of more than 4 bytes E or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). 2. The ':' character is not missing at the end of the Invalid CID F Invalid IP F Invalid Port F Send Fail F port number.

Valid CID No Response

This sequence is used send data from TCP Server/Client and UDP Client.

TCP Server/Client and Example : Z00008GainSpan ii Bulk Z NA NA NA UDP Client. Where, 0 - Connection Identifier 0008 - Length of data in 4 ASCII charecters GainSpan - Data of above mentioned length

Invalid CID F

1VV0301434 Rev. 0 8 GS Data Handling Quick Reference Guide

This sequence is used to send data from UDP server Example: Y0:192.168.1.124:8010:0008GainSpan Where, 0 - Connection Idenntifier 192.168.1.124 - IP address 8010 - Port Number Valid CID No Response Valid IP No Response Valid Port No Response 0008 - Length of data in 4 ASCII charecters GainSpan - Data of above mentioned length Note: ESC>F is expected in the following scenario: • During an IP address parsing. 1. Make sure that each byte should be in 0-255 Y::: Example : If the IP address is of more than 4 bytes or not sending ':' character at the end of an IP address. • During port number parsing state 1. Make sure that the value should be in range (<65535). 2. The ':' character is not missing at the end of the port number. Invalid CID F Invalid IP F Invalid Port F

1VV0301434 Rev. 0 9