Add BLE log streaming with runtime toggle and read capability#714
Add BLE log streaming with runtime toggle and read capability#714
Conversation
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
…anges Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
Changed BLE_BLELogging characteristic code from 0x2F to 0x30 in commit 38a474f. Updated all references in the header file, implementation, and documentation. |
|
@copilot instead of creating your own BLE notification, use the function already in the custom characteristic. |
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
Refactored BleAppender to use |
Raised MAX_MESSAGE_SIZE in BleAppender from 180 to 500 to support larger BLE messages. Commented out the MTU update log in BLE_Server.cpp to reduce log verbosity.
BLE Log Streaming Implementation - COMPLETE ✅
This PR successfully implements BLE-based log streaming capability in SmartSpin2k firmware, mirroring existing UDP logging behavior.
Implementation Summary
Runtime Flag
bleLogEnabledtoRuntimeParameters(defaults to false, runtime-only)BLE Custom Characteristic (0x30 - BLE_BLELogging)
0x02, 0x30, <0|1>to enable/disable logging0x01, 0x30returns last cached log messageBLE_ss2kCustomCharacteristic::notify()functionBleAppender Class
ILogAppenderinterfaceIntegration & Documentation
logHandlerinMain.cppCustomCharacteristic.mddocumentationUsage Examples
Enable BLE logging:
0x02, 0x30, 0x01Disable BLE logging:
0x02, 0x30, 0x00Read last log:
0x01, 0x30→0x80, 0x30, [message]Real-time logs: Subscribe to characteristic, then enable logging
Testing Status
Key Features
Files Changed (8 files, +100 lines, -35 lines removed)
include/SmartSpin_parameters.hsrc/SmartSpin_parameters.cppinclude/BLE_Custom_Characteristic.hsrc/BLE_Custom_Characteristic.cppinclude/BleAppender.h(new)src/BleAppender.cpp(new, simplified)src/Main.cppCustomCharacteristic.mdOriginal prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.