-
Notifications
You must be signed in to change notification settings - Fork 75
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
Whitelisting experimental API #159
Conversation
This is the finilised experimental API that introduces support for whitelisting. The changes are focused in Gap and introduces the following functions, that are expected to be implemented by each of the vendor specific glue code (e.g. ble-nrf51822 module): - getMaxWhitelistSize(): Get the maximum whitelist size, this can be set by using a yotta config definition. - getWhitelist(): Gets a copy of the internal whitelist containing BLE addresses. - setWhitelist(): Replace the whitelist with new addresses. - setAdvertisingPolicyMode(), setScanningPolicyMode() and setInitiatorPolicyMode(): Functions used to set the relevan policy filter mode as described in the BLE Specification v4.2 Vol 6, Part B, Section 4.2.1. - getAdvertisingPolicyMode(), getScanningPolicyMode() and getInitiatorPolicyMode(): Functions used to get the relevan policy filter mode as described in the BLE Specification v4.2 Vol 6, Part B, Section 4.2.1. The following enumerators were added to Gap to describe the desired policy filter mode: - AdvertisingPolicyMode_t - ScanningPolicyMode_t - InitiatorPolicyMode_t Finally, the following typedef was added to provide a view of the underlying implementation's internal whitelist: - Whitelist_t **NOTE:** Clearly, these API additions require changes to the underlying implementation!
Add an empty constructor to BLEProtocol::Address_t and fixed comments with regards to BLEProtocol::Address_t.
/** | ||
* @return Maximum size of the whitelist. | ||
*/ | ||
virtual uint8_t getMaxWhitelistSize(void) const |
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.
it should take a reference to an uint8_t as parameter and return a ble_error_t
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 this case I was trying to be consistent with the other getMax*() function. See here https://github.com/andresag01/ble/blob/whitelisting/ble/Gap.h#L273.
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.
Agree, in this case, it should return 0.
@pan-: I have made the changes as suggested in your comments. |
Could you tag all new api and and types with |
@pan-: Added |
* | ||
* @experimental | ||
*/ | ||
virtual void setAdvertisingPolicyMode(AdvertisingPolicyMode_t mode) |
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.
maybe it would be interesting to return a status here.
This is the finilised experimental API that introduces support for
whitelisting. The changes are focused in Gap and introduces the following
functions, that are expected to be implemented by each of the vendor specific
glue code (e.g. ble-nrf51822 module):
using a yotta config definition.
addresses.
setInitiatorPolicyMode(): Functions used to set the relevan policy filter
mode as described in the BLE Specification v4.2 Vol 6, Part B, Section 4.2.1.
getInitiatorPolicyMode(): Functions used to get the relevan policy filter
mode as described in the BLE Specification v4.2 Vol 6, Part B, Section 4.2.1.
The following enumerators were added to Gap to describe the desired policy
filter mode:
Finally, the following typedef was added to provide a view of the
underlying implementation's internal whitelist:
NOTE: Clearly, these API additions require changes to the underlying
implementation!
NOTE: Changes related to BLEProtocol::Address_t and BLEProtocol::AddressBytes_t are from @rgrover in this pull request.
@pan-