Commit Graph

1877 Commits (tools-release-6.1.0)

Author SHA1 Message Date
Martin Kojtal 3e42991289
Merge pull request #13046 from hugueskamba/hk_use_chrono
Use std::chrono based functions
2020-06-18 22:16:00 +02:00
Hugues Kamba a3f4cf212d Use std::chrono based functions
The chrono based functions improve readability. Using them also removes
warnings related to usage of deprecated warnings.
2020-06-17 14:52:50 +01:00
Martin Kojtal 8f87735152
Merge pull request #13040 from paul-szczepanek-arm/cordio-tx-power
BLE: Add tx power control to cordio HCI driver
2020-06-16 13:59:50 +02:00
Anna Bridge a870fcface
Merge pull request #13001 from jeromecoutant/PR_BAREMETAL_SUPPORT_STEP2
STM32 baremetal support step2 (L1/L4/WB)
2020-06-12 14:44:14 +01:00
Paul Szczeanek fe98309063 mention tx power in the readme 2020-06-10 15:49:55 +01:00
Paul Szczeanek 056f46d629 add tx power to cordio hci driver 2020-06-10 15:49:55 +01:00
Martin Kojtal f858000252
Merge pull request #13039 from pan-/fix-legacy-payload-update
BLE: remove limitation in the Cordio to update adv payload
2020-06-10 12:09:54 +02:00
Martin Kojtal 2466411b83
Merge pull request #13037 from paul-szczepanek-arm/ble-sm-fix
BLE: Fix privacy and signing handling in Security Manager
2020-06-10 12:09:32 +02:00
Martin Kojtal 6a431ffc58
Merge pull request #13055 from paul-szczepanek-arm/cordio-rf-tester
BLE: RF tester commands (and Cordio unhandled command complete)
2020-06-10 12:07:30 +02:00
Martin Kojtal d971d4e021
Merge pull request #13060 from paul-szczepanek-arm/direct-advertising
BLE: fix direct advertising on Cordio
2020-06-10 12:06:17 +02:00
jeromecoutant 28f8307afa STM32WB baremetal support
move BLE files to FEATURE_BLE
2020-06-08 12:06:01 +02:00
Martin Kojtal 49c1d947fa
Merge pull request #13044 from hugueskamba/hk_nrf_implicit_declaration
NRF: fix implicit declarations
2020-06-05 14:44:31 +02:00
Martin Kojtal c7cf9a9aed
Merge pull request #13035 from pan-/fix-ble-service-data-addition
Fix capacity check when service data are added to BLE advertising payload
2020-06-05 10:49:43 +02:00
Martin Kojtal 35a0e5d4f9
Merge pull request #13041 from hugueskamba/hk_remove_cordio_warnings
Cordio: put parentheses to correct order of precedence in ternary expressions
2020-06-05 10:47:36 +02:00
Paul Szczeanek a882d2d35f mention the rf tester commands in the readme 2020-06-03 18:46:20 +01:00
Paul Szczeanek 9d54c56562 reinitialise identity and signing when bond table reset 2020-06-03 17:36:06 +01:00
Paul Szczeanek 110b190b38 fix privacy initialisation and give access to local identity
Initialises identity addres when privacy is enabled. Stores the identity. Retrieves local identity if previously stored.
2020-06-03 17:35:23 +01:00
Paul Szczeanek 73b4bebee0 add connection addresses to whitelist 2020-06-03 17:30:21 +01:00
Paul Szczeanek bfdbcc7b4a add accessor for local irk 2020-06-03 17:29:51 +01:00
Paul Szczeanek fff0247ae5 fix infinite recursive call 2020-06-03 17:29:20 +01:00
Paul Szczeanek 05f7685a79 store local csrk and identity in the security db 2020-06-03 17:27:26 +01:00
Paul Szczeanek 94a6cac838 expose identity address used by controller 2020-06-03 17:24:11 +01:00
Paul Szczeanek d6a5bd2825 make number of db entries configurable 2020-06-03 17:07:47 +01:00
Paul Szczeanek dd615f7943 Add direct advertising support.
To start direct connectable advertising on the cordio stack, the programmer should call the function DmConnAccept instead of the function DmAdvStart .
This functions expect the target address and address type as parameter, which are passed to the controller when the programmer sets the advertising parameters and not known when advertising_enable is called.
Therefore, this information should be kept in memory when advertising parameters are set and retrieved when advertising is enable to choose the right call to start (or stop) advertising.
Timeout of direct advertising is also handled in an uncommon way, a connection timeout is received. Similarly, DmConnClose should be called to stop connectable direct advertising.

