#ifndef BLINKY_PROTO_TX_EVENT_H_ #define BLINKY_PROTO_TX_EVENT_H_ #include #include #include #include #include #include "proto_common.h" #ifdef __cplusplus extern "C" { #endif struct proto_tx_event { struct app_event_header header; enum proto_transport transport; struct event_dyndata dyndata; }; APP_EVENT_TYPE_DYNDATA_DECLARE(proto_tx_event); static inline int submit_proto_tx_event(enum proto_transport transport, const uint8_t *data, size_t len) { struct proto_tx_event *event; if ((transport >= PROTO_TRANSPORT_COUNT) || ((data == NULL) && (len > 0U))) { return -EINVAL; } event = new_proto_tx_event(len); event->transport = transport; if (len > 0U) { memcpy(event->dyndata.data, data, len); } APP_EVENT_SUBMIT(event); return 0; } #ifdef __cplusplus } #endif #endif /* BLINKY_PROTO_TX_EVENT_H_ */