|
IoT managed integrations End Device SDK
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "core_pkcs11.h"#include "transport_interface.h"Go to the source code of this file.
Classes | |
| struct | iotmiPal_SessionToken |
| Structure to hold session token information. More... | |
| struct | iotmiPal_TransportPkcs11Credentials |
| Contains the credentials necessary for TLS connection setup. More... | |
Macros | |
| #define | IOTMI_PSK_TOKEN_SIZE 32 |
| PSK token size in bytes (64 hex chars = 32 bytes) | |
| #define | IOTMI_PSK_IDENTITY_SIZE 32 |
| PSK identity size (32 hex chars) | |
Typedefs | |
| typedef struct iotmiPal_SessionToken | iotmiPal_SessionToken_t |
| Structure to hold session token information. | |
| typedef struct NetworkContext * | NetworkContextHandle_t |
| typedef struct iotmiPal_TransportPkcs11Credentials | iotmiPal_TransportPkcs11Credentials_t |
| Contains the credentials necessary for TLS connection setup. | |
| typedef void(* | iotmiPal_TransportReceiveCallback_t) (void *pCallbackContext) |
| Callback function to be called when transport data is ready. | |
Functions | |
| int32_t | iotmiPal_transportConnectPKCS11 (NetworkContextHandle_t networkContextHandle, const char *pHostName, uint16_t port, const iotmiPal_TransportPkcs11Credentials_t *pTransportPkcs11Credentials) |
| Setup a mutual authenticated TLS connection. | |
| void | iotmiPal_transportDisconnect (NetworkContextHandle_t networkContextHandle) |
| Disconnect TLS connection. | |
| int32_t | iotmiPal_transportRecv (NetworkContextHandle_t networkContextHandle, void *pBuffer, size_t bytesToRecv) |
| Transport interface receive function implementation. | |
| int32_t | iotmiPal_transportSend (NetworkContextHandle_t networkContextHandle, const void *pBuffer, size_t bytesToSend) |
| Transport interface send function implementation. | |
| int32_t | iotmiPal_transportRegisterReceiveCallback (NetworkContextHandle_t networkContextHandle, iotmiPal_TransportReceiveCallback_t pReceiveCallback, void *pCallbackContext) |
| Setup a callback function for receive. This function is called after a connection is setup. The pReceiveCallback receive callback function passed to the API is thread safe. | |
This file defines network transport platform abstraction interface.
| typedef void(* iotmiPal_TransportReceiveCallback_t) (void *pCallbackContext) |
Callback function to be called when transport data is ready.
| [in] | pCallbackContext | The pCallbackContext parameter passed in iotmiPal_transportRegisterReceiveCallback. |
| typedef struct NetworkContext* NetworkContextHandle_t |
The NetworkContext is an incomplete type. An implementation of this interface must define struct NetworkContext for the system's requirements.
| int32_t iotmiPal_transportConnectPKCS11 | ( | NetworkContextHandle_t | networkContextHandle, |
| const char * | pHostName, | ||
| uint16_t | port, | ||
| const iotmiPal_TransportPkcs11Credentials_t * | pTransportPkcs11Credentials | ||
| ) |
Setup a mutual authenticated TLS connection.
| networkContextHandle | port defined network context to setup the TLS connection. |
| pHostName | MQTT endpoint to connect. |
| port | MQTT port to connect. |
| pTlsPkcs11Credentials | PKCS11 credentials for the TLS connection. |
| void iotmiPal_transportDisconnect | ( | NetworkContextHandle_t | networkContextHandle | ) |
Disconnect TLS connection.
| networkContextHandle | port defined network context to setup the TLS connection. |
| int32_t iotmiPal_transportRecv | ( | NetworkContextHandle_t | networkContextHandle, |
| void * | pBuffer, | ||
| size_t | bytesToRecv | ||
| ) |
Transport interface receive function implementation.
| int32_t iotmiPal_transportRegisterReceiveCallback | ( | NetworkContextHandle_t | networkContextHandle, |
| iotmiPal_TransportReceiveCallback_t | pReceiveCallback, | ||
| void * | pCallbackContext | ||
| ) |
Setup a callback function for receive. This function is called after a connection is setup. The pReceiveCallback receive callback function passed to the API is thread safe.
| [in] | networkContextHandle | port defined network context to setup the TLS connection. |
| [in] | pReceiveCallback | Receive callback function to be called when transport data is ready. |
| [in] | pCallbackContext | callback context to be passed in the pReceiveCallback callback function. |
| int32_t iotmiPal_transportSend | ( | NetworkContextHandle_t | networkContextHandle, |
| const void * | pBuffer, | ||
| size_t | bytesToSend | ||
| ) |
Transport interface send function implementation.