Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
connection.c File Reference
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "ca-ot-util/cascoda_dns.h"
#include "openthread/dns.h"
#include "openthread/thread.h"
#include "ca821x_log.h"
#include "connection.h"
#include "object_security.h"
Include dependency graph for connection.c:

Functions

ca_error split_hostname (char *uri, char **hostp, char **portp)
 
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...
 
uint8_t lwm2m_buffer_send (void *sessionH, uint8_t *buffer, size_t length, void *userdata)
 
bool lwm2m_session_is_equal (void *session1, void *session2, void *userData)
 

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

◆ lwm2m_buffer_send()

uint8_t lwm2m_buffer_send ( void *  sessionH,
uint8_t *  buffer,
size_t  length,
void *  userdata 
)

◆ lwm2m_session_is_equal()

bool lwm2m_session_is_equal ( void *  session1,
void *  session2,
void *  userData 
)

◆ split_hostname()

ca_error split_hostname ( char *  uri,
char **  hostp,
char **  portp 
)