|
AWS IoT Embedded C Device SDK
|
Network interface definition for MQTT client. More...
#include <stdint.h>#include <stdbool.h>#include <aws_iot_error.h>#include "timer_interface.h"#include "network_platform.h"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 | |
| IoT_Error_t | iot_tls_init (Network *pNetwork, char *pRootCALocation, char *pDeviceCertLocation, char *pDevicePrivateKeyLocation, char *pDestinationURL, uint16_t DestinationPort, uint32_t timeout_ms, bool ServerVerificationFlag) |
| Initialize the TLS implementation. More... | |
| IoT_Error_t | iot_tls_connect (Network *pNetwork, TLSConnectParams *TLSParams) |
| Create a TLS socket and open the connection. More... | |
| IoT_Error_t | iot_tls_write (Network *, unsigned char *, size_t, Timer *, size_t *) |
| Write bytes to the network socket. More... | |
| IoT_Error_t | iot_tls_read (Network *, unsigned char *, size_t, Timer *, size_t *) |
| Read bytes from the network socket. More... | |
| IoT_Error_t | iot_tls_disconnect (Network *pNetwork) |
| Disconnect from network socket. More... | |
| IoT_Error_t | iot_tls_destroy (Network *pNetwork) |
| Perform any tear-down or cleanup of TLS layer. More... | |
| IoT_Error_t | iot_tls_is_connected (Network *pNetwork) |
| Check if TLS layer is still connected. More... | |
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.
Defines a type for the network struct. See structure definition below.
| IoT_Error_t iot_tls_connect | ( | Network * | pNetwork, |
| TLSConnectParams * | TLSParams | ||
| ) |
Creates an open socket connection including TLS handshake.
| pNetwork | - Pointer to a Network struct defining the network interface. |
| TLSParams | - TLSConnectParams defines the properties of the TLS connection. |
| IoT_Error_t iot_tls_destroy | ( | Network * | pNetwork | ) |
| IoT_Error_t iot_tls_disconnect | ( | Network * | pNetwork | ) |
| IoT_Error_t iot_tls_init | ( | Network * | pNetwork, |
| char * | pRootCALocation, | ||
| char * | pDeviceCertLocation, | ||
| char * | pDevicePrivateKeyLocation, | ||
| char * | pDestinationURL, | ||
| uint16_t | DestinationPort, | ||
| uint32_t | timeout_ms, | ||
| bool | ServerVerificationFlag | ||
| ) |
Perform any initialization required by the TLS layer. Connects the interface to implementation by setting up the network layer function pointers to platform implementations.
| pNetwork | - Pointer to a Network struct defining the network interface. |
| pRootCALocation | - Path of the location of the Root CA |
| pDeviceCertLocation | - Path to the location of the Device Cert |
| pDevicyPrivateKeyLocation | - Path to the location of the device private key file |
| pDestinationURL | - The target endpoint to connect to |
| DestinationPort | - The port on the target to connect to |
| timeout_ms | - The value to use for timeout of operation |
| ServerVerificationFlag | - used to decide whether server verification is needed or not |
| IoT_Error_t iot_tls_is_connected | ( | Network * | pNetwork | ) |
| IoT_Error_t iot_tls_read | ( | Network * | , |
| unsigned char * | , | ||
| size_t | , | ||
| Timer * | , | ||
| size_t * | |||
| ) |
| Network | - Pointer to a Network struct defining the network interface. |
| unsigned | char pointer - pointer to buffer where read bytes should be copied |
| size_t | - number of bytes to read |
| Timer | * - operation timer |
| size_t | - pointer to store number of bytes read |
| IoT_Error_t iot_tls_write | ( | Network * | , |
| unsigned char * | , | ||
| size_t | , | ||
| Timer * | , | ||
| size_t * | |||
| ) |
1.8.10