Skip to content

Add tracing to examples and issue template #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- checkout
- run: git clone https://github.com/ARMmbed/mbed-os.git
- run: for i in BLE_* ; do cd $i ; ln -s $PWD/../mbed-os mbed-os ; mbed update ; cd .. ; done
- run: for i in BLE_* ; do cd $i ; mbed config root . ; rm -rf mbed-os ; ln -s $PWD/../mbed-os mbed-os ; mbed update ; cd .. ; done
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -69,4 +69,4 @@ workflows:
parameters:
target: ["DISCO_L475VG_IOT01A"]
toolchain: ["GCC_ARM"]
name: build-cmake-<< matrix.target >>-<< matrix.toolchain >>
name: build-cmake-<< matrix.target >>-<< matrix.toolchain >>
53 changes: 19 additions & 34 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,37 @@ assignees: ''

---

<!--

************************************** WARNING **************************************

The ciarcom bot parses this header automatically. Any deviation from the
template may cause the bot to automatically correct this header or may result in a
warning message, requesting updates.

PLEASE ENSURE ALL SECTIONS OF THIS TEMPLATE ARE FILLED IN AND THAT THERE ARE
NO OTHER CHANGES TO THE TEMPLATE.

Only bugs should be raised here as issues. Questions or enhancements should instead be raised on
our forums:
https://forums.mbed.com/ .

*************************************************************************************

-->

### Description of defect

<!--
Add detailed description of what you are reporting.
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
-->

#### Target(s) and toolchain(s) (name and version) displaying this defect ?

#### Target(s) affected by this defect ?

#### What version of the example and mbed-os are you using (tag or sha) ?

#### Toolchain(s) (name and version) displaying this defect ?


#### What version of Mbed-os are you using (tag or sha) ?
<!--
For a released version please provide the release tag (this can be found as per the instructions below)

mbed-os version can be found in:
https://github.com/ARMmbed/mbed-os/blob/master/platform/include/platform/mbed_version.h
The tag can be reconstructed as follows:
mbed-os-MBED_MAJOR_VERSION.MBED_MINOR_VERSION.MBED_PATCH_VERSION

If you're using an old version, please try using the example branch `development`
and mbed-os branch `master` to see if the issue is still present.
-->

#### How is this defect reproduced ?

#### What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

#### Please attach a file containing the log with traces enabled.

