src.bluetooth_sig.gatt.characteristics.utils.parse_trace¶
Parse trace utility for debugging characteristic parsing.
Classes¶
Name | Description |
|---|---|
Manages parse traces with built-in enable/disable logic. |
Module Contents¶
- class src.bluetooth_sig.gatt.characteristics.utils.parse_trace.ParseTrace(enabled: bool = True)¶
Manages parse traces with built-in enable/disable logic.
This class encapsulates the trace collection logic to avoid manual if checks throughout the parsing code, improving performance when tracing is disabled.
Example
trace = ParseTrace(enabled=True) trace.append(“Starting parse”) trace.append(“Validation complete”) result = trace.get_trace() # Returns list of strings
- append(message: str) None¶
Append a message to the trace if tracing is enabled.
- Parameters:
message – Trace message to append