Commit Graph

133 Commits (master)

Author SHA1 Message Date
Mingjie Shen 378f2f579d Fix null pointer dereferencing
Add null check for return values of functions that are mostly (but not
always) checked for null.
E.g., since 98% of calls to protocol_stack_interface_info_get_by_id
check for null, it is likely that the function can return null values in
some cases, and omitting the check could crash the program.
2023-04-20 00:54:47 -04:00
Martin Kojtal c9234177c1
Merge pull request #14921 from paul-szczepanek-arm/fix-ble-default-db
BLE: suppress error when no path is passed in for ble security db
2021-07-20 10:02:28 +02:00
Paul Szczepanek 8a4b278a38 suppress error when no path is passed in for ble sec db 2021-07-14 17:26:57 +01:00
Paul Szczepanek 7ba7f3e667 fix toggling off ble feature signing 2021-07-14 15:13:13 +01:00
Paul Szczepanek c9d0ff8674 ble security db complete sync implementation 2021-06-23 22:25:00 +01:00
Paul Szczepanek 7b4d1d59f1 add new BLE API call to sync security db with persisten storage 2021-06-23 22:25:00 +01:00
Paul Szczepanek ede39c4608 put statements inside the correct feature guard blocks 2021-06-17 16:51:28 +01:00
Martin Kojtal 8cb8e49a67
Merge pull request #14747 from paul-szczepanek-arm/fix-adv-con
BLE: fix advertising set termination event
2021-06-17 15:37:29 +02:00
Paul Szczepanek 6b930d6449 translate adv set error codes and only act on successful stop 2021-06-09 18:50:17 +01:00
Paul Szczepanek 4fae828987 Fix process enable queue guard not being reset on failed runs 2021-06-09 18:50:17 +01:00
Martin Kojtal a8fd7b3f0e
Merge pull request #14693 from 16L-YT/master
Fix compilation errors with kvstore - TDB_INTERNAL option to store BLE bonding info
2021-06-09 16:35:56 +02:00
Martin Kojtal e377383f6d
Merge pull request #14672 from paul-szczepanek-arm/fix-advertising-start
BLE: Fix advertising start and stop
2021-06-09 10:38:34 +02:00
Paul Szczepanek 2d9a781dd8 fix typos and traces 2021-06-08 09:48:45 +01:00
Paul Szczepanek c51dc2f6cc set to pending only after issuing command 2021-06-02 12:06:43 +01:00
Paul Szczepanek 8ec7cfd820 start and stop adv sets in batches 2021-06-01 22:38:39 +01:00
Paul Szczepanek e99741dd3d change function names 2021-06-01 15:45:08 +01:00
Abbas Bracken Ziad 8ee7fb8642 BLE: support non-low power devices 2021-05-27 10:11:05 +01:00
Yahya Tawil ae31d20904
Merge branch 'master' into master 2021-05-24 20:04:41 +03:00
Yahya Tawil 6318e3a3b7
Solve the type error in one of the tracing msgs
Adapted from #14684
2021-05-22 11:49:49 +03:00
Yahya Tawil 997b523284
Add the missing definition for `as_entry` 2021-05-22 11:46:34 +03:00
Yahya Tawil 27e64a82b8
Add the missing mbed-storage libraries
Refer to #14660
2021-05-22 11:40:36 +03:00
George Beckstein 2578c5356b Fix missing `as_entry` method in KVStoreSecurityDb
This commit introduces changes to fix a missing method, `as_entry`, and traces that were not updated properly to work with this new method.

Prior to this fix, it was not possible to use KVStoreSecurityDb as the build would fail since the `as_entry` method was not declared in the class header file.