The state is kept in an array of direct_adv_cb_t. Each items contains a peer address, the peer address type, the connection handle and the advertising handle as well as a state which indicate if the advertising is running, pending or not used.
When advertising parameters are set, the state is updated to match the target address or disable direct advertising management for the advertising set being configured.
When advertising is enabled, the pal dispatch the operation to the right calls (DmAdvStart/DmConnAccept or DmAdvStop/DmConnClose).
When an advertising timeout happen or a connection is made, the pal cleans any direct advertising state of this advertising set
2020-06-03 16:25:23 +01:00
Paul Szczeanek fbe93123a5 Add rf tester commands to cordio hci driver. This adds commands that allow you to send the HCI commands HCI_LE_Receiver_Test, HCI_LE_Transmitter_Test and HCI_LE_Test_End. The results of the test are obtained by the command complete command for HCI_LE_Test_End and passed to the user by the callback register in the test start calls. 2020-06-03 15:21:32 +01:00
Paul Szczeanek 51d1a30b8e Route unhandled cmd cmpl events to mbed. Cordio ignores command complete events for all commands that it doesn't have a specific handler for. This adds a catch-all handler that allows the user application to handle any command complete that isn't already handled by the stack. This involves adding a new type of event and routing the event through the stack to the device where it's forwarded to the existing event handling in mbed-os. 2020-06-03 15:21:05 +01:00
Paul Szczeanek 0affb73747 Fix bounds check using a define instead of table size. The bounds check was incorrectly picking a define that wasn't even the last in the table. It now uses the size of the table. 2020-06-03 15:19:39 +01:00
Paul Szczeanek 8285ecdefb connection update handled elsewhere 2020-06-02 10:01:10 +01:00
Paul Szczeanek 157c54bfc7 fix inverted meaning of _user_manage_connection_parameter_requests 2020-06-02 09:39:07 +01:00
Hugues Kamba 992133be50 NRF: fix implicit declarations
As a result removes warnings
2020-06-01 10:26:51 +01:00
Hugues Kamba 4d939ccdbe Cordio: put parentheses to correct order of precedence in ternary expressions
Also remove extraneous parentheses in comparison.
2020-05-29 19:11:25 +01:00
Vincent Coubard 2bbc8a0bae BLE: remove limitation in the Cordio to update adv payload
Nothing in the Bluetooth standard prevents update of advertising payload while advertising is active.
This limitation wasn't present in previous version of the stack and is not present for extended advertising.
2020-05-29 17:52:05 +01:00
Vincent Coubard 23e39a1dbd Fix capacity check when service data are added to BLE advertising payload. 2020-05-29 15:06:38 +01:00
Lingkai Dong 3b48d3f198 NRFCordioHCIDriver: remove idle_hook
In PR #8876 when we added Cordio support for nRF52* targets,
we attempted to use an RTOS idle hook to workaround sleep
latency issues. However, the condition to bypass sleeps
never gets satisfied, and BLE nRF52* targets have generally
worked fine over the past year.

This commit removes the hook to avoid dependency on RTOS,
enabling BLE on bare metal.
2020-05-11 17:34:07 +01:00
Lingkai Dong 50928fbcff BLE whitelist can only contain public or random static addresses 2020-04-17 09:59:17 +01:00
Lingkai Dong a6810ddc37 Remove a few leftovers in BLE namespace 2020-04-17 09:59:16 +01:00
Lingkai Dong 3c922acec4 Gap.tpp: remove misleading deprecation header 2020-04-17 09:59:15 +01:00
Lingkai Dong 8de604d485 Rename ConnectionParams_t -> PreferredConnectionParams_t
For actual connections, full ConnectionParameters is used. But
as per BLE specification, Generic Access Service can display
preferred connection parameters which is a smaller subset and
ConnectionParams_t matches exactly. Thus we rename/repurpose
it to PreferredConnectionParams_t.
2020-04-17 09:59:14 +01:00
Lingkai Dong 76b92b82e2 BLE: correct misspelling: prefered -> preferred 2020-04-17 09:59:14 +01:00
Lingkai Dong 7c49aeb01f Remove connection_params from internal on_connected()
The callback on_connected() in ConnectionEventMonitorEventHandler
contains a parameter ConnectionParams_t which is superceded by
ConnectionParameters. Since it's not used, remove it.
2020-04-17 09:59:13 +01:00
Lingkai Dong d6eeab1744 Cordio: bring back device name & appearance function
Functions in Cordio for device name & appearance are currently
unused as they are both part of and dependent on deprecated
Mbed OS BLE APIs.

Nonetheless we want to keep them (and disable using macros)
so we can reintroduce them and make improvements in the future
as needed.
2020-04-17 09:59:12 +01:00
Lingkai Dong 53550bb63b Gap: create legacy advertising set only when required 2020-04-17 09:59:11 +01:00
Lingkai Dong 0341d5c898 disconnection_reason_t from raw uint8_t should be explicited an undocumented 2020-04-17 09:59:11 +01:00
Lingkai Dong 0b163ffbe1 Add default initialisation of own_address_type_t 2020-04-17 09:59:10 +01:00
Lingkai Dong 25608eede1 Remove BLEProtocol.h 2020-04-17 09:59:09 +01:00
Lingkai Dong 9455f86954 BLE: replace legacy address types (BLEProtocol) with new ones 2020-04-17 09:59:08 +01:00
Lingkai Dong ae86c119d2 Add whitelist_t::entry_t which will replace Address_t to store addr type and value 2020-04-17 09:59:08 +01:00
Lingkai Dong 7fed75b356 BLE: remove ResolutionStrategy type 2020-04-17 09:59:07 +01:00
Lingkai Dong 7ce73d414e BLE LinkLossService: use new EventHandler API to handle disconnection 2020-04-17 09:59:06 +01:00
Lingkai Dong eba5821fd8 GenericGap: ensure legacy advertising set exists when setting data 2020-04-17 09:59:06 +01:00