KNX IoT
KNX IoT Point API stack implementation
oc_buffer.h
Go to the documentation of this file.
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
21 #ifndef OC_BUFFER_H
22 #define OC_BUFFER_H
23 
24 #include "port/oc_connectivity.h"
25 #include "util/oc_memb.h"
26 #include "util/oc_process.h"
27 #include <stdbool.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 OC_PROCESS_NAME(message_buffer_handler);
34 
40 oc_message_t *oc_allocate_message(void);
41 
47 void oc_set_buffers_avail_cb(oc_memb_buffers_avail_callback_t cb);
48 
55 oc_message_t *oc_allocate_message_from_pool(struct oc_memb *pool);
56 
64 
70 void oc_message_add_ref(oc_message_t *message);
71 
77 void oc_message_unref(oc_message_t *message);
78 
84 void oc_recv_message(oc_message_t *message);
85 
91 void oc_send_message(oc_message_t *message);
92 
100 
108 
115 
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* OC_BUFFER_H */
void oc_close_all_tls_sessions(void)
close all tls sessions
oc_message_t * oc_allocate_message_from_pool(struct oc_memb *pool)
allocate message from specific memory pool
int oc_buffer_num_free_outgoing()
Get the number of outgoing buffers.
void oc_message_unref(oc_message_t *message)
remove reference (for tracking in use)
oc_message_t * oc_allocate_message(void)
function to allocate a message
int oc_buffer_num_free_incoming()
Get the number of incoming buffers.
void oc_recv_message(oc_message_t *message)
receive (CoAP) message
void oc_message_add_ref(oc_message_t *message)
add reference (for tracking in use)
void oc_set_buffers_avail_cb(oc_memb_buffers_avail_callback_t cb)
set callback for memory availability
void oc_send_message(oc_message_t *message)
send (CoAP) message
void oc_close_all_tls_sessions_for_device(size_t device)
close all tls session for the specific device
oc_message_t * oc_internal_allocate_outgoing_message(void)
allocate message internal function
platform abstraction of networking
OC_PROCESS_NAME(oc_network_events)
process network events