Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
mbedtlsconnection.h File Reference
#include <liblwm2m.h>
#include <stdio.h>
#include <unistd.h>
#include "mbedtls/certs.h"
#include "mbedtls/error.h"
#include "mbedtls/net_sockets.h"
#include "mbedtls/ssl.h"
#include "mbedtls/timing.h"
#include "openthread/ip6.h"
#include "openthread/random_crypto.h"
#include "openthread/udp.h"
#include "cascoda-util/cascoda_tasklet.h"
#include "ca821x_error.h"
Include dependency graph for mbedtlsconnection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  connection_t
 The struct for holding information about each connection the lwm2m stack uses. More...
 

Macros

#define LWM2M_STANDARD_PORT_STR   "5683"
 
#define LWM2M_STANDARD_PORT   5683
 
#define LWM2M_DTLS_PORT_STR   "5684"
 
#define LWM2M_DTLS_PORT   5684
 
#define LWM2M_BSSERVER_PORT_STR   "5685"
 
#define LWM2M_BSSERVER_PORT   5685
 

Typedefs

typedef struct connection_t connection_t
 The struct for holding information about each connection the lwm2m stack uses. More...
 

Enumerations

enum  { CIPHERSUITE_COUNT = 1 , CONPOOL_SIZE = 2 , LINK_MTU = 1280 }
 

Functions

connection_tconnection_create (otInstance *aInstance, lwm2m_context_t *lwm2mH, lwm2m_object_t *securityObj, int instanceId)
 Called from example code directly to create a connection when connecting to a server. More...
 
void connection_free (connection_t *con)
 Free a connection created with connection_create. More...
 
void connection_rx_info_callback (uint16_t aPktLen)
 Callback that can be implemented by the application to track receive statistics. More...
 
void connection_tx_info_callback (uint16_t aPktLen)
 Callback that can be implemented by the application to track transmit statistics. More...
 

Macro Definition Documentation

◆ LWM2M_BSSERVER_PORT

#define LWM2M_BSSERVER_PORT   5685

◆ LWM2M_BSSERVER_PORT_STR

#define LWM2M_BSSERVER_PORT_STR   "5685"

◆ LWM2M_DTLS_PORT

#define LWM2M_DTLS_PORT   5684

◆ LWM2M_DTLS_PORT_STR

#define LWM2M_DTLS_PORT_STR   "5684"

◆ LWM2M_STANDARD_PORT

#define LWM2M_STANDARD_PORT   5683

◆ LWM2M_STANDARD_PORT_STR

#define LWM2M_STANDARD_PORT_STR   "5683"

Typedef Documentation

◆ connection_t

typedef struct connection_t connection_t

The struct for holding information about each connection the lwm2m stack uses.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CIPHERSUITE_COUNT 

We only configure one ciphersuite on the client, based on authentication method.

CONPOOL_SIZE 

Maximum number of concurrent connections.

LINK_MTU 

Maximum Transmission Unit for link.

Function Documentation

◆ connection_create()

connection_t* connection_create ( otInstance *  aInstance,
lwm2m_context_t *  lwm2mH,
lwm2m_object_t *  securityObj,
int  instanceId 
)

Called from example code directly to create a connection when connecting to a server.

Note that the connection will not be immediately active, and will require some time to resolve hostname and form DTLS connection with the server.

Parameters
aInstanceOpenthread Instance pointer
lwm2mHWakaama context pointer
securityObjPointer to LWM2M security object (to extract creds)
instanceIdSecurity object instance ID
Returns
Pointer to the connection created, or NULL if error.

◆ connection_free()

void connection_free ( connection_t con)

Free a connection created with connection_create.

Parameters
conThe connection to free

◆ connection_rx_info_callback()

void connection_rx_info_callback ( uint16_t  aPktLen)

Callback that can be implemented by the application to track receive statistics.

Parameters
aPktLenLength of the received packet

◆ connection_tx_info_callback()

void connection_tx_info_callback ( uint16_t  aPktLen)

Callback that can be implemented by the application to track transmit statistics.

Parameters
aPktLenLength of the received packet