Edge SDK — Edge Adapter API Reference

Coming from 1.3? See the Migration guide; for 1.3.x (end of life), the 1.3 Edge Adapter reference.

Method reference for EdgeAdapterService, the interface your adapter implements. For a narrative introduction and worked examples, see the Edge Adapter guide.

Every method is a default method returning NOT_IMPLEMENTED — override only what your device supports. Every method returns CompletableFuture<CommandResult>, except getCapabilities (CompletableFuture<CurrentCapabilities>).

How commands arrive

The platform runs work as Skills. Each command node of a run is dispatched to your adapter by its command id: a built-in id lands on the matching method below, any other id on sendCustomCommand.

  • Waits for your report. flight.takeoff, navigation.go_to, gimbal.look_at and flight.return_to_home, and a custom command that returns no result, are accepted: the node stays running until you report a command execution event for it (SUCCEEDED, FAILED, ...). Return CommandResult.accepted(message, externalExecutionId, sn) with your own execution id; without one, the platform uses the request's transaction id. See Edge Adapter guide — Custom Commands.
  • Done on success. Every other built-in command is complete when you return success.
  • Cancel. The platform cancels a running command with cancelExecution(sn, externalExecutionId).

Flight

MethodCommand idDescription
takeOff(TakeOffRequest)flight.takeoffTake off and fly to the target coordinates
goTo(GoToRequest)navigation.go_toFly to the target coordinates; altitude is relative to the takeoff point
returnToHome(ReturnToHomeRequest)flight.return_to_homeReturn home; altitude optional
enterManualControl(String sn)flight.manual.enterEnter manual (stick) control
exitManualControl(String sn)flight.manual.exitLeave manual control
manualControlInput(ManualControlInput)—Called once per stick-input frame while a manual control session is active

Camera, gimbal and stream

MethodCommand idDescription
lookAt(LookAtRequest)gimbal.look_atPoint the camera at coordinates (locked, payloadIndex optional)
enableGimbalTracking(String sn, boolean enabled)gimbal.trackingGimbal tracking on/off
takePhoto(TakePhotoRequest)camera.take_photoCapture a still photo
changeLens(ChangeLensRequest)camera.change_lensSwitch the active lens
changeZoom(ChangeZoomRequest)camera.change_zoomSet the zoom level for a lens
startLiveStream(LiveStreamStartRequest)stream.startStart publishing video to the stream server URL in the request
stopLiveStream(LiveStreamStopRequest)stream.stopStop publishing
liveStreamSplitScreen(String sn, boolean enabled)stream.split_screenSplit-screen view across lenses on/off

Dock and asset

MethodCommand idDescription
openCover(String sn)dock.open_coverOpen the dock cover
closeCover(String sn, Boolean force)dock.close_coverClose the dock cover, optionally forced
startCharging(String sn)dock.start_chargingStart charging the drone
stopCharging(String sn)dock.stop_chargingStop charging
rebootAsset(String sn)asset.rebootReboot the asset
bootUpSubAsset(String sn) / bootDownSubAsset(String sn)asset.boot_sub_assetPower the sub-asset (drone) on / off
enterRemoteDebugMode(String sn) / closeRemoteDebugMode(String sn)asset.remote_debugRemote debug mode on / off
changeAcMode(String sn, String mode)asset.change_ac_modeSet the air conditioner; mode is AIR_CONDITIONER_IDLE, _COOL, _HEAT or _DEHUMIDIFICATION

Custom commands

MethodDescription
sendCustomCommand(String sn, String componentId, String commandType, Map<String, Object> params)Every command id without a built-in method — vendor-, payload- and mission-specific commands (e.g. mission.waypoint.execute). componentId is the target's targetRef (e.g. which payload), or null

Advertise each one through getCapabilities so it can be used in Skills. See Command ID naming convention.

Capabilities and cancellation

MethodReturnsDescription
getCapabilities(String sn)CurrentCapabilitiesWhat this asset supports right now — see Capability reporting
cancelExecution(String sn, String externalExecutionId)CommandResultStop a running command you accepted earlier

Capability reporting

getCapabilities returns the device's live capability snapshot. The platform reads it to know which command ids an asset offers (built-in ones too), shows it to operators and client applications, and records each command in the Skill Registry. The default returns an empty snapshot. See Edge Adapter guide — Custom Commands and the models reference for the Capability fields.

CommandResult

CommandResult.success("Cover opened", sn);                 // done
CommandResult.success("Cover opened", tid, sn);            // done, with a transaction id
CommandResult.accepted("Mission started", executionId, sn); // running; report its outcome later
CommandResult.error("Cover is blocked", sn);               // failed
CommandResult.error("Cover is blocked", tid, sn);
CommandResult.notImplemented("Not supported", sn);         // what the defaults return

CommandResult.CommandResultType: SUCCESS, ACCEPTED, ERROR, NOT_IMPLEMENTED.

Error handling

An exception thrown by your method is turned into an error response:

ExceptionError code
IllegalArgumentException, UnsupportedOperationExceptionERROR_CODE_CLIENT
TimeoutException and everything elseERROR_CODE_SYSTEM

A returned CommandResult.error(...) is answered with ERROR_CODE_ASSET, a notImplemented(...) with ERROR_CODE_CLIENT. Prefer returning error(...) for expected failures.

EdgeAdapterServiceImpl

If your adapter extends EdgeAdapterServiceImpl instead of implementing the interface directly, it gets overloads without the sn parameter that use the configured serial number (EdgeClientConfig.getSn()): openCover(), closeCover(), startCharging(), stopCharging(), rebootAsset(), bootUpSubAsset(), bootDownSubAsset(), enterManualControl(), exitManualControl(), getCapabilities(), enableGimbalTracking(boolean), changeAcMode(String).

Was this page helpful?