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
30#ifndef _SHARED_DATA_H_
31#define _SHARED_DATA_H_
32
33#include <stdint.h>
34#include "api.h"
35#include "sl_list.h"
36
38#define SHARED_DATA_UNUSED_ENDPOINT -1
39
41#define SHARED_DATA_UNUSED_MULTISCAST 0xFFFFFFFF
42
55
78
82typedef struct shared_data_item_s shared_data_item_t;
83
101 (*shared_data_received_cb_f)(const shared_data_item_t * item,
102 const app_lib_data_received_t * data);
103
122
136
145app_res_e Shared_Data_addDataReceivedCb(shared_data_item_t * item);
146
163app_res_e Shared_Data_readyToReceive(shared_data_item_t * item);
164
171void Shared_Data_removeDataReceivedCb(shared_data_item_t * item);
172
190
191#endif //_SHARED_DATA_H_
shared_data_filter_t filter
shared_data_net_mode_e
Select what type of packet to receive.
Definition shared_data.h:45
@ SHARED_DATA_NET_MODE_MULTICAST
Definition shared_data.h:51
@ SHARED_DATA_NET_MODE_BROADCAST
Definition shared_data.h:49
@ SHARED_DATA_NET_MODE_UNICAST
Definition shared_data.h:47
@ SHARED_DATA_NET_MODE_ALL
Definition shared_data.h:53
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.
shared_data_received_cb_f cb
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.
app_lib_settings_is_group_cb_f multicast_cb
Definition shared_data.h:76
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_net_mode_e mode
Definition shared_data.h:60
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_res_e Shared_Data_init(void)
Initialize the shared data library.
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.
Item containing filters and callback to call. This structure describe a callback to call when a packe...
Structure holding all parameters for packet filtering.
Definition shared_data.h:58
app_res_e
Definition wms_app.h:202
app_lib_data_send_res_e
A result code returned from lib_data->sendData().
Definition wms_data.h:142
app_lib_data_receive_res_e
Return value of data reception callback.
Definition wms_data.h:189
void(* app_lib_data_data_sent_cb_f)(const app_lib_data_sent_status_t *status)
Sent packet tracking callback.
Definition wms_data.h:414
A struct for lib_data->sendData().
Definition wms_data.h:330
Struct passed to data reception callback functions.
Definition wms_data.h:286
bool(* app_lib_settings_is_group_cb_f)(app_addr_t group_addr)
Callback used for determining on which multicast groups the device belongs.