BadKB: Lower BLE conn interval like base HID profile

This commit is contained in:
Willy-JL
2024-08-05 20:23:16 +02:00
parent ae37f67466
commit 669cf46ae0

View File

@@ -373,6 +373,12 @@ bool ble_profile_hid_mouse_scroll(FuriHalBleProfileBase* profile, int8_t delta)
return state; return state;
} }
// AN5289: 4.7, in order to use flash controller interval must be at least 25ms + advertisement, which is 30 ms
// Since we don't use flash controller anymore interval can be lowered to 7.5ms
#define CONNECTION_INTERVAL_MIN (0x0006)
// Up to 45 ms
#define CONNECTION_INTERVAL_MAX (0x24)
static GapConfig template_config = { static GapConfig template_config = {
.adv_service_uuid = HUMAN_INTERFACE_DEVICE_SERVICE_UUID, .adv_service_uuid = HUMAN_INTERFACE_DEVICE_SERVICE_UUID,
.appearance_char = GAP_APPEARANCE_KEYBOARD, .appearance_char = GAP_APPEARANCE_KEYBOARD,
@@ -380,8 +386,8 @@ static GapConfig template_config = {
.pairing_method = GapPairingPinCodeVerifyYesNo, .pairing_method = GapPairingPinCodeVerifyYesNo,
.conn_param = .conn_param =
{ {
.conn_int_min = 0x18, // 30 ms .conn_int_min = CONNECTION_INTERVAL_MIN,
.conn_int_max = 0x24, // 45 ms .conn_int_max = CONNECTION_INTERVAL_MAX,
.slave_latency = 0, .slave_latency = 0,
.supervisor_timeout = 0, .supervisor_timeout = 0,
}, },