Skip to main content

Protocol Adapters

Protocol adapters translate abstract Qubit commands into device-specific message formats. Each adapter handles the encoding, transport semantics, and response parsing for a specific protocol.

Adapter Pattern

All adapters extend the ProtocolAdapter base class:

OCPP Adapter

For EV charging stations running OCPP 1.6 or 2.0:

Command Mapping

Example: Set Charging Profile

Modbus Adapter

For battery management systems and inverters using Modbus TCP/RTU:

Register Mapping

Example: Battery Discharge

Adapter Registry

The AdapterRegistry maps asset IDs to their protocol adapters:
If an unregistered asset ID is requested, a KeyError is raised with diagnostic info:

Writing Custom Adapters

To add support for a new protocol (e.g., DNP3, IEC 61850, REST API):