#include #include #include #include #include #include #include "eui64.h" #include "data_link.h" #define UART_DEVICE_NODE DT_CHOSEN(zephyr_shell_uart) static const struct device *const uart_dev = DEVICE_DT_GET(UART_DEVICE_NODE); int main(void) { if (!device_is_ready(uart_dev)) { printk("UART device not found"); return 0; } if (!eui64_available()) { printk("No EUI-64 address available"); return 0; } uint8_t payload[] = {0xDE, DL_SLIP_END, DL_SLIP_ESC, 0xAD}; uint8_t frame[DL_MAX_FRAME_SIZE]; ssize_t flen = dl_encode_frame(payload, ARRAY_SIZE(payload), frame); if (flen < 0) { printk("Failed to encode frame"); return 0; } while (true) { k_sleep(K_MSEC(1000)); dl_send_frame(uart_dev, frame, flen); } return 0; }