Remove error reporting from ble utility functions that never error

This commit is contained in:
Chris Andreae 2023-12-18 23:08:12 +09:00 committed by Pete Johanson
parent b8cb407351
commit 604c95118e
3 changed files with 8 additions and 10 deletions

View file

@ -20,11 +20,11 @@
#define ZMK_BLE_PROFILE_COUNT CONFIG_BT_MAX_PAIRED #define ZMK_BLE_PROFILE_COUNT CONFIG_BT_MAX_PAIRED
#endif #endif
int zmk_ble_clear_bonds(void); void zmk_ble_clear_bonds(void);
int zmk_ble_prof_next(void); int zmk_ble_prof_next(void);
int zmk_ble_prof_prev(void); int zmk_ble_prof_prev(void);
int zmk_ble_prof_select(uint8_t index); int zmk_ble_prof_select(uint8_t index);
int zmk_ble_clear_all_bonds(void); void zmk_ble_clear_all_bonds(void);
int zmk_ble_prof_disconnect(uint8_t index); int zmk_ble_prof_disconnect(uint8_t index);
int zmk_ble_active_profile_index(void); int zmk_ble_active_profile_index(void);

View file

@ -24,7 +24,8 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
struct zmk_behavior_binding_event event) { struct zmk_behavior_binding_event event) {
switch (binding->param1) { switch (binding->param1) {
case BT_CLR_CMD: case BT_CLR_CMD:
return zmk_ble_clear_bonds(); zmk_ble_clear_bonds();
return 0;
case BT_NXT_CMD: case BT_NXT_CMD:
return zmk_ble_prof_next(); return zmk_ble_prof_next();
case BT_PRV_CMD: case BT_PRV_CMD:
@ -32,7 +33,8 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
case BT_SEL_CMD: case BT_SEL_CMD:
return zmk_ble_prof_select(binding->param2); return zmk_ble_prof_select(binding->param2);
case BT_CLR_ALL_CMD: case BT_CLR_ALL_CMD:
return zmk_ble_clear_all_bonds(); zmk_ble_clear_all_bonds();
return 0;
case BT_DISC_CMD: case BT_DISC_CMD:
return zmk_ble_prof_disconnect(binding->param2); return zmk_ble_prof_disconnect(binding->param2);
default: default:

View file

@ -210,7 +210,7 @@ static void update_advertising_callback(struct k_work *work) { update_advertisin
K_WORK_DEFINE(update_advertising_work, update_advertising_callback); K_WORK_DEFINE(update_advertising_work, update_advertising_callback);
int zmk_ble_clear_bonds(void) { void zmk_ble_clear_bonds(void) {
LOG_DBG(""); LOG_DBG("");
if (bt_addr_le_cmp(&profiles[active_profile].peer, BT_ADDR_LE_ANY)) { if (bt_addr_le_cmp(&profiles[active_profile].peer, BT_ADDR_LE_ANY)) {
@ -220,11 +220,9 @@ int zmk_ble_clear_bonds(void) {
} }
update_advertising(); update_advertising();
return 0;
}; };
int zmk_ble_clear_all_bonds(void) { void zmk_ble_clear_all_bonds(void) {
LOG_DBG("zmk_ble_clear_all_bonds()"); LOG_DBG("zmk_ble_clear_all_bonds()");
// Unpair all profiles // Unpair all profiles
@ -237,8 +235,6 @@ int zmk_ble_clear_all_bonds(void) {
// Automatically switch to profile 0 // Automatically switch to profile 0
zmk_ble_prof_select(0); zmk_ble_prof_select(0);
return 0;
}; };
int zmk_ble_active_profile_index(void) { return active_profile; } int zmk_ble_active_profile_index(void) { return active_profile; }