This bug was introduced with commit 957486e0eb in PR ARMmbed/mbed-os#14198
2021-05-19 16:38:13 -04:00
Paul Szczepanek 4767b7e1ac fix missing observer ifdefs 2021-05-18 20:58:26 +01:00
Paul Szczepanek 910b7a6438 clear the pal gap queue on reset 2021-05-18 10:39:20 +01:00
Paul Szczepanek 30cd6071cf remove stopping sets since controller resets them 2021-05-18 10:24:16 +01:00
Paul Szczepanek ab123d3e22 advertising start queued up waiting for completion 2021-05-17 19:37:26 +01:00
Martin Kojtal b7b4ca72cc
Merge pull request #14605 from paul-szczepanek-arm/tracix
BLE: Fix traces
2021-05-07 11:44:25 +02:00
Martin Kojtal dace32aef6
Merge pull request #14602 from paul-szczepanek-arm/conf
Deprecate indications event onConfirmationReceived
2021-05-03 09:55:08 +02:00
Paul Szczepanek f872dfa5ca convert bitfield to bools 2021-04-29 19:07:31 +01:00
Paul Szczepanek 7211cd3e77 fix sm init trace to print string 2021-04-29 16:09:04 +01:00
Paul Szczepanek 52bc9e9f51 fix misleading privacy trace 2021-04-29 16:08:52 +01:00
Paul Szczepanek 172e9697da avoid init in header for compatibility 2021-04-28 16:29:26 +01:00
Paul Szczepanek b61fc6b639 Deprecate indications event onConfirmationReceived 2021-04-28 14:02:56 +01:00
Paul Szczepanek f34d31f350 remember if BLE scan paremeters are set 2021-04-07 16:40:46 +01:00
Paul Szczepanek dc6e9db067 add tracing to scan state (#14225) 2021-03-15 15:35:52 +00:00
Vincent Coubard cf33ed0668 BLE: Add MemorySecurityDb.cpp and SecurityDb.cpp to CMake. 2021-03-15 15:35:52 +00:00
Vincent Coubard 957486e0eb BLE: Move traces out of header file to avoid collisions.
This change required the creation of the implementation files of SecurityDb classes.
2021-03-15 15:35:52 +00:00
Vincent Coubard 6adaefd9f3 BLE: Fix traces parameter warnings 2021-03-15 15:35:52 +00:00
Vincent Coubard 65c61a1ca9 BLE: Remove uses of tr_as_array in favour of to_string. 2021-03-15 15:35:52 +00:00
Abbas Bracken Ziad f4febdcb9d Add tracing to BLE GAP (#14117)
* Add traces to GapImpl.cpp

* Add helpers and param logs

* Update GapImpl.cpp

* Move helpers to ble_trace_helpers.h

* Add traces to whitelist setter & getter functions

* Prepend parent dir. to ble_trace_helpers.h include line

* Resolve portability issue by using PRI* macro in place of %lu

* Add traces to PalGapImpl.cpp

* Complete PAL GAP traces

* Remove stray include

* Make 'echo' traces in PAL configurable

Some of the tr_info traces at the beginning of PAL functions  are duplicates ('echoes') of those in GAP functions. This commit enables including/excluding of these traces in mbed_app.json by writing 1/0, respectively to the MBED_CONF_CORDIO_TRACE_PAL_ECHOES config macro. The default is to exclude 'echo' traces.

* Add missing spaces in tr_info traces

* Clean-up param log for set_extended_advertising_parameters

* Remove "Failed: " from every tr_error trace

* Apply changes from PalGapImpl.cpp review

* Apply changes from GapImpl.cpp review

* Use binary for channel map trace

B0: ADVERTISING_CHANNEL_37
B1: ADVERTISING_CHANNEL_38
B2: ADVERTISING_CHANNEL_39

We're assuming that the user understands the above. This could be documented somewhere.

* Replace more %lu w/PRIu32

* Add tr_info to terminateSync for user call

* Make trace group for PAL traces BLDM

* Remove [PAL] prefix from every PAL trace

* Add trace to setPeripheralPrivacyConfiguration

* Make set scan params tr_info dependent on selected PHY

* Add trace to GAP events

* Other GAP events required traces
2021-03-15 15:35:52 +00:00
Paul Szczepanek 91d4b48989 BLE: add traces to gatt client (#14165)
* add traces to gatt client

* add files to cmakelists

Co-Authored-By: Vincent Coubard <vincent.coubard@arm.com>

* fixed tracing variable name

Co-Authored-By: Vincent Coubard <vincent.coubard@arm.com>

* add pal tracing

* add more traces for successfull actions

* put write and read as tr_debug in pal

Co-authored-by: Vincent Coubard <vincent.coubard@arm.com>
2021-03-15 15:35:52 +00:00
Paul Szczepanek 7b08388be6 Add traces to HCI, BLE instance, Security DB and WSF cordio traces (#14138)
* ble HCI tracing

* fix typo in SM trace

* add BLE instance tracing

* route wsf traces to mbed tr_debug

* Update connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.cpp

Co-authored-by: Vincent Coubard <vincent.coubard@arm.com>

* print hci on cordio side

* trace controller supported features

* log reset sequence

* include config for printing enums

* remove duplicate trace

* add tracing to security db

* workaround for macro error on use outside trace

Co-authored-by: Vincent Coubard <vincent.coubard@arm.com>
2021-03-15 15:35:52 +00:00
Vincent Coubard 5aa76e566a BLE: Add privacy trace (#14127)
Add traces to the Bluetooth Security Manager and Privacy controller.
The traces are made to be comprehensive to improve the ux when users submit bugs.
A centralized set of helpers has been created to convert BLE types to string.

* BLE: Add SM traces

* BLE: Add traces to Security Manager PAL

* BLE: Make SM traces consistent.
- Prefix with Connection <id> - when appropriate.
- Display parameters after `:`.
- If multiple parameters should be displayed name then and print the value after =. They are separated by a `,`.

* BLE: Fix SM random number generation.

Only the first 8 bytes were generated from the stack.

* BLE: Regenerate CSRK if it is all zeroes.

* BLE: Add trace into privacy modules

Address resolution is set at the debug level as it is a very common operation and may clutter the output.

* Address trace review for SM:

- Put privacy traces in BLPR
- Add missing traces in PALSecurityManagerImpl.cpp
- Add missing EventHandler null pointer check
- Typo and parameters order fix.
2021-03-15 15:34:34 +00:00
Paul Szczepanek bd5f437896 return OK when stopping advertising that is not active 2021-01-27 16:32:57 +00:00
Vincent Coubard 4cfcadd9e9 BLE: Fix SM random number generation.
Ensure the more than 8 random bytes are fetched from the stack.
2021-01-07 12:38:47 +00:00
Vincent Coubard b28e11574a BLE: Regenerate CSRK if it is all zeroes. 2021-01-07 12:35:24 +00:00
Paul Szczeanek e71f452e9d fix missing return 2020-11-23 09:06:42 +00:00
Paul Szczeanek 63887d19a8 update the peer address when LTK has been found in old entry 2020-11-23 09:06:30 +00:00
Paul Szczeanek 187ed98d82 update the connected status of db entry 2020-11-23 09:06:05 +00:00
Paul Szczeanek 6f844e1a71 fix indexing in ble security db 2020-11-23 09:02:56 +00:00