Module ulcp_mesh

Module ulcp_mesh 

Source
Expand description

ULCP carried over the Node Management binding.

UlcpDevice speaks to whatever satisfies FrameLink: send one frame, receive one frame. That is also the whole of what an administrative exchange does, so a link made of the two lets the ordinary host surface — properties, capabilities, the synchronization procedure, every category command built on them — reach a device across the mesh with nothing about it rewritten for the occasion.

The adapter is split in half. MeshFrameLink is what the device handle holds; MeshEndpoint is what the driver that owns the radio holds. Between them they reconcile the two differences between a wire and the binding:

  • Transaction identifiers. A wire correlates a response to its request by TID. The binding requires TID 0 on every frame and correlates by envelope token instead, so requests go out with their TID cleared and replies come back wearing the one their request carried.

  • Reset-class commands. CMD_RST, CMD_RESTORE and CMD_FACTORY_RESET are answered over the binding by no payload at all — delivery is the acknowledgment. A local device announces its new status instead, and callers wait for that announcement, so this synthesizes the announcement the device would have sent.

    One consequence is worth knowing about. The exchange engine decides a command is reset-class by reading the request, and settles it as soon as the acknowledgment lands — before any reply is drained. A CMD_RESTORE that the device refuses for want of a snapshot does answer, with STATUS_INVALID_STATE, and that answer loses the race: the caller is told the restore completed. Reading PROP_LAST_STATUS in a later exchange is how the spec says to find out what actually happened, and it remains the way to tell these two apart over the mesh.

Everything else the binding refuses — the host domain, session state, the private key — it refuses as STATUS_PROP_NOT_FOUND, which is an answer and needs no help from here.

Structs§

MeshEndpoint
The driver’s half: requests to carry, and outcomes to report.
MeshFrameLink
The device handle’s half: a FrameLink whose wire is an administrative exchange.
MeshRequest
One request the driver is to carry, and the bookkeeping needed to deliver its outcome.

Enums§

DeliveredOutcome
How an exchange ended.
MeshFault
Why an exchange produced no frame to hand back.

Functions§

describe
What a failed exchange means to somebody holding the tool.
mesh_link
Build a mesh link and the endpoint that serves it.