Merge remote-tracking branch 'upstream/master'

This commit is contained in:
jacob.eva 2024-07-12 13:35:48 +01:00
commit 54fce74b67
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E

View File

@ -281,6 +281,11 @@ bool bt_passkey_callback(uint16_t conn_handle, uint8_t const passkey[6], bool ma
return false; return false;
} }
void bt_connect_callback(uint16_t conn_handle) {
bt_state = BT_STATE_CONNECTED;
cable_state = CABLE_STATE_DISCONNECTED;
}
void bt_disconnect_callback(uint16_t conn_handle, uint8_t reason) { void bt_disconnect_callback(uint16_t conn_handle, uint8_t reason) {
bt_state = BT_STATE_ON; bt_state = BT_STATE_ON;
} }
@ -302,6 +307,7 @@ bool bt_setup_hw() {
Bluefruit.setTxPower(8); // Check bluefruit.h for supported values Bluefruit.setTxPower(8); // Check bluefruit.h for supported values
Bluefruit.Security.setIOCaps(true, true, false); Bluefruit.Security.setIOCaps(true, true, false);
Bluefruit.Security.setPairPasskeyCallback(bt_passkey_callback); Bluefruit.Security.setPairPasskeyCallback(bt_passkey_callback);
Bluefruit.Periph.setConnectCallback(bt_connect_callback);
Bluefruit.Periph.setDisconnectCallback(bt_disconnect_callback); Bluefruit.Periph.setDisconnectCallback(bt_disconnect_callback);
Bluefruit.Security.setPairCompleteCallback(bt_pairing_complete); Bluefruit.Security.setPairCompleteCallback(bt_pairing_complete);
const ble_gap_addr_t gap_addr = Bluefruit.getAddr(); const ble_gap_addr_t gap_addr = Bluefruit.getAddr();