A driver is what connects libdaas to a concrete transport. The core works in nodes, identities, and messages; the driver turns a DME into bytes on Ethernet, Wi-Fi, BLE, a serial bus, or a proprietary link, and turns received bytes back into frames the core can read. This guide attaches an INET4 driver and a BLE driver to one node, orders them so the node fails over from one to the other, and shows how DriverKit brings an entirely new transport under the same contract.
Where a driver sits
Communication is layered, and the driver occupies the boundary between the overlay and the underlay:
The core asks the driver for a channel to an endpoint and hands it the DaaS frames to transmit. On the way in, the driver reconstructs the transport's byte stream and passes it to the core, which interprets the DME and delivers the DDO. The driver owns channel open and close, frame transfer, and error signaling; the typeset and payload stay under the control of the core and the application.
Attach a driver
A driver is enabled after the node has an identity—identity first, then transports:
doInit(sid, din)enableDriver(_LINK_INET4, addr:port)enableDriver(_LINK_BLE, ble-uri)enableDriver takes a link—the technology—and a URI—the local endpoint in that transport's own format. An INET4 driver uses an address and port such as 192.168.1.2:4000; BLE, serial, or a proprietary driver use different formats. disableDriver deactivates one again. Verify each activation before proceeding: if a driver fails to come up, the node should not run with a partial configuration—it releases what it created or applies an alternative.
URI and identity stay separate
The DIN identifies the node. The URI identifies the point in the underlay through which that node is currently reachable. The mapping ties them together:
On IP the URI can carry address and port; on a bus, an interface and address; on a radio, a device, frequency, or logical channel. The syntax belongs to the driver, while the mapping stays legible to the core. If the physical endpoint changes, the mapping is updated—the DIN and the DDO do not change. This is what lets a node move between addresses or technologies without rewriting the application.
Two drivers on one node are alternative channels
A node can keep several drivers active at the same time. Each usable relation to a peer is an adjacency bound to a specific link and endpoint, so two drivers to the same peer are two channels to the same DIN:
Policy orders them—priority, retries, and behavior when the active channel is no longer usable. That order is a deployment decision, not a fixed property of the protocols: a battery-powered device may put BLE first for low power, while a gateway puts INET4 first for capacity and latency.
Let the node fail over between them
Because delivery is not tied to the driver, the application addresses the DIN and the core chooses the channel for the next transfer. When the INET4 link drops—a timeout, a disconnection, or a send error—the core moves the same DDO to BLE. Origin and destination, typeset, timestamp, and payload are unchanged; only the channel changes.
Two refinements keep this well-behaved. A flapping link must not cause constant switching, so failover is fast (move the moment INET4 is unusable) while failback is controlled (return to the preferred INET4 only after a stability window or a sufficient quality margin). And a DDO already confirmed by the destination is never resent; one still queued or tied to a failed transfer follows the delivery policy—retry on BLE, wait with backoff, stay queued, or error. Since that is at-least-once, deduplication and ordering (a message ID and sequence number in the payload) remain the application's responsibility.
What the driver must handle
Every technology has its own traits—connection or datagram, MTU, latency, ordering, reliability, addressing, power. The driver normalizes them into one coherent set of operations: initialize and stop the transport; bind a URI to a local or remote endpoint; open, reuse, and close channels; send and receive complete frames; signal errors and state changes; manage multiple peers or subchannels; and participate in discovery when the medium allows.
It also applies the constraints of the medium—segmenting for a small MTU, serializing on a half-duplex link, and reporting failures up to the layer that handles retries and delivery policy. Backpressure has to stay visible to the core: hiding a full queue indefinitely only inflates latency, memory, and the risk of reordering.
Discovery on the medium
A driver also lends its capabilities to discovery, and this is one place INET4 and BLE differ concretely. On a broadcast medium the driver can use a beacon; on a bus it can probe available addresses; on a technology with no native discovery it can use a known endpoint. Whatever the mechanism, the result is expressed in the DaaS plane—the network found, the node exposing it, and the link on which it was reached—so the rest of the stack does not care how the medium advertised itself.
DriverKit: a new transport under the same contract
DriverKit integrates a technology the core does not ship with. You implement the medium's adapter and register it as a driver; from then on the transport is usable by the DaaS services with the same semantics as INET4 or BLE. It targets industrial buses, proprietary modems and radios, OS or RTOS interfaces, legacy protocols, and specialized embedded links.
The extension stays under the core: routing, discovery, synchronization, and DDO exchange keep using the common services. A correct integration preserves a short list of invariants:
- Frame boundaries — the core receives exactly the bytes of each frame, even if the medium fragments or aggregates reads.
- Channel identity — every event is attributed to the correct peer or subchannel.
- Deterministic lifecycle — init, stop, and reconnect release resources and callbacks completely.
- Observable errors — timeouts, closures, and I/O failures reach the core.
- Controlled concurrency — callbacks and buffer access respect the platform's threaded or cooperative model.
- Stable URIs — the endpoint representation can be saved, compared, and reconstructed.
- Message integrity — the DME is carried with its typeset, timestamp, and payload intact.
Crucially for this guide: once a DriverKit driver exposes availability, channel state, and transfer errors, it participates in failover exactly like a standard driver. That means a proprietary link can sit in the same ordered policy as INET4 and BLE, and the node fails over onto it—or off it—without any application-specific logic.
Verify a new driver
A driver is exercised across the whole stack, not in isolation: repeated open and close; bidirectional exchange between several nodes; minimum, maximum, and fragmented payloads; link loss during a frame; queue saturation; discovery and join; time synchronization; routing through a node that holds two different drivers; and recovery after a timeout or reconnection. The driver is finished when the new medium becomes just another property of the underlay and stops being a special case for the rest of the platform.
Minimal sequence
node.doInit(sid, din); // identity first
node.enableDriver(_LINK_INET4, "192.168.1.2:4000"); // preferred channel
node.enableDriver(_LINK_BLE, "ble-endpoint-uri"); // fallback channel
node.setOptions(/* queues, max retries, auto-forwarding on failed send */);
node.setDDOPolicy(/* retry with backoff */);
node.map(remote_din, _LINK_INET4, "192.168.1.3:4000"); // an adjacency over INET4
// a second mapping/adjacency to the same DIN over BLE gives failover a target
node.push(remote_din, ddo); // core picks the channel
node.doPerform(PERFORM_CORE_THREAD);
// node.disableDriver(_LINK_BLE); // deactivate when no longer needed
Link identifiers, URI formats, and method signatures are illustrative and defined per SDK—the link matrix already spans IPv4, BLE, UART, LoRa, Zigbee, MQTT, and raw transports, with DriverKit adding more. Each SDK exposes driver ordering, retries, and auto-routing through its own idiomatic surface.
Invariants
- The link and URI belong to the underlay; the DIN and DDO belong to the overlay; the mapping is the only bridge between them.
- Multiple active drivers are alternative adjacencies—to the same peer, or as first hops toward different peers.
- Delivery is not tied to the driver, so failover moves the DDO to another channel rather than rebuilding it.
- DriverKit brings new transports under the same contract and into the same failover policy as the built-in drivers.
- Transport heterogeneity stays confined to the driver; the core keeps one model of identity, message, and routing.