fixup! Rename BT_DISCONNECT to BT_DISC

This commit is contained in:
Chris Andreae 2023-11-14 12:12:10 +09:00
parent 8a19cf76dd
commit 14d98c5207
No known key found for this signature in database
GPG key ID: 3AA9D181B3ABD33F
3 changed files with 12 additions and 12 deletions

View file

@ -9,7 +9,7 @@
#define BT_PRV_CMD 2 #define BT_PRV_CMD 2
#define BT_SEL_CMD 3 #define BT_SEL_CMD 3
// #define BT_FULL_RESET_CMD 4 // #define BT_FULL_RESET_CMD 4
#define BT_DISCONNECT_CMD 5 #define BT_DISC_CMD 5
/* /*
Note: Some future commands will include additional parameters, so we Note: Some future commands will include additional parameters, so we
@ -20,4 +20,4 @@ defines these aliases up front.
#define BT_NXT BT_NXT_CMD 0 #define BT_NXT BT_NXT_CMD 0
#define BT_PRV BT_PRV_CMD 0 #define BT_PRV BT_PRV_CMD 0
#define BT_SEL BT_SEL_CMD #define BT_SEL BT_SEL_CMD
#define BT_DISCONNECT BT_DISCONNECT_CMD #define BT_DISC BT_DISC_CMD

View file

@ -31,7 +31,7 @@ static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
return zmk_ble_prof_prev(); return zmk_ble_prof_prev();
case BT_SEL_CMD: case BT_SEL_CMD:
return zmk_ble_prof_select(binding->param2); return zmk_ble_prof_select(binding->param2);
case BT_DISCONNECT_CMD: case BT_DISC_CMD:
return zmk_ble_prof_disconnect(binding->param2); return zmk_ble_prof_disconnect(binding->param2);
default: default:
LOG_ERR("Unknown BT command: %d", binding->param1); LOG_ERR("Unknown BT command: %d", binding->param1);

View file

@ -14,7 +14,7 @@ When pairing to a host device ZMK saves bond information to the selected profile
A ZMK device may show as "connected" on multiple hosts at the same time. This is working as intended, and only the host associated with the active profile will receive keystrokes. A ZMK device may show as "connected" on multiple hosts at the same time. This is working as intended, and only the host associated with the active profile will receive keystrokes.
An inactive connected profile can be explicitly disconnected using the `BT_DISCONNECT` behavior. This can be helpful in An inactive connected profile can be explicitly disconnected using the `BT_DISC` behavior. This can be helpful in
cases when host devices behave differently when a bluetooth keyboard is connected, for example by hiding their on-screen cases when host devices behave differently when a bluetooth keyboard is connected, for example by hiding their on-screen
keyboard. keyboard.
@ -34,13 +34,13 @@ This will allow you to reference the actions defined in this header such as `BT_
Here is a table describing the command for each define: Here is a table describing the command for each define:
| Define | Action | | Define | Action |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BT_CLR` | Clear bond information between the keyboard and host for the selected profile. | | `BT_CLR` | Clear bond information between the keyboard and host for the selected profile. |
| `BT_NXT` | Switch to the next profile, cycling through to the first one when the end is reached. | | `BT_NXT` | Switch to the next profile, cycling through to the first one when the end is reached. |
| `BT_PRV` | Switch to the previous profile, cycling through to the last one when the beginning is reached. | | `BT_PRV` | Switch to the previous profile, cycling through to the last one when the beginning is reached. |
| `BT_SEL` | Select the 0-indexed profile by number. Please note: this definition must include a number as an argument in the keymap to work correctly. eg. `BT_SEL 0` | | `BT_SEL` | Select the 0-indexed profile by number. Please note: this definition must include a number as an argument in the keymap to work correctly. eg. `BT_SEL 0` |
| `BT_DISCONNECT` | Disconnect from the 0-indexed profile by number, if it's currently connected and inactive. Please note: this definition must include a number as an | | `BT_DISC` | Disconnect from the 0-indexed profile by number, if it's currently connected and inactive. Please note: this definition must include a number as an |
| | argument in the keymap to work correctly. eg. `BT_DISCONNECT 0` | | | argument in the keymap to work correctly. eg. `BT_DISC 0` |
:::note Selected profile persistence :::note Selected profile persistence
The profile that is selected by the `BT_SEL`/`BT_PRV`/`BT_NXT` actions will be saved to flash storage and hence persist across restarts and firmware flashes. The profile that is selected by the `BT_SEL`/`BT_PRV`/`BT_NXT` actions will be saved to flash storage and hence persist across restarts and firmware flashes.