1919#include <zmk/events/position_state_changed.h>
2020#include <zmk/events/sensor_event.h>
2121
22+ #include <zmk/events/split_transport_changed.h>
23+
2224LOG_MODULE_DECLARE (zmk , CONFIG_ZMK_LOG_LEVEL );
2325
2426const struct zmk_split_transport_central * active_transport ;
@@ -198,6 +200,8 @@ static int select_first_available_transport(void) {
198200
199201static int transport_status_changed_cb (const struct zmk_split_transport_central * central ,
200202 struct zmk_split_transport_status status ) {
203+ raise_zmk_split_transport_changed (
204+ (struct zmk_split_transport_changed ){.addr = (uint32_t )central , .status = status });
201205 if (central == active_transport ) {
202206 LOG_DBG ("Central at %p changed status: enabled %d, available %d, connections %d" , central ,
203207 status .enabled , status .available , status .connections );
@@ -212,6 +216,16 @@ static int transport_status_changed_cb(const struct zmk_split_transport_central
212216 return 0 ;
213217}
214218
219+ bool zmk_split_transport_get_available (uint32_t addr ) {
220+ STRUCT_SECTION_FOREACH (zmk_split_transport_central , t ) {
221+ if ((uint32_t )t == addr ) {
222+ return t -> api -> get_status ().available ;
223+ }
224+ }
225+
226+ return 0 ;
227+ }
228+
215229static int central_init (void ) {
216230 STRUCT_SECTION_FOREACH (zmk_split_transport_central , t ) {
217231 if (!t -> api -> set_status_callback ) {
0 commit comments