25 lines
416 B
C
25 lines
416 B
C
|
|
#include <stdint.h>
|
||
|
|
#include <stddef.h>
|
||
|
|
|
||
|
|
#include <zephyr/kernel.h>
|
||
|
|
|
||
|
|
#include "ble.h"
|
||
|
|
|
||
|
|
static void oninput(const void *buffer, uint16_t buffer_len);
|
||
|
|
|
||
|
|
int main(void)
|
||
|
|
{
|
||
|
|
ble_init();
|
||
|
|
ble_register_oninput_callback(oninput);
|
||
|
|
|
||
|
|
while (1) {
|
||
|
|
k_sleep(K_MSEC(1000));
|
||
|
|
k_yield();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void
|
||
|
|
oninput(const void *buffer, uint16_t buffer_len)
|
||
|
|
{
|
||
|
|
ble_set_telemetry_data(buffer, buffer_len);
|
||
|
|
}
|