5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches
TCP stream comms

Functions

wiced_result_t wiced_tcp_stream_deinit (wiced_tcp_stream_t *tcp_stream)
 
wiced_result_t wiced_tcp_stream_flush (wiced_tcp_stream_t *tcp_stream)
 
wiced_result_t wiced_tcp_stream_init (wiced_tcp_stream_t *tcp_stream, wiced_tcp_socket_t *socket)
 
wiced_result_t wiced_tcp_stream_read (wiced_tcp_stream_t *tcp_stream, void *buffer, uint16_t buffer_length, uint32_t timeout)
 
wiced_result_t wiced_tcp_stream_read_with_count (wiced_tcp_stream_t *tcp_stream, void *buffer, uint16_t buffer_length, uint32_t timeout, uint32_t *read_count)
 
wiced_result_t wiced_tcp_stream_write (wiced_tcp_stream_t *tcp_stream, const void *data, uint32_t data_length)
 
wiced_result_t wiced_tcp_stream_write_resource (wiced_tcp_stream_t *tcp_stream, const resource_hnd_t *res_id)
 

Detailed Description

Functions for communication over TCP in stream mode Users need not worry about splitting data into packets in this mode

Function Documentation

◆ wiced_tcp_stream_deinit()

wiced_result_t wiced_tcp_stream_deinit ( wiced_tcp_stream_t * tcp_stream)

Deletes a TCP stream

Deletes a stream for a TCP connection.

Parameters
[in,out]tcp_stream: A pointer to a stream handle that will be de-initialised
Returns
wiced_result_t

◆ wiced_tcp_stream_flush()

wiced_result_t wiced_tcp_stream_flush ( wiced_tcp_stream_t * tcp_stream)

Flush pending TCP stream data out to remote host

Flushes any pending data in the TCP stream out to the remote host

Parameters
[in,out]tcp_stream: A pointer to a stream handle whose pending data will be flushed
Returns
wiced_result_t

◆ wiced_tcp_stream_init()

wiced_result_t wiced_tcp_stream_init ( wiced_tcp_stream_t * tcp_stream,
wiced_tcp_socket_t * socket )

Creates a stream for a TCP connection

Creates a stream for a TCP connection. The stream allows the user to write successive small amounts data into the stream without worrying about packet boundaries

Parameters
[out]tcp_stream: A pointer to a stream handle that will be initialised
[in,out]socket: A pointer to an open socket handle.
Returns
wiced_result_t

◆ wiced_tcp_stream_read()

wiced_result_t wiced_tcp_stream_read ( wiced_tcp_stream_t * tcp_stream,
void * buffer,
uint16_t buffer_length,
uint32_t timeout )

Read data from a TCP stream

Parameters
[in,out]tcp_stream: A pointer to a stream handle where data will be written
[out]buffer: The memory buffer to write data into
[in]buffer_length: The number of bytes to read into the buffer
[in]timeout: Timeout value in milliseconds or WICED_NEVER_TIMEOUT
Returns
wiced_result_t

◆ wiced_tcp_stream_read_with_count()

wiced_result_t wiced_tcp_stream_read_with_count ( wiced_tcp_stream_t * tcp_stream,
void * buffer,
uint16_t buffer_length,
uint32_t timeout,
uint32_t * read_count )

Read data from a TCP stream and returns actual number of bytes read

Parameters
[in,out]tcp_stream: A pointer to a stream handle where data will be written
[out]buffer: The memory buffer to write data into
[in]buffer_length: The number of bytes to read into the buffer
[in]timeout: Timeout value in milliseconds or WICED_NEVER_TIMEOUT
[out]read_count: A pointer to an integer to store the actual number of bytes read
Returns
wiced_result_t

◆ wiced_tcp_stream_write()

wiced_result_t wiced_tcp_stream_write ( wiced_tcp_stream_t * tcp_stream,
const void * data,
uint32_t data_length )

Write data into a TCP stream

Write data into an open TCP stream. Data will only be sent if it causes the current internal packet to become full, or if wiced_tcp_stream_flush is called.

Parameters
[in,out]tcp_stream: A pointer to a stream handle where data will be written
[in]data: The memory buffer to send
[in]data_length: The number of bytes in the buffer to send
Returns
wiced_result_t

◆ wiced_tcp_stream_write_resource()

wiced_result_t wiced_tcp_stream_write_resource ( wiced_tcp_stream_t * tcp_stream,
const resource_hnd_t * res_id )

Write data from a resource object into a TCP stream

Write resource object data into an open TCP stream. Data will only be sent if it causes the current internal packet to become full, or if wiced_tcp_stream_flush is called.

Parameters
tcp_stream: A pointer to a stream handle that will be initialised
res_id: The resource to send
Returns
WICED_SUCCESS : on success. WICED_ERROR : if an error occurred