Commit Graph

20 Commits

Author SHA1 Message Date
Guo Zifan
7d904f636f docs(ble): rename BLE Log Console migration notice
(cherry picked from commit 9fb982d53b)

Co-authored-by: guozifan <guozifan@espressif.com>
2026-07-10 10:43:57 +08:00
Guo Zifan
4eb7dde736 remove(ble): migrate BLE Log Console out of ESP-IDF
(cherry picked from commit d8d7c3d904)

Co-authored-by: guozifan <guozifan@espressif.com>
2026-07-10 10:43:56 +08:00
Island
98effc1d13 Merge branch 'feat/format_bt_hci_to_btsnoop_v6.0' into 'release/v6.0'
refactor(bt): migrate bt_hci_to_btsnoop to esp-pylib (6.0)

See merge request espressif/esp-idf!49710
2026-06-29 14:39:47 +08:00
Zhang Hai Peng
3d532e7b14 refactor(bt): migrate bt_hci_to_btsnoop to esp-pylib
Replace argparse with rich-click and use esp_pylib.logger for
standardized console output and fatal error handling.


(cherry picked from commit 3a7896f2c5)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-06-16 15:34:08 +08:00
Marek Fiala
007e0139d7 feat(tools): Replaced click with rich_click 2026-05-29 10:52:09 +02:00
Zhou Xiao
03a54ef8f9 fix(ble_log_console): exclude from idf-ci pytest collection to fix CI
idf-ci discovers pyproject.toml pytest config and runs a separate
collection pass with --target all, which finds 0 target tests and
raises RuntimeError. Add to .idf_ci.toml exclude_dirs instead of
deleting tests. Restore all 227 unit tests with lint/mypy fixes.


(cherry picked from commit 205bc49fd6)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:15:00 +08:00
Zhou Xiao
424262d916 docs(ble_log_console): update user guides for new features and run/build scripts
- Recommend run.sh/run.bat as primary launch method with Launch Screen description
- Add build.sh/build.bat section for standalone executable packaging
- Document buffer utilization screen (m key) and two-table stats layout (d key)
- Update menuconfig path, status panel format, and Kconfig option names
- Remove obsolete textual ModuleNotFoundError troubleshooting
- Simplify manual configuration to single toggle (defaults cover most cases)
- Fix ESP32 -> ESP chip in introduction


(cherry picked from commit 391f7b7d8a)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:54 +08:00
Zhou Xiao
4033fceed5 feat(ble_log_console): add buffer utilization tracker and display
Add BufUtilTracker to record per-LBM inflight peak data, wire it
through StatsAccumulator and StatsUpdated message for thread-safe
delivery to the UI. Buffer utilization is displayed in a dedicated
BufUtilScreen accessible via the 'm' keybinding, separate from
the frame stats screen ('d').

Also reject false INIT_DONE frames with version==0 caused by
misaligned data during parser sync, preventing spurious stats resets.


(cherry picked from commit ca920a8e8f)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:53 +08:00
Zhou Xiao
e3dc63eff0 feat(ble_log_console): add BUF_UTIL internal frame decoding
Add BUF_UTIL=5 to InternalSource, BufUtilPool enum, BufUtilResult
TypedDict, BufUtilEntry dataclass, and name resolution helpers.
Add decode branch in internal_decoder with pool/index extraction
from the packed lbm_id field. Tests cover valid decode, pool/index
extraction, and truncated payload handling.


(cherry picked from commit d9a4d15203)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:47 +08:00
Zhou Xiao
9a78222735 feat(ble_log_console): add CLI entry point, build scripts, and docs
- Click-based CLI entry point (console.py) with --port, --baudrate,
  --log-dir options and interactive Launch Screen when --port omitted
- Deprecation warning for --output CLI flag
- 'ls' subcommand to list saved capture files
- PyInstaller build scripts (build.sh, build.bat, build_exe.py)
- Convenience run scripts (run.sh, run.bat)
- README rewrite with installation, usage, architecture docs, and
  troubleshooting guide
- User guides in English and Chinese
- Remove old single-file ble_log_console.py
- Register new scripts in executable-list.txt


(cherry picked from commit a51d879d1b)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:46 +08:00
Zhou Xiao
641cc41fbe feat(ble_log_console): add Textual frontend and app wiring
TUI frontend built on Textual with thread-safe backend integration:

