From 1a7d1d53f651888d93c99cf71816deca9e810c69 Mon Sep 17 00:00:00 2001 From: yswallow <1426202+yswallow@users.noreply.github.com> Date: Fri, 11 Mar 2022 18:09:10 +0900 Subject: [PATCH] Enabling Completely Wireless You can use SplitType.BLE and HIDModes.BLE at the same time --- kmk/modules/split.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kmk/modules/split.py b/kmk/modules/split.py index 1c33408..0c6d10c 100644 --- a/kmk/modules/split.py +++ b/kmk/modules/split.py @@ -167,7 +167,7 @@ class Split(Module): def before_matrix_scan(self, keyboard): if self.split_type == SplitType.BLE: - self._check_all_connections() + self._check_all_connections(keyboard) self._receive_ble(keyboard) elif self.split_type == SplitType.UART: if self._is_target or self.data_pin2: @@ -215,13 +215,16 @@ class Split(Module): self._uart_connection.connection_interval = 11.25 self._psave_enable = False - def _check_all_connections(self): + def _check_all_connections(self, keyboard): '''Validates the correct number of BLE connections''' self._previous_connection_count = self._connection_count self._connection_count = len(self._ble.connections) if self._is_target: if self._advertising or not self._check_if_split_connected(): self._target_advertise() + elif self._connection_count < 2 and keyboard.hid_type == HIDModes.BLE: + keyboard._hid_helper.start_advertising() + elif not self._is_target and self._connection_count < 1: self._initiator_scan()