Commit Graph

13 Commits (master)

Author SHA1 Message Date
Abbas Bracken Ziad 0ec4a57a6c Fix string buffer length in UUID trace helper 2021-05-13 11:56:23 +01:00
Paul Szczepanek d43d4a0e7e fix cordio include path 2021-03-18 11:30:43 +00:00
Paul Szczepanek 1afbbebc96 fix include path for dm_api.h 2021-03-18 11:27:42 +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
Vincent Coubard c674990820 BLE: Fix sprintf overflow in trace helpers. 2021-03-15 15:35:52 +00:00
Vincent Coubard 52a3de6657 BLE: Move tracing helpers into implementation file. 2021-03-15 15:35:52 +00:00
Vincent Coubard c13e590723 BLE: Refactor UUID string helper to match mbed-os coding style. 2021-03-15 15:35:52 +00:00
Vincent Coubard e001098699 BLE: Fix out of range memory access in trace helper. 2021-03-15 15:35:52 +00:00
Abbas Bracken Ziad db9428f18f Add tracing to BLE Gatt Server (#14107)
* Add traces to GattServerImpl.cpp

* Update BLGS traces

* Add context to BLGS traces

* Set value of TRACE_WRITE_VALUES to 0

* Add param logs to BLGS traces

* Apply changes from code review

* Add trace helper for UUIDs

* C++ string library is not needed

* Update to_string function for UUIDs

The previous implementation had a memory leak and did not format 128-bit UUIDs

* Possibly faster ternary

* Add more context to adding/inserting of services/characteristic

* Add trace to events and event path

* Refactor to_string helper for UUIDs
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