#### How is this defect reproduced ?
<!--
Enable tracing in the example by changing the tracing options in the mbed_app.json:
```
"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 compile with `--profile debug`.

Some trace options may be disabled if image cannot fit or the problem does not require them.
-->
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ cmake-build-*/
GettingStarted.html

# mbed build system
mbed-os-experimental-ble-services/
mbed-os-ble-utils/
mbed-os/
mbed_settings.py
mbed_config.h
*.pyc
BUILD/
cmake_build/
.mbedls*

1 change: 0 additions & 1 deletion BLE_Advertising/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_Advertising/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_Advertising/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "ble/BLE.h"
#include "ble/Gap.h"
#include "pretty_printer.h"
#include "mbed-trace/mbed_trace.h"

const static char DEVICE_NAME[] = "BATTERY";

Expand Down Expand Up @@ -177,6 +178,8 @@ void schedule_ble_events(BLE::OnEventsToProcessCallbackContext *context)

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();
ble.onEventsToProcess(schedule_ble_events);

Expand Down
1 change: 0 additions & 1 deletion BLE_GAP/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_GAP/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_GAP/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <events/mbed_events.h>
#include "ble/BLE.h"
#include "pretty_printer.h"
#include "mbed-trace/mbed_trace.h"

/** This example demonstrates all the basic setup required
* to advertise and scan.
Expand Down Expand Up @@ -613,6 +614,8 @@ void schedule_ble_events(BLE::OnEventsToProcessCallbackContext *context)

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();

/* this will inform us off all events so we can schedule their handling
Expand Down
1 change: 0 additions & 1 deletion BLE_GattClient_CharacteristicUpdates/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_GattClient_CharacteristicUpdates/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_GattClient_CharacteristicUpdates/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "ble/GattClient.h"

#include "gatt_client_process.h"
#include "mbed-trace/mbed_trace.h"

/**
* Handle discovery of the GATT server.
Expand Down Expand Up @@ -534,6 +535,8 @@ class GattClientDemo : private mbed::NonCopyable<GattClientDemo>, public GattCli

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();
events::EventQueue event_queue;

Expand Down
1 change: 0 additions & 1 deletion BLE_GattClient_CharacteristicWrite/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_GattClient_CharacteristicWrite/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_GattClient_CharacteristicWrite/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "events/mbed_events.h"
#include "ble/BLE.h"
#include "ble_app.h"
#include "mbed-trace/mbed_trace.h"

/* GATT server needs free functions */
void service_discovery(const DiscoveredService *service);
Expand Down Expand Up @@ -158,6 +159,8 @@ int main()
{
printf("\r\nGattClient demo of a writable characteristic\r\n");

mbed_trace_init();

GattClientDemo &demo = GattClientDemo::get_instance();

/* this demo will run and sleep for 5 seconds, during which time ble will be shut down */
Expand Down
1 change: 0 additions & 1 deletion BLE_GattServer_AddService/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_GattServer_AddService/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_GattServer_AddService/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "ble/gap/Gap.h"
#include "ble/services/HeartRateService.h"
#include "pretty_printer.h"
#include "mbed-trace/mbed_trace.h"

using namespace std::literals::chrono_literals;

Expand Down Expand Up @@ -174,6 +175,8 @@ void schedule_ble_events(BLE::OnEventsToProcessCallbackContext *context)

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();
ble.onEventsToProcess(schedule_ble_events);

Expand Down
1 change: 0 additions & 1 deletion BLE_GattServer_CharacteristicUpdates/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_GattServer_CharacteristicUpdates/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
6 changes: 5 additions & 1 deletion BLE_GattServer_CharacteristicUpdates/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "events/EventQueue.h"
#include "ble/BLE.h"
#include "gatt_server_process.h"
#include "mbed-trace/mbed_trace.h"

using mbed::callback;
using namespace std::literals::chrono_literals;
Expand Down Expand Up @@ -353,7 +354,10 @@ class ClockService : public ble::GattServer::EventHandler {
ReadWriteNotifyIndicateCharacteristic<uint8_t> _second_char;
};

int main() {
int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();
events::EventQueue event_queue;
ClockService demo_service;
Expand Down
1 change: 0 additions & 1 deletion BLE_GattServer_CharacteristicWrite/.mbed

This file was deleted.

7 changes: 6 additions & 1 deletion BLE_GattServer_CharacteristicWrite/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_GattServer_CharacteristicWrite/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <events/mbed_events.h>
#include "ble/BLE.h"
#include "gatt_server_process.h"
#include "mbed-trace/mbed_trace.h"

static EventQueue event_queue(/* event count */ 10 * EVENTS_EVENT_SIZE);

Expand Down Expand Up @@ -74,6 +75,8 @@ class GattServerDemo : ble::GattServer::EventHandler {

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();

printf("\r\nGattServer demo of a writable characteristic\r\n");
Expand Down
1 change: 0 additions & 1 deletion BLE_GattServer_ExperimentalServices/.mbed

This file was deleted.

3 changes: 3 additions & 0 deletions BLE_GattServer_ExperimentalServices/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "pretty_printer.h"
#include "ble-service-link-loss/LinkLossService.h"
#include "ble-service-current-time/CurrentTimeService.h"
#include "mbed-trace/mbed_trace.h"

using namespace std::literals::chrono_literals;

Expand Down Expand Up @@ -172,6 +173,8 @@ void schedule_ble_events(BLE::OnEventsToProcessCallbackContext *context)

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();
ble.onEventsToProcess(schedule_ble_events);

Expand Down
1 change: 0 additions & 1 deletion BLE_PeriodicAdvertising/.mbed

This file was deleted.

9 changes: 7 additions & 2 deletions BLE_PeriodicAdvertising/mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
{
"target_overrides": {
"*": {
"platform.stdio-baud-rate": 115200
"platform.stdio-baud-rate": 115200,
"mbed-trace.enable": false,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"cordio.trace-hci-packets": false,
"cordio.trace-cordio-wsf-traces": false,
"ble.trace-human-readable-enums": false
},
"K64F": {
"target.components_add": ["BlueNRG_MS"],
Expand Down
3 changes: 3 additions & 0 deletions BLE_PeriodicAdvertising/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <events/mbed_events.h>
#include "ble/BLE.h"
#include "pretty_printer.h"
#include "mbed-trace/mbed_trace.h"

/** This example demonstrates extended and periodic advertising
*/
Expand Down Expand Up @@ -469,6 +470,8 @@ void schedule_ble_events(BLE::OnEventsToProcessCallbackContext *context)

int main()
{
mbed_trace_init();

BLE &ble = BLE::Instance();

/* this will inform us off all events so we can schedule their handling
Expand Down
1 change: 0 additions & 1 deletion BLE_SecurityAndPrivacy/.mbed

This file was deleted.

Loading