Commit graph

139 commits

Author SHA1 Message Date
Joe Finney 040baa12c0 Add NRF event loop handler hook. 2017-03-01 16:53:28 +00:00
Vincent Coubard c5ce428dae Fix access to enum member 2016-04-08 00:00:00 +01:00
Joe Finney 67d0ac737d microbit: Update to indicate when system attributes require intialisation 2016-02-11 22:01:37 +00:00
Joe Finney 0963f913e0 microbit: Added funciton to allow the size of the GATT table to be configuraed
from the user's application.

The default ble-nrf51822 library does not provide a mechanism for the user
application to define size of the GATT attribute table size. It is important as
over 1.5K of sram is statically alllocated for SD.
2016-02-08 01:01:53 +00:00
Joe Finney 2b2a9d0fab microbit: Remove restriction on GATT table size to permit larger profiles. 2016-02-07 20:39:57 +00:00
Joe Finney 2541e8fdb0 microbit: Populate 'bonds' field in whitelist entry
Update to populate a recently introduced 'bonds' field in the whitelist_t
structure. This field records the number of IRKs present in the table, which
correlates to the number of bonds.
2016-02-07 20:03:24 +00:00
Joe Finney 06a34dad44 microbit: Revert service changed indication.
Some central devices under testing performed poorly, failing to correctly
conect or discover services.
2016-02-07 19:03:28 +00:00
Joe Finney fd017fbf2b microbit: Update to indicate service change on SYS_ATTR_MISSING
When using bonded connections to a central device, an explicit service changed
indication should be used in cases where a device's GATT table appears out of
date. This patch preserves the metadata of the Service Changed
characterisitic, and also adds this indication as described.
2016-01-25 17:18:10 +00:00
Joe Finney 47098827fc microbit: Increase maximum descriptor count
The ble-nrf51822 library maintains a static array of BLE descriptors (by
default, 8). This patch increases the size of this array to 20. This is
required to hold the full complement of services that make up the micro:bit
standard BLE profile.
2016-01-19 00:26:24 +00:00
Joe Finney f0333be39e microbit: Update to acomodate changed ble-nrf51822 API 2016-01-16 15:16:06 +00:00
Joe Finney 12cc720955 BUGFIX: Add conditional compilation to support S110 only builds
S110 builds contian a conditional compilation option that compiles out
GattClient functionality, thereby saving several hundred bytes of unecessary
memory overhead.
2016-01-16 15:11:48 +00:00
Joe Finney 93dd3fcc5b microbit: Defined an initial GATT table size of 768 bytes.
Reduced GATT table size by 1K. 768 bytes is sufficient to hold the basic
micro:bit BLE services (Device Information, DFU, event service). The
additional 1K normally held by SoftDevice can then be reused for application
heap.
2016-01-12 22:12:37 +00:00
Joe Finney d214d82075 microbit: BUGFIX: nRF5xn global singleton preventing gcc optimisation when module not initialized
A statically allocated nRF5xn singleton "deviceInstance" prevents gcc from optimising out the .bss memory used by the ble-nrf51822 module (approx 1.2K of RAM), even when the module is not used or initialised by application code. This can cause memory usage issues for heavily constrianed systems.

This patch replaces the statically allocated singleton with an equivalent mechanism based on lazy instantiation. This approach permits gcc to optimise the code out when not in use.
2016-01-12 22:12:34 +00:00
Joe Finney d8227522cd microbit: Increased maximum characteristic count
ble-nrf51822 assumes a static maximum of 20 characteristics by default. This is too small for the default
micro:bit profile requires more than this. default raised to 30 to accomodate.
2016-01-12 22:10:56 +00:00
Joe Finney 5928b5e443 microbit: Added support for explicit characteristic notification
Required to allow the mbed layer to avoid caching large amounts of state in its GattCharacteristics

n.b. this should be removed once all optimisations to the mbed layer are completed.
2016-01-12 22:10:52 +00:00
Joe Finney 2547adaa9c BUGFIX: Updated security requirements for notify/indicate descriptors to match the associated characteristic
Required to both ensure security is not circumvented, and also to initiate bonding via a notification request.
2016-01-12 22:10:47 +00:00
Vincent Coubard 2f875c9c1d Merge pull request #103 from andresag01/bond-table-query
Finish implementation of getAddressesFromBondTable
2016-01-12 18:56:10 +00:00
Vincent Coubard 29d53c2992 Remove dependency to mbed-error 2016-01-11 22:44:42 +00:00
Andres Amaya Garcia c1bc230bcf Initialize address list before returning error 2016-01-11 10:44:52 +00:00
Andres Amaya Garcia 1e4d6f20fc Add initialization check before querying SD bond table 2016-01-11 09:32:59 +00:00
Andres Amaya Garcia 33db258c8d Add missing documentation to getAddressesFromBondTable API 2016-01-11 09:28:36 +00:00
Andres Amaya Garcia 116eb8db8e Finish implementation of getAddressesFromBondTable
Finish the implementation of the new function getAddressesFromBondTable() in
SecurityManager that returns a table with a list of addresses from the peers
in the bond table.
2016-01-08 18:23:43 +00: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 2ebbcb08b5 Add documentation and fix style of SecurityManager 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 0f76db4eed Add helper function to get whitelist from SD bond table 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
Vincent Coubard 19d1c40612 Merge branch 'develop' of https://github.com/ARMmbed/ble-nrf51822 into characteristicDescriptorDiscovery 2015-12-22 17:53:52 +00:00
Andres Amaya Garcia 22082c54ae Add minor comment in shutdown function 2015-12-22 15:51:34 +00:00
Andres Amaya Garcia 9b14870e5c Fix shutdown of Gap instance to avoid NULL refs 2015-12-22 15:49:12 +00:00
Andres Amaya Garcia 65cb294f61 Fix comment typo 2015-12-21 09:35:49 +00:00
Andres Amaya Garcia 7f02a2d51f Add check for return code of ble_init 2015-12-21 09:32:44 +00:00
Andres Amaya Garcia 7a499f1f3e Remove unused include blecommon.h from projectconfig.h 2015-12-17 15:51:07 +00:00
Andres Amaya Garcia eab13c8b91 Remove occurrence of deprecated appearance enum 2015-12-17 15:49:10 +00:00
Rohit Grover b1b1a40368 white space diff 2015-12-16 10:19:22 +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
Andres Amaya Garcia 4efa84c82e Remove out-of-date comment from nRF5xn 2015-12-15 13:18:37 +00:00
Andres Amaya Garcia 252ef3cfbd Make _gapInstance non-static in nRF5xn 2015-12-15 13:16:05 +00:00
Rohit Grover ca8b3d2135 replace instances of BLEProtocol::AddressType::Type with BLEProtocol::AddressType_t 2015-12-15 13:05:24 +00:00
Andres Amaya Garcia 786cd0b9bf Modify nRF5xn::shutdown to return actual error code 2015-12-15 10:54:11 +00:00
Vincent Coubard 15592642e1 Move Implementation of nRF5xCharacteristicDescriptorDiscoverer::Discovery
to cpp file.
2015-12-15 10:22:23 +00:00
Vincent Coubard c8d826ffd0 Documentation of descriptor discoverer class.
Simplify the process
2015-12-15 09:56:27 +00:00
Vincent Coubard 59ced0b4b1 rename remainingCharacteristic member, now it is named
discoveredCharacteristic. Add doc to the discovery process and the
rationale behind discoveredCharacteristic member.
2015-12-15 09:54:25 +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