- Launch screen with port/baud/log-dir selection and auto-refresh
- Log view with scrollable RichLog and color-coded write methods;
  Rich markup escaped to prevent crash on bracket characters
- Stats screen split into two tables by time base:
  - Firmware Counters (since chip init): Written and Buffer Loss
  - Console Measurements (since console start): Average Throughput
    and Peak Write — each with separate frames and bytes sub-columns
  - Column widths constrained with min_width/max_width for stable layout
  - Division-by-zero guard when peak window is zero
- Shortcut screen overlay
- Status panel with sync state, checksum mode, and transport metrics;
  speed display uses named UART_BITS_PER_BYTE constant
- Main app wiring: UART reader thread with threading.Lock for serial
  access, frame parser pipeline, stats emission via StatsUpdated
  messages (including funnel snapshots via public accessor for
  thread-safe delivery), BackendStopped message for disconnect
- BackendStopped posted on open_serial failure (prevents stuck status)
- Select.BLANK guard for baud rate in launch screen
- Explicit None guards replace asserts in backend worker
- Wall-clock burst tracking for REDIR frames (no chip-side timestamp)
- SN gap alerts (FrameLossDetected) and traffic spike notifications


(cherry picked from commit 02f1960e56)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:46 +08:00
Zhou Xiao
613ad16948 feat(ble_log_console): add backend with frame parser, stats, and data models
Modular backend for the BLE log console rewrite:

- Frame parser with sync state machine and checksum auto-detection
  (4 modes: XOR/Sum x Full/Header-only); handles incomplete frames
  during re-sync search when previously synced
- Internal frame decoder (INIT_DONE, ENH_STAT, FLUSH, INFO)
- Data models: SourceCode, FrameByteCount, FunnelSnapshot, LossType
- Stats package with composition-root StatsAccumulator orchestrating:
  - TransportMetrics (RX bytes, lifetime-average throughput)
  - FirmwareLossTracker / FirmwareWrittenTracker (ENH_STAT deltas
    with first-report absolute value initialization)
  - SNGapTracker (sliding window reorder-tolerant SN gap detection)
  - PeakBurstTracker (per-source sliding window burst density)
  - TrafficSpikeDetector (wire utilization spike detection)
  - Wall-clock burst tracker for non-timestamped sources (REDIR)
- Torn-read guard on ENH_STAT reports (baudrate-based plausibility)
  with prev-state update on discard to prevent cascading drops
- Console-local metrics (TransportMetrics, PeakBurstTracker) preserved
  across INIT_DONE resets; only ENH_STAT-coupled components reset
- UART transport with port validation and exclusive serial access
- Comprehensive test suite (17 test files, 223 tests)


(cherry picked from commit 9046c77e52)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:45 +08:00
Zhou Xiao
94761261f2 change(bt/ble_log): remove BLE Log UHCI Out module
Delete ble_log_uhci_out.c and its header. Remove the UHCI Out source
from CMakeLists.txt and all BT_BLE_LOG_UHCI_OUT_* Kconfig options.
Remove per-chip BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED Kconfig and
all UHCI Out caller references in esp32c5/c6/h2 controller bt.c.
Update ble_log_console README to reference the new BLE Log Module
UART DMA config. The functionality is superseded by the BLE Log
Module's UART DMA peripheral transport.


(cherry picked from commit d51892380b)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:38 +08:00
Zhou Xiao
64ef451586 feat(ble): added safe unity component 2025-09-26 10:25:25 +08:00
Zhou Xiao
36cdf54b37 feat(ble): added ble log console for ble log uhci out 2025-08-08 12:01:43 +08:00
Rahul Tank
1aa93c5522 fix(nimble): Minor documentation update in btsnoop script usage 2025-07-28 16:12:44 +05:30
Rahul Tank
54e65df985 fix(nimble): Add support to parser script to parse logs with/without ts
Introduced a new "--has-ts" input parameter to script to detect if logs
has timestamp information or not
2025-07-21 12:10:21 +05:30
Rahul Tank
2823aac1a7 fix(nimble): Enhanced HCI logging by adding timestamp information 2025-07-16 15:31:39 +05:30
zhanghaipeng
aa2f136e16 fix(ble/bluedroid): Optimize CI configuration for Bluedroid example 2025-01-03 14:35:07 +08:00
zhanghaipeng
decb24f940 feat(bt): Add support for converting BT HCI logs to btsnoop format 2024-11-21 17:21:13 +08:00