Commit graph

22 commits

Author SHA1 Message Date
Vincent Coubard
c5ce428dae Fix access to enum member 2016-04-08 00:00:00 +01:00
Andres Amaya Garcia
91e8bf4bb2 Modify nRF5xGap::reset() to reset the whitelist 2016-01-08 15:33:19 +00:00
Andres Amaya Garcia
bdf392d471 Remove redundant structures from nRF5xGap
Remove the following structures/arrays from the nRF5xGap class:

* ble_gap_whitelist_t whitelist
* ble_gap_addr_t *whitelistAddressePtrs[]
* ble_gap_irk_t  *whitelistIrkPtrs[]

These are made redundant because the SoftDevice does not require the user to
keep a copy of the whitelist itself.
2016-01-08 15:19:18 +00:00
Andres Amaya Garcia
12e6c9ec09 Make setWhitelist check errors before changing state 2016-01-08 14:23:17 +00:00
Andres Amaya Garcia
b72f9aa24e Add whitelisting documentation to nRF51xGap 2016-01-08 14:20:38 +00:00
Andres Amaya Garcia
9d0c6381d4 Add missing documentation to btle_security for whitelisting 2016-01-08 14:20:38 +00:00
Andres Amaya Garcia
c9b6bb9bbb Almost complete implementation of whitelisting API 2016-01-08 14:20:38 +00:00
Andres Amaya Garcia
fdead9ec36 Early whitelisting API prototype implementation 2016-01-08 14:20:38 +00:00
Rohit Grover
5a6f8cde9a replace a few instances of Gap::AddressType_t with BLEProtocol::AddressType_t 2015-12-16 08:57:20 +00:00
Andres Amaya Garcia
90de915fac Replace deprecated inclusions of mbed.h
Replace all deprecated inclusions of mbed.h for mbed-drivers/mbed.h when using
mbed OS. Applications should compile for mbed classic.
2015-12-15 13:58:54 +00:00
Vincent Coubard
fd8b73f914 Merge pull request #87 from andresag01/develop
Improve shutdown to clear BLE API and not just SD
2015-12-15 13:53:09 +00:00
Rohit Grover
52200b37bb follow the extraction of ddress related types from Gap.h into BLEProtocol.h 2015-12-14 17:09:28 +00:00
Andres Amaya Garcia
0bcc2e96c9 Modify shutdown due to BLE API change
The module is updated to comply with the changes to BLE API regarding correct
shutdown functionality. The following changes are introduced to ble-nrf51822:

* Calls to the old static function shutdown in Gap, GattClient, GattServer and
SecurityManager are removed.
* The cleanup function in Gap, GattClient, GattServer and SecurityManager is
renamed to `reset()` and made public.
* The static references inside nRF5xGap, nRF5xGattClient, nRF5xGattServer and
nRF5xSecurityManager to objects of their own class are moved to nRF5xn.
* The static getInstance accessors in nRF5xGap, nRF5xGattClient,
nRF5xGattServer and nRF5xSecurityManager are removed and their functionality is
moved to the implemented virtual accessors in nRF5xn i.e. getGap(),
getGattClient, etc.
* A static function Instance is added to nRF5xn class to make the transport
object accessible across the module.
2015-12-14 15:15:35 +00:00
Andres Amaya Garcia
0429643609 Fix comment typo 2015-12-11 18:19:10 +00:00
Andres Amaya Garcia
7bf81e7edb Improve shutdown to clear BLE API and not just SD
Improve the shutdown functionality, such that a call to ble.shutdown() from
the user application clears the API and nRF5x state and NOT only the
SoftDevice. To achieve this the following changes are introduced:

* Add a protected member cleanup() to nRF5xGap, nRF5xGattClient,
nRF5xGattServer, nRF5xSecurityManager and nRF5xServiceDiscovery.
* Modify the shutdown() implementation in nRF5xn such that it also calls the
static member shutdown() exposed by the BLE API in Gap.h, SecurityManager.h,
GattClient.h and GattServer.h.
* Modify nRF5xGattClient, nRF5xGattServer and nRF5xSecurityManager
classes so that they dynamically create their respective objects only if
needed. Previously the GattClient, GattServer and SecurityManager objects were
declared as static, which means that they were always present even though they
were not always needed. This increases memory consumption unnecessarily.
Furthermore, pointers to the object instances are stored in static members of
the classes as specified by the BLE API base classes. This ensures that
calls to shutdown do not require calls to getInstance() functions that would
otherwise result in undesired memory allocations.
* nRF5xGap object is always needed, so this remains allocated statically. But
the reference in Gap is pointed to this object.

The shutdown procedure is as follows:

1. The user calls ble.shutdown() which executes the code in nRF5xn::shutdown()
1. The SoftDevice is shutdown
1. The static members of Gap.h, SecurityManager.h, GattClient.h and
GattServer.h are called to clean up their own state.

If at any point an error occur during the last step, BLE_ERROR_INVALID_STATE is
returned.
2015-12-11 17:56:57 +00:00
Marcus Chang
314d3d449c Fixed bug in nRF5xGap.setAddress where random adresses where not set properly. 2015-12-01 14:10:20 +00:00
Marcus Chang
6082c76ab5 When connecting, if no scanning parameters are passed, use values from Gap parent. 2015-10-16 11:44:03 +01:00
Joshua Slater
8830c07558 getAppearance now checks for correct success code from sd_ble_gap_appearance_get 2015-08-10 15:11:33 +01:00
Rohit Grover
bf25a5a4c4 rename to getIntervalInADVUnits() 2015-08-10 15:11:18 +01:00
Joshua Slater
781dcbdcfd changed getInterval to getIntervalInAdvUnits to support changes in GapAdvertisingParams.h 2015-08-10 15:08:51 +01:00
Rohit Grover
553132b406 add support to handle radio-notification event as a FuncionPointer so that we can have <object, member> pairs for callbacks. 2015-07-21 11:34:36 +01:00
Rohit Grover
0eb58d86f5 rename nRF51... to nRF5x...
This prepares us to support nRF52.
2015-07-06 14:18:01 +01:00
Renamed from source/nRF51Gap.cpp (Browse further)