AWS IoT Embedded C Device SDK
Data Structures | Typedefs | Functions
network_interface.h File Reference

Network interface definition for MQTT client. More...

Go to the source code of this file.

Data Structures

struct  TLSConnectParams
 TLS Connection Parameters. More...
 
struct  Network
 Network Structure. More...
 

Typedefs

typedef struct Network Network
 Network Type. More...
 

Functions

int iot_tls_init (Network *pNetwork)
 Initialize the TLS implementation. More...
 
int iot_tls_connect (Network *pNetwork, TLSConnectParams TLSParams)
 Create a TLS socket and open the connection. More...
 
int iot_tls_write (Network *, unsigned char *, int, int)
 Write bytes to the network socket. More...
 
int iot_tls_read (Network *, unsigned char *, int, int)
 Read bytes from the network socket. More...
 
void iot_tls_disconnect (Network *pNetwork)
 Disconnect from network socket. More...
 
int iot_tls_destroy (Network *pNetwork)
 Perform any tear-down or cleanup of TLS layer. More...
 
int iot_tls_is_connected (Network *pNetwork)
 Check if TLS layer is still connected. More...
 

Detailed Description

Defines an interface to the TLS layer to be used by the MQTT client. Starting point for porting the SDK to the networking layer of a new platform.

Typedef Documentation

typedef struct Network Network

Defines a type for the network struct. See structure definition below.

Function Documentation

int iot_tls_connect ( Network pNetwork,
TLSConnectParams  TLSParams 
)

Creates an open socket connection including TLS handshake.

Parameters
pNetwork- Pointer to a Network struct defining the network interface.
TLSParams- TLSConnectParams defines the properties of the TLS connection.
Returns
integer - successful connection or TLS error
int iot_tls_destroy ( Network pNetwork)

Called to cleanup any resources required for the TLS layer.

Parameters
Network- Pointer to a Network struct defining the network interface.
Returns
integer - successful cleanup or TLS error
void iot_tls_disconnect ( Network pNetwork)
Parameters
Network- Pointer to a Network struct defining the network interface.
int iot_tls_init ( Network pNetwork)

Perform any initialization required by the TLS layer. Connects the interface to implementation by setting up the network layer function pointers to platform implementations.

Parameters
pNetwork- Pointer to a Network struct defining the network interface.
Returns
integer defining successful initialization or TLS error
int iot_tls_is_connected ( Network pNetwork)

Called to check if the TLS layer is still connected or not.

Parameters
Network- Pointer to a Network struct defining the network interface.
Returns
int - integer indicating status of network physical layer connection
int iot_tls_read ( Network ,
unsigned char *  ,
int  ,
int   
)
Parameters
Network- Pointer to a Network struct defining the network interface.
unsignedchar pointer - pointer to buffer where read bytes should be copied
integer- number of bytes to read
integer- read timeout value in milliseconds
Returns
integer - number of bytes read or TLS error
int iot_tls_write ( Network ,
unsigned char *  ,
int  ,
int   
)
Parameters
Network- Pointer to a Network struct defining the network interface.
unsignedchar pointer - buffer to write to socket
integer- number of bytes to write
integer- write timeout value in milliseconds
Returns
integer - number of bytes written or TLS error