Wirepas SDK
shared_data.h
Go to the documentation of this file.
1 /* Copyright 2019 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
25 #ifndef _SHARED_DATA_H_
26 #define _SHARED_DATA_H_
27 
28 #include <stdint.h>
29 #include "api.h"
30 #include "sl_list.h"
31 
33 #define SHARED_DATA_UNUSED_ENDPOINT -1
34 
36 #define SHARED_DATA_UNUSED_MULTISCAST 0xFFFFFFFF
37 
39 typedef enum
40 {
50 
52 typedef struct
53 {
59  int16_t src_endpoint;
63  int16_t dest_endpoint;
73 
77 typedef struct shared_data_item_s shared_data_item_t;
78 
96  (*shared_data_received_cb_f)(const shared_data_item_t * item,
97  const app_lib_data_received_t * data);
98 
105 {
107  void * reserved;
109  bool reserved2;
111  bool reserved3;
116 };
117 
131 
140 app_res_e Shared_Data_addDataReceivedCb(shared_data_item_t * item);
141 
158 app_res_e Shared_Data_readyToReceive(shared_data_item_t * item);
159 
166 void Shared_Data_removeDataReceivedCb(shared_data_item_t * item);
167 
183  app_lib_data_to_send_t * data,
185 
186 #endif //_SHARED_DATA_H_
shared_data_net_mode_e
shared_data_net_mode_e
Select what type of packet to receive.
Definition: shared_data.h:39
app_lib_data_send_res_e
app_lib_data_send_res_e
A result code returned from lib_data->sendData().
Definition: wms_data.h:141
shared_data_item_s::reserved3
bool reserved3
Definition: shared_data.h:111
shared_data_received_cb_f
app_lib_data_receive_res_e(* shared_data_received_cb_f)(const shared_data_item_t *item, const app_lib_data_received_t *data)
The data reception callback.
Definition: shared_data.h:96
app_res_e
app_res_e
Definition: wms_app.h:201
app_lib_settings_is_group_cb_f
bool(* app_lib_settings_is_group_cb_f)(app_addr_t group_addr)
Callback used for determining on which multicast groups the device belongs.
Definition: wms_settings.h:116
Shared_Data_addDataReceivedCb
app_res_e Shared_Data_addDataReceivedCb(shared_data_item_t *item)
Add a new packet received item to the list. If the item is already in the list it is only updated.
shared_data_filter_t::src_endpoint
int16_t src_endpoint
Definition: shared_data.h:59
shared_data_filter_t::mode
shared_data_net_mode_e mode
Definition: shared_data.h:55
app_lib_data_data_sent_cb_f
void(* app_lib_data_data_sent_cb_f)(const app_lib_data_sent_status_t *status)
Sent packet tracking callback.
Definition: wms_data.h:418
Shared_Data_removeDataReceivedCb
void Shared_Data_removeDataReceivedCb(shared_data_item_t *item)
Remove a received packet item from the list. Removed item fields are all set to 0.
shared_data_filter_t
Structure holding all parameters for packet filtering.
Definition: shared_data.h:52
SHARED_DATA_NET_MODE_ALL
@ SHARED_DATA_NET_MODE_ALL
Definition: shared_data.h:48
shared_data_filter_t::multicast_cb
app_lib_settings_is_group_cb_f multicast_cb
Definition: shared_data.h:71
shared_data_item_s::cb
shared_data_received_cb_f cb
Definition: shared_data.h:113
app_lib_data_receive_res_e
app_lib_data_receive_res_e
Return value of data reception callback.
Definition: wms_data.h:188
shared_data_filter_t::dest_endpoint
int16_t dest_endpoint
Definition: shared_data.h:63
app_lib_data_to_send_t
A struct for lib_data->sendData().
Definition: wms_data.h:333
shared_data_item_s
Item containing filters and callback to call. This structure describe a callback to call when a packe...
Definition: shared_data.h:104
SHARED_DATA_NET_MODE_MULTICAST
@ SHARED_DATA_NET_MODE_MULTICAST
Definition: shared_data.h:46
Shared_Data_readyToReceive
app_res_e Shared_Data_readyToReceive(shared_data_item_t *item)
Enable back the reception for an item. Reception is automatically paused when an item returns APP_LIB...
app_lib_data_received_t
Struct passed to data reception callback functions.
Definition: wms_data.h:285
Shared_Data_init
app_res_e Shared_Data_init(void)
Initialize the shared data library.
shared_data_item_s::filter
shared_data_filter_t filter
Definition: shared_data.h:115
shared_data_item_s::reserved2
bool reserved2
Definition: shared_data.h:109
Shared_Data_sendData
app_lib_data_send_res_e Shared_Data_sendData(app_lib_data_to_send_t *data, app_lib_data_data_sent_cb_f sent_cb)
Send data. The packet to send is represented as a app_lib_data_to_send_t struct.
SHARED_DATA_NET_MODE_UNICAST
@ SHARED_DATA_NET_MODE_UNICAST
Definition: shared_data.h:42
shared_data_item_s::reserved
void * reserved
Definition: shared_data.h:107
SHARED_DATA_NET_MODE_BROADCAST
@ SHARED_DATA_NET_MODE_BROADCAST
Definition: shared_data.h:44
sl_list.h
api.h