Demo application for using the AT&T IoT Starter Kit Powered by AWS.

Dependencies:   SDFileSystem

Fork of ATT_AWS_IoT_demo by Anthony Phillips

Embed: (wiki syntax)

« Back to documentation index

network_interface.h File Reference

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.

Functions

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

Detailed Description

Network interface definition for MQTT client.

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.

Definition in file network_interface.h.


Typedef Documentation

typedef struct Network Network

Network Type.

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

Definition at line 63 of file network_interface.h.


Function Documentation

int iot_tls_connect ( Network pNetwork,
TLSConnectParams  TLSParams 
)

Create a TLS socket and open the connection.

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

Definition at line 272 of file network_mbedtls_wrapper.cpp.

int iot_tls_destroy ( Network pNetwork )

Perform any tear-down or cleanup of TLS layer.

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

Definition at line 469 of file network_mbedtls_wrapper.cpp.

void iot_tls_disconnect ( Network pNetwork )

Disconnect from network socket.

Parameters:
Network- Pointer to a Network struct defining the network interface.

Definition at line 463 of file network_mbedtls_wrapper.cpp.

int iot_tls_init ( Network pNetwork )

Initialize the TLS implementation.

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

Definition at line 235 of file network_mbedtls_wrapper.cpp.

int iot_tls_is_connected ( Network pNetwork )

Check if TLS layer is still connected.

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

Definition at line 267 of file network_mbedtls_wrapper.cpp.

int iot_tls_read ( Network ,
unsigned char *  ,
int  ,
int   
)

Read bytes from the network socket.

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

Definition at line 440 of file network_mbedtls_wrapper.cpp.

int iot_tls_write ( Network ,
unsigned char *  ,
int  ,
int   
)

Write bytes to the network socket.

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

Definition at line 423 of file network_mbedtls_wrapper.cpp.

int net_modem_boot ( void   )

Boots the WNC modem.

Definition at line 111 of file network.cpp.