EUCProtocol

Properties

Link copied to clipboard
abstract val dataFlow: Flow<EUCData>
Link copied to clipboard
abstract val manufacturer: String

Manufacturer name

Link copied to clipboard
open val rawFrameFlow: Flow<ByteArray>

Flow that emits every raw BLE characteristic notification received by this protocol, as a defensive copy of the original byte array. Collectors can use this to write raw logs or perform any custom processing on the unmodified BLE data.

Link copied to clipboard

Explicit command support matrix for this protocol. Commands outside this set are considered unsupported by design.

Link copied to clipboard
abstract val supportedModels: List<String>

List of supported models

Link copied to clipboard
open val writeFlow: Flow<ByteArray>

Flow of commands or raw bytes that the protocol needs to write to the device automatically.

Functions

Link copied to clipboard
abstract fun canHandle(device: EUCDevice): Boolean

Check if this protocol can handle the given device

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract fun createCommand(commandType: CommandType, value: Any): ByteArray

Create a command for the EUC

Link copied to clipboard
abstract fun decode(data: ByteArray): EUCData?

Decode raw BLE data into EUCData

Link copied to clipboard
open fun getBMSData(): List<BMSData>?

Get BMS (Battery Management System) data for this protocol. Returns null if this protocol does not support BMS data extraction. Protocols that support BMS data should override this method to return a list of BMSData objects representing the current state of all battery packs.

Link copied to clipboard

API-level command support check (used by framework and clients).

Link copied to clipboard

Get the UUID for the data characteristic

Link copied to clipboard

Optional polling/query plan consumed by BLEManager orchestration.

Link copied to clipboard
abstract fun getServiceUUID(): UUID

Get the UUID for the service

Link copied to clipboard

Get the UUID for the write characteristic (if different from data characteristic)

Link copied to clipboard
abstract fun isDeviceReady(data: EUCData): Boolean

Check if the device is ready for operation

Link copied to clipboard

Optional fast header check: returns true if chunk appears to contain frames belonging to this protocol, based on magic-byte patterns alone. The default returns false (opt-out). Protocols override this to enable frame-header-based routing without full decoding.

Link copied to clipboard

Optional query/response matcher used by BLEManager observability and retry loop.