Commit Graph

565 Commits (5cfee6588183431f21e1ef75de0afca92277ca45)

Author SHA1 Message Date
paul-szczepanek-arm aefab05e5a add all the features and rename existing non-roles to features 2019-02-27 19:31:46 +00:00
Steve Cartmell 72d28d920a feat(ble): Guard out Observer code when role is disabled 2019-02-27 19:29:51 +00:00
Steve Cartmell 5d73a03a64 feat(ble): Guard out SecurityManager code when role is disabled 2019-02-27 19:24:40 +00:00
Steve Cartmell 73f7ffb124 feat(ble): Guard out GattServer code when role is disabled 2019-02-27 19:24:39 +00:00
Steve Cartmell 6e301ce148 feat(ble): Guard out GattClient code when role is disabled 2019-02-27 19:23:31 +00:00
Vincent Coubard 04d26f7ab5 BLE - Devirtualize ::ble::generic::GenericSecurityManager
Two parameters are expected by the template:
- TPalSecurityManager a template class of the security manager of the form TPalSecurityManager<EventHandler>. The GenericSecurityManager is the event handler.
- SigningMonitor a template in the form SigningMonitor<Handler>.
2019-02-26 13:18:17 +00:00
Vincent Coubard b135074821 BLE - Devirtualize ble::generic::GattClient
GenericGattClient is parametized by two types:
- The template of the PalGattClient
- The SigningMonitorEventHandler

Note that the PalGattClient template must be of the form PalGattClient<EventHandler>. The event handler being the GenericGattClient.
2019-02-26 13:18:17 +00:00
Vincent Coubard 39e938bf8e BLE - Devirtualize ble::generic::GenericGap
Expected types are similar to the type expected by the constructor:
- PalGap
- PalSecurityManager
- ConnectionEventMonitorEventHandler

Note that for the PalGap we expect a **template** of the form PalGap<EventHandler>
2019-02-26 13:18:17 +00:00
Vincent Coubard fb39848481 BLE - Cleanup deprecation implementation bits in BLE.cpp 2019-02-26 13:18:17 +00:00
Vincent Coubard 7796e733ad BLE - Devirtualize ::SecurityManager
The interface now lives in ::ble::interface::SecurityManager. The implementation type is expectected to exported as ble ::ble::impl::SecurityManager by the implementation.
2019-02-26 13:18:17 +00:00
Vincent Coubard 6d2592a137 BLE - Devirtualize ::GattServer.
The interface is defined in ::ble::interface::GattServer and an implementation must export the implementation type ::ble::impl::GattServer.
2019-02-26 13:18:17 +00:00
Vincent Coubard e56fd682a1 BLE - Devirtualize ::GattClient
Interface definition now lives in ble::interface::GattClient. An implementation must export the implementation type in ::ble::impl::GattClient.
2019-02-26 13:18:17 +00:00
Vincent Coubard 43e87fb04d BLE - Devirtualize ::ble::Gap
The interface definition now lives in ::ble::interface::Gap.
The implementation must export the implementation types as ::ble::impl::Gap.
2019-02-26 13:18:17 +00:00
Vincent Coubard 1ad726322f BLE - Devirtualization of ::Gap
The interface definition now lives in ::ble::interface::LegacyGap. Implementation must export the implementation type as ble::impl::LegacyGap.
2019-02-26 13:18:17 +00:00
Vincent Coubard 7e78433cec BLE - replace some usages of Gap::Handle_t by ble::connection_handle_t 2019-02-26 13:18:17 +00:00
paul-szczepanek-arm b628285254 route mtu changed events to server and client instead of gap 2019-02-14 12:34:33 +00:00
paul-szczepanek-arm c10fc2eb8e add API to trigger MTU negotiation 2019-02-14 12:34:33 +00:00
paul-szczepanek-arm b6df6d54a1 change event names 2019-02-14 12:34:32 +00:00
paul-szczepanek-arm 06a2a403e9 fix typos 2019-02-14 12:34:31 +00:00
paul-szczepanek-arm 108d6908be route ble events to gap 2019-02-14 12:34:31 +00:00
paul-szczepanek-arm c452d8ff0e add mtu events 2019-02-14 12:34:31 +00:00
Senthil Ramakrishnan 2030d03590 Modified fixes with review comments 2019-02-01 17:49:49 -06:00
Senthil Ramakrishnan ea30ed7a36 Fix for ARMc6 compiler errors 2019-02-01 17:46:50 -06:00
paul-szczepanek-arm d9c919b7e1 review fixes 2019-01-30 12:19:04 +00:00
paul-szczepanek-arm e1a8fb5a7a check scanning status first 2019-01-30 11:45:26 +00:00
paul-szczepanek-arm 7f888f86bf scan timeout for 4.2 controllers using new API 2019-01-30 11:37:17 +00:00
Cruz Monrreal b49d949b50
Merge pull request #9393 from pan-/fix-safe-enum-type-safety
BLE: Fix SafeEnum type safety
2019-01-28 10:31:52 -06:00
Martin Kojtal 4019efb21d
Merge pull request #9399 from paul-szczepanek-arm/fix-null-check
BLE: fix missing null checks on Gap event handler
2019-01-21 13:43:16 +01:00
paul-szczepanek-arm 42e4290160 error when there is no handler 2019-01-18 14:55:38 +00:00
Cruz Monrreal fd2a96e7ad
Merge pull request #9339 from costanic/fix_oob
Fix Out-Of-Band (OOB) data generation for BLE OOB pairing
2019-01-17 21:51:54 -06:00
Martin Kojtal 284781a565
Merge pull request #9096 from pan-/fix-enforce-size-limits
BLE: Enforce advertising data payload limits
2019-01-17 12:41:57 +01:00
Vincent Coubard f8ef143ed7 BLE: Fix comparison expression between an integer and a SafeEnum 2019-01-16 16:06:21 +00:00
paul-szczepanek-arm fa36ed02ee add missing null checks 2019-01-16 14:56:54 +00:00
Nic Costa 55507eaf75 Fix race condition when generating OOB data
The GenericSecurityManager tracks the most recent OOB data generated
by the PAL and the PAL function to generate OOB data is expected to
be asynchronous such that the OOB data is returned via a callback.

