Skip to content

Commit

Permalink
feat(ble): update ble_adv_mode_get()
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Nov 10, 2024
1 parent 1a70ef9 commit 75ea53a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/include/zmk/ble.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int zmk_ble_unpair_all(void);
int zmk_ble_set_device_name(char *name);

void zmk_ble_adv_mode_set(bool mode);
enum advertising_type zmk_ble_adv_mode_get();
bool zmk_ble_adv_mode_get(void);

#if IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
int zmk_ble_put_peripheral_addr(const bt_addr_le_t *addr);
Expand Down
2 changes: 1 addition & 1 deletion app/src/behaviors/behavior_bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
zmk_ble_adv_mode_set(false);
return 0;
case BT_ADV_TOG_CMD:
zmk_ble_adv_mode_set((zmk_ble_adv_mode_get() == ZMK_ADV_CONN) ? false : true);
zmk_ble_adv_mode_set(zmk_ble_adv_mode_get() ? false : true);
return 0;
default:
LOG_ERR("Unknown BT command: %d", binding->param1);
Expand Down
2 changes: 1 addition & 1 deletion app/src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void zmk_ble_adv_mode_set(bool mode) {
}
}

enum advertising_type zmk_ble_adv_mode_get() { return advertising_status; }
bool zmk_ble_adv_mode_get(void) { return permit_adv; }

static void clear_profile_bond(uint8_t profile) {
if (bt_addr_le_cmp(&profiles[profile].peer, BT_ADDR_LE_ANY)) {
Expand Down

0 comments on commit 75ea53a

Please sign in to comment.