2026-04-10 13:46:50 +08:00
|
|
|
#ifndef BLINKY_HID_TRANSPORT_STATE_EVENT_H_
|
|
|
|
|
#define BLINKY_HID_TRANSPORT_STATE_EVENT_H_
|
|
|
|
|
|
|
|
|
|
#include <app_event_manager.h>
|
|
|
|
|
#include <app_event_manager_profiler_tracer.h>
|
|
|
|
|
|
|
|
|
|
#include "keyboard_core.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct hid_transport_state_event {
|
|
|
|
|
struct app_event_header header;
|
|
|
|
|
enum hid_transport transport;
|
|
|
|
|
bool ready;
|
|
|
|
|
bool keys_ready;
|
|
|
|
|
bool consumer_ready;
|
|
|
|
|
enum keyboard_protocol_mode protocol_mode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
APP_EVENT_TYPE_DECLARE(hid_transport_state_event);
|
|
|
|
|
|
2026-04-14 16:42:04 +08:00
|
|
|
static inline void submit_hid_transport_state_event(
|
|
|
|
|
enum hid_transport transport, bool ready, bool keys_ready,
|
|
|
|
|
bool consumer_ready, enum keyboard_protocol_mode protocol_mode)
|
|
|
|
|
{
|
|
|
|
|
struct hid_transport_state_event *event = new_hid_transport_state_event();
|
|
|
|
|
|
|
|
|
|
event->transport = transport;
|
|
|
|
|
event->ready = ready;
|
|
|
|
|
event->keys_ready = keys_ready;
|
|
|
|
|
event->consumer_ready = consumer_ready;
|
|
|
|
|
event->protocol_mode = protocol_mode;
|
|
|
|
|
APP_EVENT_SUBMIT(event);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-10 13:46:50 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* BLINKY_HID_TRANSPORT_STATE_EVENT_H_ */
|