There was a race condition on the security manager's oob data variable
because it was cleared (set to all zeros) after calling PAL generate.
The expectation was that the clear operation would occur before the
callback executed, but this is proving to not be the case.  Instead,
the callback is being executed as if it were syncronous with PAL
generate, then PAL generate returns and the oob data is cleared,
thereby losing the generated oob data that was set in the callback.

To fix the issue, clear the oob data variables before calling into
the PAL.
2019-01-11 08:54:30 -06:00
Martin Kojtal 0f7381d436
Merge pull request #9058 from pan-/fix-scan-timeout
BLE: suppress scan timeout if we disabled scanning
2019-01-04 08:41:36 +00:00
paul-szczepanek-arm 3be792a3b3 simplify for statement 2019-01-03 12:24:33 +00:00
paul-szczepanek-arm dd1d473375 future proof return size 2019-01-02 15:42:14 +00:00
paul-szczepanek-arm 8b39071cd8 make function name longer 2019-01-02 14:29:30 +00:00
paul-szczepanek-arm 67db321500 check illegal adv params combimnation 2018-12-13 17:52:18 +00:00
paul-szczepanek-arm ff0a2a907e check connectible sizes 2018-12-13 17:52:00 +00:00
paul-szczepanek-arm 7dd90e1810 Docuement active set length and add informative call for querying the limit 2018-12-13 17:51:10 +00:00
paul-szczepanek-arm e1cf516100 fix max payload and hci length values 2018-12-13 17:50:53 +00:00
paul-szczepanek-arm 50d1818d72 call advertising end even if stopped by us 2018-12-13 17:33:36 +00:00
Naveen Kaje 448c4d5d89 BLE: Update toolchain.h with mbed_toolchain.h
Fixes the following warning

