#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <inttypes.h>
#define DATA_EP 5
static const uint8_t beacon_hdr[] =
{
0x42,
0x10, 0x32, 0x54, 0x76, 0x00, 0xc0,
0x02, 0x01, 0x04,
0x03, 0x03, 0xaa, 0xfe,
0x06, 0x16, 0xaa, 0xfe, 0x10, 0xf7,
0x00
};
static size_t makeBeacon(uint8_t * buffer,
const uint8_t * url,
size_t url_num_bytes)
{
{
return 0;
}
memcpy(buffer, beacon_hdr, sizeof(beacon_hdr));
app_res_e res = lib_settings->getNodeAddress(&addr);
{
return 0;
}
buffer[1] = (uint8_t)((addr >> 0) & 0xff);
buffer[2] = (uint8_t)((addr >> 8) & 0xff);
buffer[3] = (uint8_t)((addr >> 16) & 0xff);
buffer[4] = (uint8_t)((addr >> 24) & 0xff);
buffer[14] += url_num_bytes;
memcpy(buffer + sizeof(beacon_hdr), url, url_num_bytes);
return sizeof(beacon_hdr) + (size_t)url_num_bytes;
}
const shared_data_item_t * item,
{
size_t beacon_num_bytes;
(strncmp((
const char *)(data->
bytes), (
const char *)
"url ", 4) != 0))
{
}
else if ((beacon_num_bytes = makeBeacon(beacon,
{
data_to_send.
bytes = (
const uint8_t *)
"ERR";
lib_data->sendData(&data_to_send);
}
lib_beacon_tx->clearBeacons();
lib_beacon_tx->setBeaconInterval(333);
int8_t power = 8;
lib_beacon_tx->setBeaconPower(0, &power);
lib_beacon_tx->setBeaconChannels(
lib_beacon_tx->setBeaconContents(0, beacon, beacon_num_bytes);
lib_beacon_tx->enableBeacons(true);
data_to_send.
bytes = (
const uint8_t *)
"OK";
}
static shared_data_item_t all_packets_filter =
{
.cb = dataReceivedFunc,
.filter = {
.src_endpoint = DATA_EP,
.dest_endpoint = DATA_EP,
.multicast_cb = NULL
}
};
{
{
return;
}
lib_state->startStack();
}