diff --git a/CHANGELOG.md b/CHANGELOG.md index b7fc64ac4..f7c166042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased ### Added -- GATT Service: Broadcast Audio Scamn Service Server and Client (BASS 1.0) +- GATT Service: Broadcast Audio Scan Service Server and Client (BASS 1.0) +- hci_dump_stdout: allow to truncate ACL, SCO and ISO packets with HCI_DUMP_STDOUT_MAX_SIZE_* ### Fixed - ESP32: fix init for BR/EDR Only mode diff --git a/doc/manual/docs-template/how_to.md b/doc/manual/docs-template/how_to.md index e75c5010c..9107ca3ac 100644 --- a/doc/manual/docs-template/how_to.md +++ b/doc/manual/docs-template/how_to.md @@ -216,6 +216,15 @@ If implemented, bonding information is stored in Non-volatile memory. For Classi | NVM_NUM_DEVICE_DB_ENTRIES | Max number of LE Device DB entries that can be stored | | NVN_NUM_GATT_SERVER_CCC | Max number of 'Client Characteristic Configuration' values that can be stored by GATT Server | +### HCI Dump Stdout directives {#sec:hciDumpStdout} + +Allow to truncate HCI ACL and SCO packets to reduce console output for debugging audio applications. + +| \#define | Description | +|------------------------------|-------------------------------------------| +| HCI_DUMP_STDOUT_MAX_SIZE_ACL | Max size of ACL packets to log via stdout | +| HCI_DUMP_STDOUT_MAX_SIZE_SCO | Max size of SCO packets to log via stdout | +| HCI_DUMP_STDOUT_MAX_SIZE_ISO | Max size of ISO packets to log via stdout | ### SEGGER Real Time Transfer (RTT) directives {#sec:rttConfiguration} diff --git a/platform/embedded/hci_dump_embedded_stdout.c b/platform/embedded/hci_dump_embedded_stdout.c index 08a712134..b72338c84 100644 --- a/platform/embedded/hci_dump_embedded_stdout.c +++ b/platform/embedded/hci_dump_embedded_stdout.c @@ -76,6 +76,12 @@ static void hci_dump_embedded_stdout_packet(uint8_t packet_type, uint8_t in, uin printf("EVT <= "); break; case HCI_ACL_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_ACL + if (len > HCI_DUMP_STDOUT_MAX_SIZE_ACL){ + printf("LOG -- ACL %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("ACL <= "); } else { @@ -83,6 +89,12 @@ static void hci_dump_embedded_stdout_packet(uint8_t packet_type, uint8_t in, uin } break; case HCI_SCO_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_SCO + if (len > HCI_DUMP_STDOUT_MAX_SIZE_SCO){ + printf("LOG -- SCO %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("SCO <= "); } else { @@ -90,6 +102,12 @@ static void hci_dump_embedded_stdout_packet(uint8_t packet_type, uint8_t in, uin } break; case HCI_ISO_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_ISO + if (len > HCI_DUMP_STDOUT_MAX_SIZE_ISO){ + printf("LOG -- ISO %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("ISO <= "); } else { diff --git a/platform/posix/hci_dump_posix_stdout.c b/platform/posix/hci_dump_posix_stdout.c index 489994510..dc51b7ea9 100644 --- a/platform/posix/hci_dump_posix_stdout.c +++ b/platform/posix/hci_dump_posix_stdout.c @@ -82,6 +82,12 @@ static void hci_dump_posix_stdout_packet(uint8_t packet_type, uint8_t in, uint8_ printf("EVT <= "); break; case HCI_ACL_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_ACL + if (len > HCI_DUMP_STDOUT_MAX_SIZE_ACL){ + printf("LOG -- ACL %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("ACL <= "); } else { @@ -89,6 +95,12 @@ static void hci_dump_posix_stdout_packet(uint8_t packet_type, uint8_t in, uint8_ } break; case HCI_SCO_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_SCO + if (len > HCI_DUMP_STDOUT_MAX_SIZE_SCO){ + printf("LOG -- SCO %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("SCO <= "); } else { @@ -96,6 +108,12 @@ static void hci_dump_posix_stdout_packet(uint8_t packet_type, uint8_t in, uint8_ } break; case HCI_ISO_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_ISO + if (len > HCI_DUMP_STDOUT_MAX_SIZE_ISO){ + printf("LOG -- ISO %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("ISO <= "); } else { diff --git a/platform/windows/hci_dump_windows_stdout.c b/platform/windows/hci_dump_windows_stdout.c index 3c917ffeb..6e8c86e00 100644 --- a/platform/windows/hci_dump_windows_stdout.c +++ b/platform/windows/hci_dump_windows_stdout.c @@ -71,6 +71,12 @@ static void hci_dump_windows_stdout_packet(uint8_t packet_type, uint8_t in, uint printf("EVT <= "); break; case HCI_ACL_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_ACL + if (len > HCI_DUMP_STDOUT_MAX_SIZE_ACL){ + printf("LOG -- ACL %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("ACL <= "); } else { @@ -78,6 +84,12 @@ static void hci_dump_windows_stdout_packet(uint8_t packet_type, uint8_t in, uint } break; case HCI_SCO_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_SCO + if (len > HCI_DUMP_STDOUT_MAX_SIZE_SCO){ + printf("LOG -- SCO %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("SCO <= "); } else { @@ -85,6 +97,12 @@ static void hci_dump_windows_stdout_packet(uint8_t packet_type, uint8_t in, uint } break; case HCI_ISO_DATA_PACKET: +#ifdef HCI_DUMP_STDOUT_MAX_SIZE_ISO + if (len > HCI_DUMP_STDOUT_MAX_SIZE_ISO){ + printf("LOG -- ISO %s, size %u\n", in ? "in" : "out", len); + return; + } +#endif if (in) { printf("ISO <= "); } else {