-
Notifications
You must be signed in to change notification settings - Fork 3k
BLE: Add generic GAP implementation. #5311
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
Conversation
@marcbonnici @nvlsianpu @apalmieriGH Could you review this PR ? |
/** | ||
* @see Gap::startAdvertising | ||
*/ | ||
virtual ble_error_t startAdvertising(const GapAdvertisingParams& params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style for location of &
changes from here?
GapAdvertisingData &scanResponse
-> GapAdvertisingParams& params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to our guidelines the ampersand should be close to the noun. Thanks for the notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case does this need changing in the other files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid it should 😓
} | ||
|
||
// TODO check the random part if applicable | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this TODO still be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this one can be fix be checking the prand 24 of the resolvable private address.
{ | ||
switch (reason) { | ||
/** | ||
* Note: acceptect reasons are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"acceptect" -> "accepted"
const BLEProtocol::Address_t& potential_device = whitelist.addresses[i]; | ||
|
||
if (potential_device.type != device.type) { | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be continue
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, I'll fix it.
fae6bc5
to
9a31ab3
Compare
Anyone to review more this PR ? |
This interface expose the primitives needed to realize operations defined in the GAP layer. Data types, event and function definitions follow closely HCI commands and events defined in the Bluetooth specification.
Add an abstraction which manage the state of the GAP service exposed by the GATT server.
This filter prevent events to be signaled multiple times to the upper layer. It also signal events to a newly set event processor hook.
To help generic code, an interface of an event queue at the PAL level has been added. Implementation can either rely on the event mechanism internal to the stack or use the SimpleEventQueue implementation provided by this patch.
Generic implementation of the GAP class. It allows porters to have a working Gap implementation by implementing the following abstraction layer primitives: - pal::Gap: Adaptation for GAP related primitives. - pal::EventQueue: simple interface to the inner event queue of the stack. pal::SimpleEventQueue can also be used as an implementation. - pal::GenericAccessService: Accessors to the Generic Access Service present in the GATT server.
return BLE_ERROR_NONE; | ||
} | ||
|
||
ble_error_t GenericGap::setWhitelist(const Whitelist_t &whitelist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont get why this actoion is so complicated - why it;s not about just clearing the whitelist and filing it again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to reduce HCI transactions; Clearing the whitelist and add a new one is simpler but not optimal.
/morph build |
Build : SUCCESSBuild number : 677 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 321 |
Test : SUCCESSBuild number : 503 |
Description
Add a generic implementation of the GAP class. It allows porters to have a working Gap implementation by implementing the following abstraction layer primitives:
Note: the implementation contains many TODO which cannot be solved at the moment due to lack of definitions in the Gap interface. These questions exist for all existing ports out there. Those points will be addressed by the work on the Security manager and by addition in the Gap layer.
Status
READY
Migrations
NO
Related PRs
#5300
Note
Diff can be found here: https://github.com/pan-/mbed/compare/ble-pal-event-queue..pan-:ble-generic-gap