Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
85d96613
Commit
85d96613
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
feat(ble): Only announce HID if enabled
parent
21492497
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!382
HID over BLE
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/ble_main.c
+29
-1
29 additions, 1 deletion
epicardium/ble/ble_main.c
with
29 additions
and
1 deletion
epicardium/ble/ble_main.c
+
29
−
1
View file @
85d96613
...
...
@@ -185,6 +185,29 @@ static const uint8_t bleAdvDataDisc[] =
DM_ADV_TYPE_128_UUID_PART
,
CARD10_UUID_SUFFIX
,
0x0
,
CARD10_UUID_PREFIX
,
2
,
/*! length */
DM_ADV_TYPE_TX_POWER
,
/*! AD type */
0
,
/*! tx power */
};
/*! advertising data, discoverable mode with HID service*/
static
const
uint8_t
bleAdvDataDiscHID
[]
=
{
/*! flags */
2
,
/*! length */
DM_ADV_TYPE_FLAGS
,
/*! AD type */
DM_FLAG_LE_LIMITED_DISC
|
/*! flags */
DM_FLAG_LE_BREDR_NOT_SUP
,
3
,
DM_ADV_TYPE_APPEARANCE
,
UINT16_TO_BYTES
(
CH_APPEAR_WATCH
),
/*! service UUID list */
17
,
DM_ADV_TYPE_128_UUID_PART
,
CARD10_UUID_SUFFIX
,
0x0
,
CARD10_UUID_PREFIX
,
3
,
/*! length */
DM_ADV_TYPE_16_UUID_PART
,
/*! AD type */
UINT16_TO_BYTES
(
ATT_UUID_HID_SERVICE
)
...
...
@@ -514,7 +537,12 @@ static void bleSetup(bleMsg_t *pMsg)
}
/* set advertising and scan response data for discoverable mode */
if
(
config_get_boolean_with_default
(
"ble_hid_enable"
,
false
))
{
AppAdvSetData
(
APP_ADV_DATA_DISCOVERABLE
,
sizeof
(
bleAdvDataDiscHID
),
(
uint8_t
*
)
bleAdvDataDiscHID
);
}
else
{
AppAdvSetData
(
APP_ADV_DATA_DISCOVERABLE
,
sizeof
(
bleAdvDataDisc
),
(
uint8_t
*
)
bleAdvDataDisc
);
}
AppAdvSetData
(
APP_SCAN_DATA_DISCOVERABLE
,
sizeof
(
bleScanDataDisc
),
(
uint8_t
*
)
bleScanDataDisc
);
/* set advertising and scan response data for connectable mode */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment