Commit Graph

251 Commits

Author SHA1 Message Date
Joe Finney bbc2dc58f8 microbit: Additional callback to indicate to applications when System
Attributes require initialisation from persistent storage.
2016-02-11 21:59:51 +00:00
Joe Finney 1b78b7bba4 microbit: Added 'bonds' field to Gap::Whitelist_t structure
It is common for application to need to know the number of bonds stored at any
time, for the purposes of bond management. This simple addition allows
applicaitons to discover the number of bonds present using the existing API.
2016-02-07 20:09:34 +00:00
Joe Finney 3306737028 microbit: Added support for explicit notification
Introduce abality to explicitly perform a notify/indicate opertion on a characteristic.
This brings benefits of a reduce RAM footprint for storing GattCharacterisitics.

n.b. temporary measure until ARM mbed integrate more generic optimisations.
2016-01-12 22:09:41 +00:00
Andres Amaya Garcia 81b8f0a240 Add doxygen experimental tag to getAddressFromBondTable API 2016-01-11 09:19:08 +00:00
Andres Amaya Garcia e67bcf35c8 Make getAddressFromBondTable API const 2016-01-08 15:51:30 +00:00
Andres Amaya Garcia 513ec79c5a Add API to get addresses of peers in bond table
The new API is added to the Security Manager. Its declaration is as follows:

virtual ble_error_t getAddressesFromBondTable(Gap::Whitelist_t &addresses)

The resulting Whitelist_t structure can then be used as the actual whitelist
passes to Gap::setWhitelist().

Note that for peers that have private resolvable addresses, then an address of
the same type will be returned.
2016-01-08 15:37:14 +00:00
Andres Amaya Garcia 0dd7f29518 Change return value of set.*PolicyMode() functions in Gap 2016-01-06 13:58:38 +00:00
Andres Amaya Garcia 706a97bca2 Add @experimental doxygen tag to new APIs 2016-01-06 11:17:14 +00:00
Andres Amaya Garcia 0b2ca7aafd Add capacity to whitelist structure 2016-01-06 10:40:23 +00:00
Andres Amaya Garcia a488074d7a Change Whitelisting API according to comments 2016-01-06 10:02:04 +00:00
Andres Amaya Garcia c56bc43058 Remove unnecessary include in BLEProtocol 2016-01-05 17:00:14 +00:00
Andres Amaya Garcia 819a0ca799 Fix comments and add Address_t empty constructor
Add an empty constructor to BLEProtocol::Address_t and fixed comments with
regards to BLEProtocol::Address_t.
2016-01-05 16:56:33 +00:00
Andres Amaya Garcia 42a202e047 Finilise Whitelisting experimental API
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!
2016-01-05 16:26:45 +00:00
Andres Amaya Garcia 6021b70625 Fix Address_t and AddressBytes_t problem in Gap 2015-12-31 14:36:51 +00:00
Andres Amaya Garcia 54977ed9f0 Merge branch 'develop' of github.com:ARMmbed/ble into whitelisting 2015-12-31 14:24:12 +00:00
Andres Amaya Garcia f7570e8bd5 Early whitelisting API 2015-12-31 13:54:21 +00:00
Vincent Coubard 0e70683f81 Merge pull request #105 from pan-/descriptorDiscovery
Characteristic descriptor discovery
2015-12-23 12:24:57 +00:00
Vincent Coubard 5caca671f3 Merge branch 'develop' of https://github.com/ARMmbed/ble into descriptorDiscovery 2015-12-22 17:12:25 +00:00
Liyou Zhou b2dd219ff4 Fix issues 2015-12-22 13:56:14 +00:00
Liyou Zhou ec7df38a77 Add deprecated message to Gap::connect overload function 2015-12-22 12:59:45 +00:00
Liyou Zhou 7398a396d7 Hotfix for backward compatibility
for change from Gap:AddressType_t to BLEProtocol::AddressType_t
2015-12-21 17:38:17 +00:00
Vincent Coubard 3036b058fe Merge pull request #153 from andresag01/update_adv_payload
Modify functions that manipulate adv payload
2015-12-21 15:04:59 +00:00
Andres Amaya Garcia 484382e2aa Fix comment in GapAdvertisingData 2015-12-21 10:44:55 +00:00
Andres Amaya Garcia 02ca65bc9f Make update adv payload replace previous data
Accumulate and update advertising payload now differ in their implementations.
Accumulate updates the previous value, if it is UUID then the previously added
values are kept and the new one is simple appended. In contrast, update
replaces the previous value in all cases.
2015-12-21 10:38:51 +00:00
Andres Amaya Garcia c64decef73 Add BLE_ERROR_INTERNAL_STACK_FAILURE error code
Add an additional error code to the ble_error_t enum to describe a failure
state caused by the internal platform-specific stack. This state was not
described by any of the existing error codes.
2015-12-18 17:22:35 +00:00
Andres Amaya Garcia fec4e5ec53 Add documentation missing for updateData() 2015-12-18 16:27:18 +00:00
Andres Amaya Garcia 4fb7c06886 Rename updateFieldPayload to updateField 2015-12-18 14:02:44 +00:00
Andres Amaya Garcia 39e3e8d151 Modify functions that manipulate adv payload
Modify the functions addData() and updateData() to correctly update the payload
information for a specified AD type if that type was already present in the
payload. For addData() if the AD type is not found, it is added to the payload.
In contrast, in updateData() if the AD type is not found an error is returned.

Documentation was updated accordingly.
2015-12-18 13:53:51 +00:00
Andres Amaya Garcia e40dc0642c Fix comment in GapAdvertisingParams.h 2015-12-17 15:45:04 +00:00
Andres Amaya Garcia 7ce1b80b8c Removed deprecated appearance enum from blecommon.h 2015-12-17 15:42:29 +00:00
Vincent Coubard 31be7790b0 Merge pull request #146 from andresag01/develop
Add onShutdown to register callbacks
2015-12-17 08:43:12 +00:00
Andres Amaya Garcia 0024b78a39 Clear shutdown callchain after exec callbacks 2015-12-16 16:43:04 +00:00
Andres Amaya Garcia 0781293bda Add onShutdown to register callbacks
Add an onShutdown() function to Gap, GattClient, GattServer and
SecurityManager. The callbacks are added to a private callback chain in each of
the instances. The callbacks will be executed inside each object's reset()
function BEFORE the state of the instance is cleared. The developers of the
platform-specific implementation must call the parent class' reset() function
for the callbacks to be executed.

Finally, an onShutdown() function that returns the shutdown callchain is added
to allow detaching callbacks.
2015-12-16 09:44:52 +00:00
Rohit Grover 3c15a7dfcc minor re-organization 2015-12-16 09:09:38 +00:00
Rohit Grover f30fe6bcda use an anonymous enum instead 2015-12-16 09:07:57 +00:00
Rohit Grover 2f527dbb7e transparenly support existing applications which may have used Gap::ADDR_TYPE_*. 2015-12-16 08:54:09 +00:00
Rohit Grover 022c37ce31 white space diffs 2015-12-16 07:00:50 +00:00
Rohit Grover 1e448f8757 Merge pull request #141 from andresag01/develop
Improve API to facilitate full shutdown procedure
2015-12-16 06:46:01 +00:00
Rohit Grover 1cab4222d5 replace uses of GapAddress_t with BLEProtocol::Address_t 2015-12-15 11:59:41 +00:00
Rohit Grover 4774e2cd84 Add an alias for BLEProtocol::AddressType::Type 2015-12-15 08:50:47 +00:00
Vincent Coubard 4dda9bf1b8 Fix function names:
- isCharacteristicDescriptorsDiscoveryActive => isCharacteristicDescriptorDiscoveryActive
  - terminateCharacteristicDescriptorsDiscovery =>terminateCharacteristicDescriptorDiscovery
2015-12-15 07:57:47 +00:00
Rohit Grover 05c42ffc31 had meant to use namespace for BLEProtocol instead of struct 2015-12-14 17:08:07 +00:00
Rohit Grover 17d6e5fe80 Extract Adress related types from Gap.h into BLEProtocol.h 2015-12-14 16:59:21 +00:00
Andres Amaya Garcia cd809e2a2c Modify shutdown API and functionality
Modify the shutdown API to remove the static shutdown function in Gap,
SecurityManager, GattClient and GattServer. Futhermore, remove the static
references to Gap, SecurityManager, GattClient and GattServer objects inside
their own classes. The cleanup method is renamed to `reset()` and made public.
Finally, additional functionality is added to the reset implementation in
Gap.
2015-12-14 15:34:38 +00:00
Vincent Coubard 87d8941374 Remove setLastHandle member function, it does not belong here 2015-12-14 15:03:40 +00:00
Vincent Coubard 726a144eeb Fix whitespace and improve documentation of Descriptors discovery 2015-12-14 14:48:38 +00:00
Vincent Coubard a56a875bbc Improve cross references for DiscoveredCharacteristicDescriptor docs 2015-12-14 14:33:31 +00:00
Vincent Coubard e877d0b7c7 Improve and correct documentation of DiscoveredCharacteristic 2015-12-14 14:31:08 +00:00
Vincent Coubard d7700bccb8 Improve documentation of DiscoveredCharacteristicDescriptor 2015-12-14 14:04:05 +00:00
Vincent Coubard bb9cb988a2 Improve consistency of accessor naming 2015-12-14 13:44:30 +00:00