#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,
{
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;
}
}
{
{
return;
}
lib_state->startStack();
}