[Warning] toolchain.h@24,0: #1215-D: #warning directive:
toolchain.h has been replaced by mbed_toolchain.h,
please update to mbed_toolchain.h [since mbed-os-5.3]
2018-12-10 13:57:52 -06:00
paul-szczepanek-arm 13a10f3efa suppress scan timeout if we disabled scanning 2018-12-10 16:31:34 +00:00
paul-szczepanek-arm a545da7790 remove noreturn error function to avoid compilation issues 2018-12-10 13:54:09 +00:00
Vincent Coubard 698447b622 BLE: Fix address type allowed to create a periodic sync. 2018-12-07 00:04:29 +00:00
Vincent Coubard df95a1f8bd BLE: Allow null value for periodic interval in advertising report event. 2018-12-07 00:03:50 +00:00
Vincent Coubard c83dccf65c BLE: Set advertising random address when appropriate. 2018-12-06 11:25:50 +00:00
Vincent Coubard ed426c5b45 BLE: rename ConnectionParameters::getFilterPolicy into getFilter for consistency. 2018-12-03 17:11:28 +00:00
Vincent Coubard e026bce881 BLE: Change parameter order of ble::Gap::startScan 2018-12-03 16:50:10 +00:00
Vincent Coubard 4ed3f5620f BLE: Fix name of DisconnectionEvent into DisconnectionCompleteEvent for consistency. 2018-11-29 12:28:38 +00:00
Vincent Coubard 3ddcdf24a3 BLE: Fix ble::Gap::getMaxAdvertisingDataLength return type. 2018-11-29 12:26:40 +00:00
Vincent Coubard 402a4479d2 BLE: Ensure scan process is stopped before connecting. 2018-11-29 12:22:34 +00:00
Vincent Coubard 78468fb6e3 BLE: Use RANDOM address per default for Advertising, Scan and Connection parameter.
Unlike the public address, the RANDOM address is guaranteed to exist.
If privacy is enabled, it means the controller will generates random resolvable addresses or non resolvable addresses depending on the config.
If privacy is not enabled then the device will use the device's random static address that doesn't change between radio processes.
2018-11-29 12:18:11 +00:00
Vincent Coubard e7ef0b764e BLE: protect event signaling flag from concurent accesses. 2018-11-28 17:25:44 +00:00
paul-szczepanek-arm 5302a7f599 consistent errors 2018-11-27 15:38:01 +00:00
Vincent Coubard daee12d623 BLE: Fix set check in GenerigGap::stopAdvertising. 2018-11-27 15:29:52 +00:00
Vincent Coubard 6677fab856 BLE: Move source/Gap.cpp -> source/LegacyGap.cpp 2018-11-27 09:12:28 +00:00
Vincent Coubard a65296e9ee BLE: removed resolved TODO. 2018-11-26 23:44:23 +00:00
Vincent Coubard 66a9e635bd BLE: report correct event type for legacy advertising report. 2018-11-26 23:28:30 +00:00
Vincent Coubard 0c9ce24638 BLE: remove unwanted trace. 2018-11-26 23:16:31 +00:00
Vincent Coubard ef1552a8f5 BLE: report legacy connection event in new event handler. 2018-11-26 23:03:21 +00:00
paul-szczepanek-arm a14f143c85 set active set to false when stoping advertising 2018-11-26 23:00:29 +00:00
paul-szczepanek-arm 4d986bf376 fix is feature enabled condition and made in consistent 2018-11-26 21:11:34 +00:00
Vincent Coubard 56185582aa BLE: Report legacy advertising with new API. 2018-11-26 21:01:14 +00:00
Vincent Coubard 0ef7a40475 BLE: Fix set advertising paylaod dispatch. 2018-11-26 21:00:46 +00:00
Vincent Coubard daf0f429c8 BLE: Fix advertising set issues on legacy controllers. 2018-11-26 19:14:48 +00:00
paul-szczepanek-arm 3ae38ac1e8 always set existing set for legacy handle 2018-11-26 18:53:49 +00:00
paul-szczepanek-arm bf535af159 check feature support before calling extended functnions 2018-11-26 16:57:07 +00:00
paul-szczepanek-arm bed7677c81 stop advertising before reseting 2018-11-26 16:51:28 +00:00
paul-szczepanek-arm 6f3a9ca107 legacy handle starts off present in _existing_sets 2018-11-26 16:29:33 +00:00
paul-szczepanek-arm f4a560dace reset advertising sets on reset 2018-11-26 16:25:33 +00:00
paul-szczepanek-arm e54e3eaee0 cast no longer needed 2018-11-26 15:42:12 +00:00
Vincent Coubard f71e08ccf1 BLE: tag API uses in GenericGap. 2018-11-26 15:26:24 +00:00
Vincent Coubard 2d63714f2e BLE: Implement connection parameter management in GAP. 2018-11-26 15:25:46 +00:00
Vincent Coubard 89355b9fb0 BLE: Check supervision timeout value in connect. 2018-11-26 15:24:42 +00:00
Vincent Coubard d1b5c8cbb5 BLE: Mark LEGACY_ADVERTISING_HANDLE as active in initialization. 2018-11-26 15:23:53 +00:00
Vincent Coubard 93b6ecfa7e BLE: initialize properly deprecated and non deprecated flags. 2018-11-26 15:23:24 +00:00
Vincent Coubard a915748cbe BLE: Fallback to legacy connect when required. 2018-11-26 14:13:07 +00:00
Vincent Coubard 190b9bc125 BLE: Fix address type in ::ble::Gap::connect 2018-11-26 14:13:07 +00:00
paul-szczepanek-arm 528deb168f fix wrong variable being swapped 2018-11-26 11:16:23 +00:00
paul-szczepanek-arm 208b1bd3e9 fix size calculation for UUID data payload 2018-11-26 11:10:39 +00:00
Vincent Coubard 0407ee8c81 BLE: move privacy configuration type in ble namespace. 2018-11-26 10:24:35 +00:00
Vincent Coubard 78d4a9b6c8 BLE: Cleanup enum duplicates in gap/Types.h 2018-11-26 10:24:35 +00:00
Vincent Coubard e130bec6a0 BLE: rework ScanParameters::phy_configuration_t 2018-11-26 10:24:35 +00:00
Vincent Coubard 4db8ddfb90 BLE: fix name of functions in ble::ScanParameters. 2018-11-26 10:24:35 +00:00
Vincent Coubard 6b8b1d0b7a BLE: remove minimize fragmentation parameter in Gap. 2018-11-26 10:24:35 +00:00
Vincent Coubard 4058f0908a BLE: Extract computation of minimumSupervisionTimeout. 2018-11-26 10:24:35 +00:00
Vincent Coubard 6cb7645846 BLE: Improve NULL check in ble::AdvertisingDataBuilder implementation. 2018-11-26 10:24:35 +00:00
Vincent Coubard 643fad0162 BLE: Improve code by explaining or textually defining constants 2018-11-26 10:24:35 +00:00
Vincent Coubard eda3bfb0e3 BLE: Explain magic constant in ble::Gap implementation. 2018-11-26 10:24:35 +00:00
Vincent Coubard d32354a7a6 BLE: Fix compiler warning about unused variable. 2018-11-26 10:24:35 +00:00
Vincent Coubard b49870d8ae BLE: Fix code formating issues in Gap subsystem. 2018-11-26 10:24:35 +00:00
Vincent Coubard 70ec1cf641 BLE: Improve naming consistency of Gap event types. 2018-11-26 10:24:35 +00:00
Vincent Coubard 8fc62efbd8 BLE: Improve naming consistency of ble::Gap::EventHandler functions. 2018-11-26 10:24:35 +00:00
Vincent Coubard 49455dcc87 BLE: set the phy as first parameter in ble::ConnectionParameters. 2018-11-26 10:24:35 +00:00
Vincent Coubard 52318e464d BLE: rename AdvertisingParameters::*PolicyMode into AdvertisingParameters::*Filter. 2018-11-26 10:24:35 +00:00
Vincent Coubard 9f39dba429 BLE: Fix constant declaration of ble::AdvertisingParameters. 2018-11-26 10:24:35 +00:00
paul-szczepanek-arm 02cf9ea94d moved some funcs to cpp, moved cpp to source folder 2018-11-26 10:24:35 +00:00