-
-
Notifications
You must be signed in to change notification settings - Fork 437
BT Remote: Add Rename Option, simplify Bad KB BLE profile #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
09aff0d
[BLE Remote] Add Rename Option
aaronjamt 4aa5286
Fix formatting
aaronjamt 647fe10
Revert changes to firmware
aaronjamt 8200a95
Fix compile error for USB transport
aaronjamt 73c5806
Similar concept for BadKB too
WillyJL b974e7f
Save to setting file, polish the edges a bit
WillyJL 3c21376
Fix LSP warning
WillyJL 73b9779
Update changelog
WillyJL e2fc647
Merge branch 'dev' into patch-3
aaronjamt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #include "ble_hid_ext_profile.h" | ||
|
|
||
| #include <furi.h> | ||
|
|
||
| static FuriHalBleProfileBase* ble_profile_hid_ext_start(FuriHalBleProfileParams profile_params) { | ||
| UNUSED(profile_params); | ||
|
|
||
| return ble_profile_hid->start(NULL); | ||
| } | ||
|
|
||
| static void ble_profile_hid_ext_stop(FuriHalBleProfileBase* profile) { | ||
| ble_profile_hid->stop(profile); | ||
| } | ||
|
|
||
| static void | ||
| ble_profile_hid_ext_get_config(GapConfig* config, FuriHalBleProfileParams profile_params) { | ||
| furi_check(config); | ||
| furi_check(profile_params); | ||
| BleProfileHidExtParams* hid_ext_profile_params = profile_params; | ||
|
|
||
| // Setup config with basic profile | ||
| ble_profile_hid->get_gap_config(config, NULL); | ||
|
|
||
| // Set MAC address | ||
| memcpy(config->mac_address, hid_ext_profile_params->mac, sizeof(config->mac_address)); | ||
|
|
||
| // Set advertise name (skip first byte which is the ADV type) | ||
| strlcpy(config->adv_name + 1, hid_ext_profile_params->name, sizeof(config->adv_name) - 1); | ||
|
|
||
| // Set bonding mode | ||
| config->bonding_mode = hid_ext_profile_params->bonding; | ||
|
|
||
| // Set pairing method | ||
| config->pairing_method = hid_ext_profile_params->pairing; | ||
| } | ||
|
|
||
| static const FuriHalBleProfileTemplate profile_callbacks = { | ||
| .start = ble_profile_hid_ext_start, | ||
| .stop = ble_profile_hid_ext_stop, | ||
| .get_gap_config = ble_profile_hid_ext_get_config, | ||
| }; | ||
|
|
||
| const FuriHalBleProfileTemplate* ble_profile_hid_ext = &profile_callbacks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #pragma once | ||
|
|
||
| #include <ble_profile/extra_profiles/hid_profile.h> | ||
|
|
||
| /** | ||
| * Optional arguments to pass along with profile template as | ||
| * FuriHalBleProfileParams for tuning profile behavior | ||
| **/ | ||
| typedef struct { | ||
| char name[FURI_HAL_BT_ADV_NAME_LENGTH]; /**< Full device name */ | ||
| uint8_t mac[GAP_MAC_ADDR_SIZE]; /**< Full device address */ | ||
| bool bonding; /**< Save paired devices */ | ||
| GapPairing pairing; /**< Pairing security method */ | ||
| } BleProfileHidExtParams; | ||
|
|
||
| /** Hid Keyboard Profile descriptor */ | ||
| extern const FuriHalBleProfileTemplate* ble_profile_hid_ext; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.