diff --git a/docs/api/connectivity/bluetooth/BLE.md b/docs/api/connectivity/bluetooth/BLE.md index 8a607d3804..a7bfdbbeb6 100644 --- a/docs/api/connectivity/bluetooth/BLE.md +++ b/docs/api/connectivity/bluetooth/BLE.md @@ -52,6 +52,40 @@ The class's member functions can be divided by purpose: 1. Construct a service class and add it to the BLE stack. 1. Push notifications when the characteristic's value changes. +## Tracing + +To debug issues (or to understand what the stack is doing) it may be helpful to enable tracing. + +Traces can be turned on by overriding configuration options in you mbed_app.json: + +``` + "target_overrides": { + "*": { + "mbed-trace.enable": true, + "mbed-trace.max-level": "TRACE_LEVEL_DEBUG", + "cordio.trace-hci-packets": true, + "cordio.trace-cordio-wsf-traces": true, + "ble.trace-human-readable-enums": true + } + } +``` + +and compiling your application with `--profile debug`. Please note that with all options enabled your application may become too big - disable some options or lower the `mbed-trace.max-level`. Detailed documentation is available in the tracing [README.md](https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed-trace/README.md). + +All BLE modules contain tracing, each of the modules prefixed with a unique tag: +- `BLE ` - general BLE traces +- `BLGP` - GAP +- `BLGS` - GATT Server +- `BLGC` - GATT Client +- `BLSM` - Security Manager +- `BLDB` - Security Database +- `BLHC` - HCI +- `BLCO` - Cordio stack +- `BLDM` - GAP pal +- `BLAT` - ATT client + +Any contributions to BLE should include appropriate tracing code. + ## BLE class reference [![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/mbed-os/development/mbed-os-api-doxy/classble_1_1_b_l_e.html) diff --git a/docs/api/connectivity/bluetooth/BatteryService.md b/docs/api/connectivity/bluetooth/BatteryService.md deleted file mode 100644 index f260385c36..0000000000 --- a/docs/api/connectivity/bluetooth/BatteryService.md +++ /dev/null @@ -1,15 +0,0 @@ -# BatteryService - -It is often a requirement for devices operating on battery to report the battery charge level to the user. - -The [Bluetooth Battery Service](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=245138) defines how to expose a battery charge level through a BLE link. It allows a client - usually a smartphone application - of a device to read the current battery charge level and follow its evolution. - -The BatteryService class implements the Bluetooth Battery Service as defined by the Bluetooth SIG. Makers of BLE devices operating on battery can use the API to expose interoperably the charge level of their products. - -## BatteryService class reference - -[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/mbed-os/development/mbed-os-api-doxy/class_battery_service.html) - -## Related content - -- [Bluetooth Battery Service](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=245138) specification. diff --git a/docs/api/connectivity/bluetooth/EnvironmentalService.md b/docs/api/connectivity/bluetooth/EnvironmentalService.md deleted file mode 100644 index d43556877c..0000000000 --- a/docs/api/connectivity/bluetooth/EnvironmentalService.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnvironmentalService - -[Add description here.] - -## EnvironmentalService class reference - -[![View code](https://os.mbed.com/docs/mbed-os/development/mbed-os-api-doxy/class_environmental_service.html) - -## EnvironmentalService example - -[Add example here.] diff --git a/docs/api/connectivity/bluetooth/HeartRateService.md b/docs/api/connectivity/bluetooth/HeartRateService.md deleted file mode 100644 index bc152328c2..0000000000 --- a/docs/api/connectivity/bluetooth/HeartRateService.md +++ /dev/null @@ -1,18 +0,0 @@ -# HeartRateService - -People practicing physical activities use heart rate monitors to track their pulse in real time and improve their physical performances. - -The [Bluetooth Heart Rate Service](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=239866) defines how data from a heart rate sensor should be exposed through a BLE link. The standard nature of the service allows seamless operations between collectors - usually smartphone applications - and heart rate monitors conforming to the service. - -The HeartRateService class implements the Bluetooth Heart Rate service as defined by the Bluetooth body. Makers of BLE enabled fitness devices can use it to expose interoperably heart rate sensor data. - - **Note:** The Bluetooth Heart Rate Service is part of the [Bluetooth Heart Rate Profile](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=239865), which defines behaviors that a Bluetooth heart rate sensor expects. You must ensure that your application conforms to the heart rate profile to guarantee interoperability of your heart rate sensors. - -## HeartRateService class reference - -[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/mbed-os/development/mbed-os-api-doxy/class_heart_rate_service.html) - -## Related content - -- [Bluetooth Heart Rate Service](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=239866) specification. -- [Bluetooth Heart Rate Profile](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=239865) specification. diff --git a/docs/contributing/guidelines/style.md b/docs/contributing/guidelines/style.md index c48323fab7..248fdb1b3f 100644 --- a/docs/contributing/guidelines/style.md +++ b/docs/contributing/guidelines/style.md @@ -163,6 +163,14 @@ Below is an example of typical namespace use in a source file: All functions and methods should contain documentation using Doxygen. +### Tracing + +Mbed OS offers a tracing facility through `mbed-trace/mbed_trace.h`. It offers several levels of tracing and toggling groups. + +For details please refer to the documentation in the [README.md](https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed-trace/README.md) file in the Mbed OS repository. + +Please consider adding traces to your code. Make sure the group you use is unique. If the module you're working on already has traces, adding traces with your changes is required. + ## Compiler settings All C and C++ code submitted to Mbed OS must compile with GCC Arm Embedded and Arm Compiler 6. Mbed OS: