Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

Embed: (wiki syntax)

« Back to documentation index

TCP Methods

TCP Methods
[Socket]

TCP methods. More...

Functions

WiconnectResult tcpConnect (WiconnectSocket &socket, const char *host, uint16_t remortPort GPIO_IRQ_ARG_NC)
 Connect to remote TCP server.
WiconnectResult tcpListen (uint16_t listeningPort, int maxClients=0 GPIO_IRQ_ARG_NC)
 Start internal TCP server and listen on specified port.
WiconnectResult tcpAccept (WiconnectSocket &socket, uint32_t timeoutMs=WICONNECT_WAIT_FOREVER)
 Wait for next client to connect to TCP server.
WiconnectResult tcpServerStop (void)
 Stop TCP server from listening on port.

Detailed Description

TCP methods.


Function Documentation

WiconnectResult tcpAccept ( WiconnectSocket socket,
uint32_t  timeoutMs = WICONNECT_WAIT_FOREVER 
) [inherited]

Wait for next client to connect to TCP server.

Parameters:
[in]socketSocket to connected client
[in]timeoutMsOptional, specifiy maximum amount of time in ms to wait for a client
Returns:
Result of method. See WiconnectResult
WiconnectResult tcpConnect ( WiconnectSocket socket,
const char *  host,
uint16_t remortPort  GPIO_IRQ_ARG_NC 
) [inherited]

Connect to remote TCP server.

Parameters:
[out]socketTCP WiconnectSocket object of opened connection.
[in]hostThe host/IP address of the remote TCP server
[in]remortPortThe port of the remote server
[in]irqPinOptional, Data available external interrupt pin. See registerSocketIrqHandler() for more info
Returns:
Result of method. See WiconnectResult
WiconnectResult tcpListen ( uint16_t  listeningPort,
int  maxClients = 0 GPIO_IRQ_ARG_NC 
) [inherited]

Start internal TCP server and listen on specified port.

Parameters:
[in]listeningPortThe local port the server should listen on
[in]maxClientsOptional, the maximum simultaneous connected clients, 0 is default, 1-8 valid range
[in]irqPinOptional, Data available external interrupt pin. See registerSocketIrqHandler() for more info
Returns:
Result of method. See WiconnectResult
WiconnectResult tcpServerStop ( void   ) [inherited]

Stop TCP server from listening on port.

Close all connected clients.

Returns:
Result of method. See WiconnectResult