The adapter.EdgeAdapter interface (github.com/Zequent/zqnt-edge-sdk-go/v2/adapter) is the core
contract of the Go Edge SDK — the direct hardware-command surface, one method per operation, plus
SendCustomCommand for everything else. See the Overview for what this SDK
covers.
Zequent Backend ──(gRPC)──> adapter/grpc.Server ──(delegates)──> Your EdgeAdapter implementation
edgesdk.NewEdgeClient registers the gRPC server for you (see
Quickstart) — you never touch adapter/grpc directly, just implement
EdgeAdapter and hand it to NewEdgeClient.
Embed adapter.UnimplementedEdgeAdapter in your concrete type to get NOT_IMPLEMENTED defaults for
every method, then override only what your hardware supports:
Note the pattern: a hardware-side failure is returned as domains.Error(...) inside a successful(*CommandResult, nil) return, not as a Go error — the error return is for transport/protocol
failures. Both are distinct from NOT_IMPLEMENTED, which UnimplementedEdgeAdapter already handles
for anything you don't override.
Server-streaming — call send for each detection frame until ctx is cancelled or the stream ends; a non-nil error from send (or your own return) terminates the stream.
Capability reporting
Method
Description
GetCapabilities(ctx, sn)
Report the device's current capability snapshot (*domains.CurrentCapabilities)
Each Capability carries Command, Description, Available, UnavailableReason, Metadata,
TargetType, TargetRef, SchemaVersion, InputSchema/OutputSchema (JSON Schema), Errors,
Events, Requirements and SkillID — see adapter/domains/capability.go.
Task execution
Method
Description
PrepareTask(ctx, sn, taskID, tid string)
Not called by the 2.0 platform
StartTask(ctx, sn, taskID, tid string)
Not called by the 2.0 platform
PauseTask(ctx, sn, taskID, tid string)
Not called by the 2.0 platform
ResumeTask(ctx, sn, taskID, tid string)
Not called by the 2.0 platform
StopTask(ctx, sn, taskID, tid string)
Cancels a running command — taskID is the command's execution id (see below)
Handle a command that doesn't map to a standard method above — for example mission.waypoint.execute. CustomCommandRequest carries SN, TID, CommandID, an optional TargetRef, and Params map[string]any
When a command runs as part of a Skill execution, a successful answer means accepted, not
finished: the step completes only when your adapter publishes a command execution event for it.
That holds for every custom command, and for TakeOff, GoTo, LookAt and ReturnToHome. The id
the platform waits on is the request's TID, so publish under it — RUNNING with Progress while it
runs, then exactly one of CommandExecutionSucceeded (optionally with Output), CommandExecutionFailed
or CommandExecutionCancelled:
typeMyDroneAdapterstruct { adapter.UnimplementedEdgeAdapter live livedata.LiveDataService // set to client.LiveData() after NewEdgeClient}func (a *MyDroneAdapter) SendCustomCommand(ctx context.Context, req *domains.CustomCommandRequest) (*domains.CommandResult, error) {if req.CommandID !="mission.waypoint.execute" {return domains.NotImplemented("unknown command "+req.CommandID, req.SN), nil }// The request's TID is the id the platform waits ongo a.flyRoute(req.SN, req.TID, req.Params)return domains.SuccessWithTID("route accepted", req.TID, req.SN), nil}func (a *MyDroneAdapter) flyRoute(sn, executionID string, params map[string]any) {// ... fly the route, publishing CommandExecutionRunning events with Progress as it goes ... _ = a.live.PublishCommandExecutionEvent(context.Background(), &domains.CommandExecutionEvent{ SN: sn, ExternalExecutionID: executionID, CommandID: "mission.waypoint.execute", Status: domains.CommandExecutionSucceeded, })}
Without a terminal event the Skill waits until it times out. To cancel, the platform calls StopTask
with that same id.