#include <stdio.h>
#define DEBUG_LOG_MODULE_NAME "DATA APP"
#define DEBUG_LOG_MAX_LEVEL LVL_INFO
const shared_data_item_t * item,
const shared_data_item_t * item,
static bool filter_multicast_cb(
app_addr_t group_addr);
static shared_data_item_t packet_1 =
{
.cb = shared_data_cb,
.filter = {
.src_endpoint = 10,
.dest_endpoint = 10,
.multicast_cb = NULL
}
};
static shared_data_item_t packet_2 =
{
.cb = shared_data_cb,
.filter = {
.src_endpoint = 20,
.dest_endpoint = 20,
.multicast_cb = NULL
}
};
static shared_data_item_t packet_3 =
{
.cb = shared_data_cb,
.filter = {
.multicast_cb = filter_multicast_cb
}
};
static shared_data_item_t packet_4 =
{
.cb = shared_data_cb_filter4,
.filter = {
.src_endpoint = 11,
.dest_endpoint = 11,
.multicast_cb = NULL
}
};
{
LOG(
LVL_INFO,
"Packet sent (src ep: %u, dest ep: %u, tracking_id: %d, "
"success: %d).",
}
static uint32_t enable_reception()
{
}
const shared_data_item_t * item,
{
(void) item;
(void) data;
static bool blocked = false;
if (blocked)
{
blocked = false;
}
else
{
blocked = true;
}
}
const shared_data_item_t * item,
{
LOG(
LVL_INFO,
"packet received with filter (src ep: %u, dest ep: %u, mode: %u).",
item->filter.src_endpoint,
item->filter.dest_endpoint,
(uint8_t)item->filter.mode);
if(item == &packet_2)
{
packet_2.cb = shared_data_cb;
{
packet_2.filter.dest_endpoint = 30;
packet_2.filter.src_endpoint = 30;
}
else
{
packet_2.filter.dest_endpoint = 20;
packet_2.filter.src_endpoint = 20;
}
}
}
static bool filter_multicast_cb(
app_addr_t group_addr)
{
LOG(
LVL_INFO,
"Multicast filter (group_addr: %u).", group_addr);
if (group_addr == 0x80000002)
{
return true;
}
else
{
return false;
}
}
{
(void) functions;
{
return;
}
lib_state->startStack();
}
#define APP_SCHEDULER_STOP_TASK
Value to return from task to remove it.
app_scheduler_res_e App_Scheduler_addTask_execTime(task_cb_f cb, uint32_t delay_ms, uint32_t exec_time_us)
Add a task.
#define LOG(level, fmt,...)
Print a log message if its severity is lower or equal to DEBUG_LOG_MAX_LEVEL.
__STATIC_INLINE app_res_e configureNodeFromBuildParameters()
Wrapper on top of configureNode to get parameters from build system and hardcoded values from chip (f...
#define SHARED_DATA_UNUSED_ENDPOINT
@ SHARED_DATA_NET_MODE_MULTICAST
@ SHARED_DATA_NET_MODE_UNICAST
@ SHARED_DATA_NET_MODE_ALL
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_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_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.
List of global functions, passed to App_entrypoint()
@ APP_LIB_DATA_SEND_FLAG_NONE
app_lib_data_tracking_id_t tracking_id
app_lib_data_receive_res_e
Return value of data reception callback.
@ APP_LIB_DATA_RECEIVE_RES_NO_SPACE
@ APP_LIB_DATA_RECEIVE_RES_HANDLED
Struct to tracking callback function.
A struct for lib_data->sendData().
Struct passed to data reception callback functions.