src.bluetooth_sig.gatt.characteristics.utils.data_parser¶
Data parsing utilities for basic data types.
Classes¶
Name | Description |
|---|---|
Utility class for basic data type parsing and encoding. |
Module Contents¶
- class src.bluetooth_sig.gatt.characteristics.utils.data_parser.DataParser¶
Utility class for basic data type parsing and encoding.
- static encode_int16(value: int, signed: bool = False, endian: Literal['little', 'big'] = 'little') bytearray¶
Encode 16-bit integer with configurable endianness and signed/unsigned validation.
- static encode_int24(value: int, signed: bool = False, endian: Literal['little', 'big'] = 'little') bytearray¶
Encode 24-bit integer with configurable endianness and signed/unsigned validation.
- static encode_int32(value: int, signed: bool = False, endian: Literal['little', 'big'] = 'little') bytearray¶
Encode 32-bit integer with configurable endianness and signed/unsigned validation.
- static encode_int8(value: int, signed: bool = False) bytearray¶
Encode 8-bit integer with signed/unsigned validation.
- static parse_float32(data: bytearray, offset: int = 0) float¶
Parse IEEE-754 32-bit float (little-endian).
- static parse_float64(data: bytearray, offset: int = 0) float¶
Parse IEEE-754 64-bit double (little-endian).
- static parse_int16(data: bytes | bytearray, offset: int = 0, signed: bool = False, endian: Literal['little', 'big'] = 'little') int¶
Parse 16-bit integer with configurable endianness and signed interpretation.
- static parse_int24(data: bytes | bytearray, offset: int = 0, signed: bool = False, endian: Literal['little', 'big'] = 'little') int¶
Parse 24-bit integer with configurable endianness and signed interpretation.
- static parse_int32(data: bytes | bytearray, offset: int = 0, signed: bool = False, endian: Literal['little', 'big'] = 'little') int¶
Parse 32-bit integer with configurable endianness and signed interpretation.
- static parse_int8(data: bytes | bytearray, offset: int = 0, signed: bool = False) int¶
Parse 8-bit integer with optional signed interpretation.