indicator_leds.c calls zmk_endpoint_is_connected(), which isn't compiled on split peripherals. We need to do one of two things to allow indicator LEDs to be used on peripherals:
- Compile a subset of the endpoints code for split peripherals and have the central send its current endpoint state to the peripherals so they can use it.
- Change indicator_leds.c to ignore the endpoint state on peripherals. It will then not be able to match the same behavior as a central, since it won't know when it should change LED brightness because the keyboard is disconnected.
Option 1 would be preferred, however not all functions can or should be implemented.
The following are pure functions, so they will work as-is:
- zmk_endpoint_instance_eq
- zmk_endpoint_instance_to_str
The following functions could be implemented if current_instance and preferred_transport were mirrored from the central to the peripherals:
- zmk_endpoint_get_preferred_transport
- zmk_endpoint_get_preferred
- zmk_endpoint_get_selected
- zmk_endpoint_is_connected
zmk_endpoint_instance_to_index and ZMK_ENDPOINT_COUNT cannot be accurately implemented on peripherals, as they depend on the local CONFIG_ZMK_USB, CONFIG_ZMK_BLE, and ZMK_BLE_PROFILE_COUNT values, which may differ from the ones on the central.
zmk_endpoint_set_preferred_transport and zmk_endpoint_toggle_preferred_transport could theoretically be implemented on peripherals, but I don't see a reason that a peripheral would need to send a message to the central to directly change its preferred transport.
The following functions don't make sense to implement on a peripheral, since only the central sends HID data:
- zmk_endpoint_send_report
- zmk_endpoint_send_mouse_report
- zmk_endpoint_clear_reports
indicator_leds.c calls
zmk_endpoint_is_connected(), which isn't compiled on split peripherals. We need to do one of two things to allow indicator LEDs to be used on peripherals:Option 1 would be preferred, however not all functions can or should be implemented.
The following are pure functions, so they will work as-is:
The following functions could be implemented if
current_instanceandpreferred_transportwere mirrored from the central to the peripherals:zmk_endpoint_instance_to_indexandZMK_ENDPOINT_COUNTcannot be accurately implemented on peripherals, as they depend on the localCONFIG_ZMK_USB,CONFIG_ZMK_BLE, andZMK_BLE_PROFILE_COUNTvalues, which may differ from the ones on the central.zmk_endpoint_set_preferred_transportandzmk_endpoint_toggle_preferred_transportcould theoretically be implemented on peripherals, but I don't see a reason that a peripheral would need to send a message to the central to directly change its preferred transport.The following functions don't make sense to implement on a peripheral, since only the central sends HID data: