#include <stdlib.h>
#define DEBUG_LOG_MODULE_NAME "CUSTOM_APP"
#define DEBUG_LOG_MAX_LEVEL LVL_NOLOG
#define DEFAULT_PERIOD_S 10
#define DEFAULT_PERIOD_MS (DEFAULT_PERIOD_S*1000)
#define EXECUTION_TIME_US 500
#define SET_PERIOD_EP 10
#define DATA_EP 1
static uint32_t period_ms;
typedef struct __attribute__((packed))
{
uint32_t period_ms;
} payload_periodic_t;
static uint32_t send_data_task(void)
{
static uint32_t id = 0;
data_to_send.
bytes = (
const uint8_t *) &
id;
id++;
return period_ms;
}
const shared_data_item_t * item,
{
{
LOG(
LVL_INFO,
"dataReceiveCb - data was not for this application");
}
payload_periodic_t payload = *((payload_periodic_t *)data->
bytes);
period_ms = payload.period_ms;
}
static shared_data_item_t alltype_packets_filter =
{
.cb = dataReceivedCb,
.filter = {
.src_endpoint = SET_PERIOD_EP,
.dest_endpoint = SET_PERIOD_EP,
.multicast_cb = NULL
}
};
{
{
return;
}
period_ms = DEFAULT_PERIOD_MS;
EXECUTION_TIME_US);
lib_state->startStack();
}