KNX IoT
KNX IoT Point API stack implementation
oc_buffer.h File Reference

CoAP message buffer implementation, e.g. More...

#include "port/oc_connectivity.h"
#include "util/oc_memb.h"
#include "util/oc_process.h"
#include <stdbool.h>

Go to the source code of this file.

Functions

oc_message_t * oc_allocate_message (void)
 function to allocate a message More...
 
oc_message_t * oc_allocate_message_from_pool (struct oc_memb *pool)
 allocate message from specific memory pool More...
 
int oc_buffer_num_free_incoming ()
 Get the number of incoming buffers. More...
 
int oc_buffer_num_free_outgoing ()
 Get the number of outgoing buffers. More...
 
void oc_close_all_tls_sessions (void)
 close all tls sessions More...
 
void oc_close_all_tls_sessions_for_device (size_t device)
 close all tls session for the specific device More...
 
oc_message_t * oc_internal_allocate_outgoing_message (void)
 allocate message internal function More...
 
void oc_message_add_ref (oc_message_t *message)
 add reference (for tracking in use) More...
 
void oc_message_unref (oc_message_t *message)
 remove reference (for tracking in use) More...
 
 OC_PROCESS_NAME (message_buffer_handler)
 
void oc_recv_message (oc_message_t *message)
 receive (CoAP) message More...
 
void oc_send_message (oc_message_t *message)
 send (CoAP) message More...
 
void oc_set_buffers_avail_cb (oc_memb_buffers_avail_callback_t cb)
 set callback for memory availability More...
 

Detailed Description

CoAP message buffer implementation, e.g.

for the payloads being transferred

Definition in file oc_buffer.h.

Function Documentation

◆ oc_allocate_message()

oc_message_t* oc_allocate_message ( void  )

function to allocate a message

Returns
oc_message_t* the allocated message

◆ oc_allocate_message_from_pool()

oc_message_t* oc_allocate_message_from_pool ( struct oc_memb *  pool)

allocate message from specific memory pool

Parameters
poolthe memory pool to use for allocation
Returns
oc_message_t* the message

◆ oc_buffer_num_free_incoming()

int oc_buffer_num_free_incoming ( )

Get the number of incoming buffers.

If this reaches zero, the KNX-IoT stack will drop further received UDP messages

Returns
int the number of buffers

◆ oc_buffer_num_free_outgoing()

int oc_buffer_num_free_outgoing ( )

Get the number of outgoing buffers.

If this is zero and you attempt to send out a message, it will be silently dropped

Returns
int the number of buffers

◆ oc_close_all_tls_sessions()

void oc_close_all_tls_sessions ( void  )

close all tls sessions

◆ oc_close_all_tls_sessions_for_device()

void oc_close_all_tls_sessions_for_device ( size_t  device)

close all tls session for the specific device

Parameters
devicethe device index

◆ oc_internal_allocate_outgoing_message()

oc_message_t* oc_internal_allocate_outgoing_message ( void  )

allocate message internal function

Returns
oc_message_t* the CoAP message

◆ oc_message_add_ref()

void oc_message_add_ref ( oc_message_t *  message)

add reference (for tracking in use)

Parameters
messagethe message

◆ oc_message_unref()

void oc_message_unref ( oc_message_t *  message)

remove reference (for tracking in use)

Parameters
messagethe message

◆ oc_recv_message()

void oc_recv_message ( oc_message_t *  message)

receive (CoAP) message

Parameters
messagethe received message

◆ oc_send_message()

void oc_send_message ( oc_message_t *  message)

send (CoAP) message

Parameters
messagethe CoAP message

◆ oc_set_buffers_avail_cb()

void oc_set_buffers_avail_cb ( oc_memb_buffers_avail_callback_t  cb)

set callback for memory availability

Parameters
cbthe callback