Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
connection.h File Reference
#include <liblwm2m.h>
#include <stdio.h>
#include <unistd.h>
#include "openthread/ip6.h"
#include "openthread/udp.h"
#include "ca821x_error.h"
Include dependency graph for connection.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  { CONPOOL_SIZE = 2 , LINK_MTU = 1280 }
 

Functions

connection_tconnection_create (otInstance *aInstance, lwm2m_context_t *lwm2mH, lwm2m_object_t *secObjectP, uint16_t secObjInstID)
 Connect to the server defined in the security object. 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
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 *  secObjectP,
uint16_t  secObjInstID 
)

Connect to the server defined in the security object.

Note that the actual connection may not be complete when this function returns, due to host resolution.

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

Parameters
aInstanceOpenthread Instance pointer
lwm2mHWakaama instance pointer
secObjectPPointer to the security object
secObjInstIDSecurity object instance ID
Returns
A pointer to the new connection, 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