Skip to content
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

Merged
merged 10 commits into from
Jan 6, 2016
Merged

Conversation

andresag01
Copy link

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!

NOTE: Changes related to BLEProtocol::Address_t and BLEProtocol::AddressBytes_t are from @rgrover in this pull request.

@pan-

Andres Amaya Garcia added 6 commits December 31, 2015 13:54
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
Copy link
Member

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

Copy link
Author

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.

Copy link
Member

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.

@andresag01
Copy link
Author

@pan-: I have made the changes as suggested in your comments.

@pan-
Copy link
Member

pan- commented Jan 6, 2016

Could you tag all new api and and types with @experimental.

@andresag01
Copy link
Author

@pan-: Added @experimental doxygen tag to all new APIs and types as requested.

*
* @experimental
*/
virtual void setAdvertisingPolicyMode(AdvertisingPolicyMode_t mode)
Copy link
Member

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.

pan- added a commit that referenced this pull request Jan 6, 2016
@pan- pan- merged commit 0f26e18 into ARMmbed:develop Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants