Language v26.0501.2330

Auth Manager

Authentication and session management.

Login Authenticates a user and returns a session token.
Signature
func (m *AuthManager) Login(username, password string) (token string, expiresAt int64, err error)
Parameters
NameTypeNotes
usernamestring
passwordstring
Returns
NameTypeNotes
tokenstring
expiresAtint64Unix timestamp
errorerror
Example
token, expiresAt, err := client.AuthManager.Login(username, password)
Logout Invalidates a session token.
Signature
func (m *AuthManager) Logout(token string) error
Parameters
NameTypeNotes
tokenstring
Returns
NameTypeNotes
errorerror
Example
err := client.AuthManager.Logout(token)

System Manager

Device identity, hardware info, OS metadata and live metrics.

PermissionSystemService/*
GetApiVersion Returns the API version and revision running on the device.
Signature
func (s *SystemManager) GetApiVersion() (version int64, revision int64, err error)
Returns
NameTypeNotes
versionint64
revisionint64
errorerror
Example
version, revision, err := client.SystemManager.GetApiVersion()
GetApiVersionInfo Returns the API version as a formatted string.
Signature
func (s *SystemManager) GetApiVersionInfo() (string, error)
Returns
NameTypeNotes
versionstring
errorerror
Example
ver, err := client.SystemManager.GetApiVersionInfo()
GetDeviceName Returns the configured device name.
Signature
func (s *SystemManager) GetDeviceName() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
name, err := client.SystemManager.GetDeviceName()
GetSocModel Returns the SoC model identifier.
Signature
func (s *SystemManager) GetSocModel() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
model, err := client.SystemManager.GetSocModel()
GetSocVendor Returns the SoC vendor name.
Signature
func (s *SystemManager) GetSocVendor() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
vendor, err := client.SystemManager.GetSocVendor()
GetBoardModel Returns the board model identifier.
Signature
func (s *SystemManager) GetBoardModel() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
model, err := client.SystemManager.GetBoardModel()
GetBoardVendor Returns the board vendor name.
Signature
func (s *SystemManager) GetBoardVendor() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
vendor, err := client.SystemManager.GetBoardVendor()
GetHardwareVersion Returns the hardware revision string.
Signature
func (s *SystemManager) GetHardwareVersion() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
ver, err := client.SystemManager.GetHardwareVersion()
GetHardwareModel Returns the hardware model identifier.
Signature
func (s *SystemManager) GetHardwareModel() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
model, err := client.SystemManager.GetHardwareModel()
GetSystemUuid Returns the system UUID.
Signature
func (s *SystemManager) GetSystemUuid() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
uuid, err := client.SystemManager.GetSystemUuid()
GetBoardSerial Returns the board serial number.
Signature
func (s *SystemManager) GetBoardSerial() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
serial, err := client.SystemManager.GetBoardSerial()
GetCpuSerial Returns the CPU serial number.
Signature
func (s *SystemManager) GetCpuSerial() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
serial, err := client.SystemManager.GetCpuSerial()
GetMachineId Returns the machine ID.
Signature
func (s *SystemManager) GetMachineId() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
id, err := client.SystemManager.GetMachineId()
GetArchitecture Returns the CPU architecture (e.g. "arm64", "amd64").
Signature
func (s *SystemManager) GetArchitecture() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
arch, err := client.SystemManager.GetArchitecture()
GetTotalRAM Returns total RAM in bytes.
Signature
func (s *SystemManager) GetTotalRAM() (uint64, error)
Returns
NameTypeNotes
valueuint64
errorerror
Example
ram, err := client.SystemManager.GetTotalRAM()
GetCpuModel Returns the CPU model string.
Signature
func (s *SystemManager) GetCpuModel() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
model, err := client.SystemManager.GetCpuModel()
GetCpuCores Returns the number of physical CPU cores.
Signature
func (s *SystemManager) GetCpuCores() (int64, error)
Returns
NameTypeNotes
valueint64
errorerror
Example
cores, err := client.SystemManager.GetCpuCores()
GetCpuThreads Returns the number of logical CPU threads.
Signature
func (s *SystemManager) GetCpuThreads() (int64, error)
Returns
NameTypeNotes
valueint64
errorerror
Example
threads, err := client.SystemManager.GetCpuThreads()
GetCpuMinMhz Returns the minimum CPU frequency in MHz.
Signature
func (s *SystemManager) GetCpuMinMhz() (float64, error)
Returns
NameTypeNotes
valuefloat64
errorerror
Example
minMhz, err := client.SystemManager.GetCpuMinMhz()
GetCpuMaxMhz Returns the maximum CPU frequency in MHz.
Signature
func (s *SystemManager) GetCpuMaxMhz() (float64, error)
Returns
NameTypeNotes
valuefloat64
errorerror
Example
maxMhz, err := client.SystemManager.GetCpuMaxMhz()
GetOsName Returns the OS name.
Signature
func (s *SystemManager) GetOsName() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
name, err := client.SystemManager.GetOsName()
GetOsVersion Returns the OS version string.
Signature
func (s *SystemManager) GetOsVersion() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
ver, err := client.SystemManager.GetOsVersion()
GetKernelVersion Returns the kernel version string.
Signature
func (s *SystemManager) GetKernelVersion() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
ver, err := client.SystemManager.GetKernelVersion()
GetDistro Returns the Linux distribution name.
Signature
func (s *SystemManager) GetDistro() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
distro, err := client.SystemManager.GetDistro()
GetDistroVersion Returns the distribution version string.
Signature
func (s *SystemManager) GetDistroVersion() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
ver, err := client.SystemManager.GetDistroVersion()
GetRuntimeVersion Returns the Orbit runtime version.
Signature
func (s *SystemManager) GetRuntimeVersion() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
ver, err := client.SystemManager.GetRuntimeVersion()
GetOsRevision Returns the logical OS revision string.
Signature
func (s *SystemManager) GetOsRevision() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
rev, err := client.SystemManager.GetOsRevision()
GetBuildVersion Alias for GetOsRevision.
Signature
func (s *SystemManager) GetBuildVersion() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
ver, err := client.SystemManager.GetBuildVersion()
GetRuntimeBuildDate Returns the runtime image build date.
Signature
func (s *SystemManager) GetRuntimeBuildDate() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
date, err := client.SystemManager.GetRuntimeBuildDate()
GetBuildDate Alias for GetRuntimeBuildDate.
Signature
func (s *SystemManager) GetBuildDate() (string, error)
Returns
NameTypeNotes
valuestring
errorerror
Example
date, err := client.SystemManager.GetBuildDate()
GetMetrics Returns live CPU usage, RAM and storage stats.
Signature
func (s *SystemManager) GetMetrics() (*MetricsInfoResponse, error)
Returns
NameTypeNotes
*MetricsInfoResponse
errorerror
Example
metrics, err := client.SystemManager.GetMetrics()
Attach Attaches the SDK client to the running Gravity system service.
Signature
func (s *SystemManager) Attach() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.Attach()
EnableDevMode Enables developer mode on the device.
Signature
func (s *SystemManager) EnableDevMode() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.EnableDevMode()
DisableDevMode Disables developer mode on the device.
Signature
func (s *SystemManager) DisableDevMode() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.DisableDevMode()
IsDevModeEnabled Reports whether developer mode is currently enabled.
Signature
func (s *SystemManager) IsDevModeEnabled() (bool, error)
Returns
NameTypeNotes
enabledbool
errorerror
Example
ok, err := client.SystemManager.IsDevModeEnabled()
EnableSSHServer Enables the SSH server on the device.
Signature
func (s *SystemManager) EnableSSHServer() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.EnableSSHServer()
DisableSSHServer Disables the SSH server on the device.
Signature
func (s *SystemManager) DisableSSHServer() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.DisableSSHServer()
IsSSHServerEnabled Reports whether the SSH server is currently enabled.
Signature
func (s *SystemManager) IsSSHServerEnabled() (bool, error)
Returns
NameTypeNotes
enabledbool
errorerror
Example
ok, err := client.SystemManager.IsSSHServerEnabled()
EnableRebootOnFailure Enables automatic reboot when a critical failure is detected.
Signature
func (s *SystemManager) EnableRebootOnFailure() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.EnableRebootOnFailure()
DisableRebootOnFailure Disables automatic reboot on failure.
Signature
func (s *SystemManager) DisableRebootOnFailure() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.DisableRebootOnFailure()
IsRebootOnFailureEnabled Reports whether automatic reboot on failure is enabled.
Signature
func (s *SystemManager) IsRebootOnFailureEnabled() (bool, error)
Returns
NameTypeNotes
enabledbool
errorerror
Example
ok, err := client.SystemManager.IsRebootOnFailureEnabled()
AllowUntrustedApps Allows installation of apps from untrusted sources.
Signature
func (s *SystemManager) AllowUntrustedApps() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.AllowUntrustedApps()
DisallowUntrustedApps Blocks installation of apps from untrusted sources.
Signature
func (s *SystemManager) DisallowUntrustedApps() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.SystemManager.DisallowUntrustedApps()
IsUntrustedAppsAllowed Reports whether untrusted app installation is currently allowed.
Signature
func (s *SystemManager) IsUntrustedAppsAllowed() (bool, error)
Returns
NameTypeNotes
allowedbool
errorerror
Example
ok, err := client.SystemManager.IsUntrustedAppsAllowed()

Package Manager

Application package installation and management.

PermissionPackageService/*
ListInstalledPackages Returns all installed packages.
Signature
func (p *PackageManager) ListInstalledPackages() ([]*InstalledPackage, error)
Returns
NameTypeNotes
[]InstalledPackage
errorerror
Example
pkgs, err := client.PackageManager.ListInstalledPackages()
InstallPackage Uploads and installs an .orb package from a local path.
Signature
func (p *PackageManager) InstallPackage(ctx context.Context, orbPath string) error
Parameters
NameTypeNotes
ctxContext
orbPathstring
Returns
NameTypeNotes
errorerror
Example
err := client.PackageManager.InstallPackage(ctx, "/path/to/app.orb")
RemovePackage Uninstalls a package by ID.
Signature
func (p *PackageManager) RemovePackage(ctx context.Context, packageID string) error
Parameters
NameTypeNotes
ctxContext
packageIDstring
Returns
NameTypeNotes
errorerror
Example
err := client.PackageManager.RemovePackage(ctx, packageID)

Ethernet Manager

Ethernet interface configuration and status.

PermissionEthernetService/*
ListEthernetInterfaces Returns all Ethernet interfaces available on the device.
Signature
func (e *EthernetManager) ListEthernetInterfaces() ([]*EthernetLinkProperties, error)
Returns
NameTypeNotes
[]*EthernetLinkProperties
errorerror
Example
ifaces, err := client.EthernetManager.ListEthernetInterfaces()
IsEthernetConnected Reports whether the given interface has link.
Signature
func (e *EthernetManager) IsEthernetConnected(interfaceName string) (bool, error)
Parameters
NameTypeNotes
interfaceNamestring
Returns
NameTypeNotes
connectedbool
errorerror
Example
ok, err := client.EthernetManager.IsEthernetConnected("eth0")
GetEthernetLinkProperties Returns link properties (MAC, state, MTU, IP config) for an interface.
Signature
func (e *EthernetManager) GetEthernetLinkProperties(interfaceName string) (*EthernetLinkProperties, error)
Parameters
NameTypeNotes
interfaceNamestring
Returns
NameTypeNotes
*EthernetLinkProperties
errorerror
Example
props, err := client.EthernetManager.GetEthernetLinkProperties("eth0")
SetEthernetConfig Applies static IP or DHCP settings to an interface.
Signature
func (e *EthernetManager) SetEthernetConfig(
    interfaceName string, enable, dhcpEnable bool,
    ipv4Address, ipv4Gateway string, ipv4Dns []string,
) (bool, error)
Parameters
NameTypeNotes
interfaceNamestring
enablebool
dhcpEnablebool
ipv4AddressstringCIDR notation — ignored when dhcpEnable is true
ipv4Gatewaystring
ipv4Dns[]string
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.EthernetManager.SetEthernetConfig(
    "eth0", true, false,
    "192.168.1.10/24", "192.168.1.1", []string{"8.8.8.8"},
)
EnableEthernet Brings an Ethernet interface up.
Signature
func (e *EthernetManager) EnableEthernet(interfaceName string) (bool, error)
Parameters
NameTypeNotes
interfaceNamestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.EthernetManager.EnableEthernet("eth0")
DisableEthernet Brings an Ethernet interface down.
Signature
func (e *EthernetManager) DisableEthernet(interfaceName string) (bool, error)
Parameters
NameTypeNotes
interfaceNamestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.EthernetManager.DisableEthernet("eth0")

WiFi Manager

Wi-Fi interface management — client mode and access point.

PermissionWiFiService/*
General
ListInterfaces Returns all Wi-Fi interfaces on the device.
Signature
func (w *WiFiManager) ListInterfaces() ([]*WiFiLinkProperties, error)
Returns
NameTypeNotes
[]*WiFiLinkProperties
errorerror
Example
ifaces, err := client.WiFiManager.ListInterfaces()
GetLinkProperties Returns link-layer and mode properties for a Wi-Fi interface.
Signature
func (w *WiFiManager) GetLinkProperties(ifname string) (*WiFiLinkProperties, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
*WiFiLinkProperties
errorerror
Example
props, err := client.WiFiManager.GetLinkProperties("wlan0")
IsConnected Returns true if the interface has an active Wi-Fi connection.
Signature
func (w *WiFiManager) IsConnected(ifname string) (bool, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
connectedbool
errorerror
Example
ok, err := client.WiFiManager.IsConnected("wlan0")
GetMode Returns the current operating mode of the interface.
Signature
func (w *WiFiManager) GetMode(ifname string) (WiFiMode, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
modeWiFiMode
errorerror
Example
mode, err := client.WiFiManager.GetMode("wlan0")
SetModeClient Switches the interface to client (station) mode.
Signature
func (w *WiFiManager) SetModeClient(ifname string) (bool, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.WiFiManager.SetModeClient("wlan0")
Client
SetClientConfig Configures and stores Wi-Fi client settings for the interface.
Signature
func (w *WiFiManager) SetClientConfig(
    ifname, ssid, password, security string,
    dhcpEnable bool,
    ipv4Address, ipv4Gateway string,
    ipv4Dns []string,
) (bool, error)
Parameters
NameTypeNotes
ifnamestring
ssidstring
passwordstring
securitystring"none" | "wpa2" | "wpa3" | "wpa2-wpa3"
dhcpEnablebool
ipv4AddressstringCIDR — ignored when dhcpEnable is true
ipv4Gatewaystring
ipv4Dns[]string
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.WiFiManager.SetClientConfig(
    "wlan0", "MySSID", "pass", "wpa2",
    true, "", "", nil,
)
GetClientProperties Returns IP and radio properties for the current client connection.
Signature
func (w *WiFiManager) GetClientProperties(ifname string) (*ClientProperties, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
*ClientProperties
errorerror
Example
props, err := client.WiFiManager.GetClientProperties("wlan0")
Connect Brings up the Wi-Fi connection using the previously stored client config.
Signature
func (w *WiFiManager) Connect(ifname string) (bool, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.WiFiManager.Connect("wlan0")
Disconnect Disconnects from the current Wi-Fi network.
Signature
func (w *WiFiManager) Disconnect(ifname string) (bool, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.WiFiManager.Disconnect("wlan0")
Access Point
StartAP Configures and starts an access point on the given interface.
Signature
func (w *WiFiManager) StartAP(ifname, ssid, password, band string, channel int32) (bool, error)
Parameters
NameTypeNotes
ifnamestring
ssidstring
passwordstring
bandstring"2.4GHz" or "5GHz"
channelint320 = auto
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.WiFiManager.StartAP("wlan0", "MyAP", "pass", "5GHz", 0)
StopAP Stops the access point on the given interface.
Signature
func (w *WiFiManager) StopAP(ifname string) (bool, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.WiFiManager.StopAP("wlan0")
GetAPProperties Returns properties of the active access point.
Signature
func (w *WiFiManager) GetAPProperties(ifname string) (*APProperties, error)
Parameters
NameTypeNotes
ifnamestring
Returns
NameTypeNotes
*APProperties
errorerror
Example
props, err := client.WiFiManager.GetAPProperties("wlan0")
Scan
Scan Scans for nearby Wi-Fi networks. forceRescan=true triggers a new hardware scan (~3 s).
Signature
func (w *WiFiManager) Scan(ifname string, forceRescan bool) ([]*ScannedNetwork, error)
Parameters
NameTypeNotes
ifnamestring
forceRescanbool
Returns
NameTypeNotes
[]*ScannedNetwork
errorerror
Example
nets, err := client.WiFiManager.Scan("wlan0", true)

GPIO Manager

General-purpose I/O pin control.

PermissionGpioService/*
ListPins Returns all GPIO pins available on the device.
Signature
func (m *GpioManager) ListPins() ([]*GpioPin, error)
Returns
NameTypeNotes
[]GpioPin
errorerror
Example
pins, err := client.GpioManager.ListPins()
GetDirection Reads the current direction of a pin.
Signature
func (m *GpioManager) GetDirection(pin *GpioPin) (GpioDirection, error)
Parameters
NameTypeNotes
pin*GpioPin
Returns
NameTypeNotes
dirGpioDirection
errorerror
Example
dir, err := client.GpioManager.GetDirection(pin)
SetDirection Configures a pin as input or output.
Signature
func (m *GpioManager) SetDirection(pin *GpioPin, dir GpioDirection) error
Parameters
NameTypeNotes
pin*GpioPin
dirGpioDirectionGPIO_DIR_IN | GPIO_DIR_OUT
Returns
NameTypeNotes
errorerror
Example
err := client.GpioManager.SetDirection(pin, GPIO_DIR_OUT)
GetLevel Reads the current logic level of a pin.
Signature
func (m *GpioManager) GetLevel(pin *GpioPin) (GpioLevel, error)
Parameters
NameTypeNotes
pin*GpioPin
Returns
NameTypeNotes
levelGpioLevel
errorerror
Example
level, err := client.GpioManager.GetLevel(pin)
SetLevel Sets the logic level of an output pin.
Signature
func (m *GpioManager) SetLevel(pin *GpioPin, level GpioLevel) error
Parameters
NameTypeNotes
pin*GpioPin
levelGpioLevelGPIO_LEVEL_LOW | GPIO_LEVEL_HIGH
Returns
NameTypeNotes
errorerror
Example
err := client.GpioManager.SetLevel(pin, GPIO_LEVEL_HIGH)

PWM Manager

PWM channel configuration and control.

PermissionPwmService/*
ListChannels Returns all available PWM channels.
Signature
func (m *PwmManager) ListChannels() ([]*PwmChannel, error)
Returns
NameTypeNotes
[]PwmChannel{ Channel, Name }
errorerror
Example
channels, err := client.PwmManager.ListChannels()
GetProperties Reads the current configuration of a PWM channel.
Signature
func (m *PwmManager) GetProperties(ch *PwmChannel) (*PwmProperties, error)
Parameters
NameTypeNotes
ch*PwmChannel
Returns
NameTypeNotes
props*PwmProperties{ Channel, Enabled, DutyCycle, FrequencyHz }
errorerror
Example
props, err := client.PwmManager.GetProperties(ch)
SetPwm Configures and starts a PWM output on the given channel.
Signature
func (m *PwmManager) SetPwm(ch *PwmChannel, dutyCycle, frequencyHz float64) error
Parameters
NameTypeNotes
ch*PwmChannel
dutyCyclefloat640.0–1.0
frequencyHzfloat64
Returns
NameTypeNotes
errorerror
Example
err := client.PwmManager.SetPwm(ch, 0.5, 1000.0)
StopPwm Disables PWM output on the given channel.
Signature
func (m *PwmManager) StopPwm(ch *PwmChannel) error
Parameters
NameTypeNotes
ch*PwmChannel
Returns
NameTypeNotes
errorerror
Example
err := client.PwmManager.StopPwm(ch)

UART Manager

Serial port (UART) communication. Open returns a UartPort handle — all port operations are called on the handle.

PermissionUartService/*
UartManager
ListPorts Returns the names of all available UART ports.
Signature
func (m *UartManager) ListPorts() ([]string, error)
Returns
NameTypeNotes
[]string
errorerror
Example
ports, err := client.UartManager.ListPorts()
Open Opens and configures a UART port. Returns a UartPort handle for all subsequent operations.
Signature
func (m *UartManager) Open(cfg UartConfig) (*UartPort, error)
Parameters
NameTypeNotes
cfgUartConfig
Returns
NameTypeNotes
*UartPort
errorerror
Example
port, err := client.UartManager.Open(UartConfig{
    Port:     "ttyS0",
    Baudrate: 115200,
    DataBits: 8,
    Parity:   UartParityNone,
    StopBits: UartStopBits1,
})
UartPort
Close Closes the port.
Signature
func (p *UartPort) Close() error
Returns
NameTypeNotes
errorerror
Example
err := port.Close()
GetConfig Returns the current configuration of the port.
Signature
func (p *UartPort) GetConfig() (*UartConfig, error)
Returns
NameTypeNotes
*UartConfig
errorerror
Example
cfg, err := port.GetConfig()
Write Writes raw bytes to the port. Returns the number of bytes written.
Signature
func (p *UartPort) Write(data []byte) (int, error)
Parameters
NameTypeNotes
data[]byte
Returns
NameTypeNotes
bytesWrittenint
errorerror
Example
n, err := port.Write([]byte("hello"))
Listen Streams incoming bytes, calling onChunk for each chunk. Blocks until ctx is cancelled or the stream ends.
Signature
func (p *UartPort) Listen(ctx context.Context, maxChunkSize int, onChunk func([]byte)) error
Parameters
NameTypeNotes
ctxContext
maxChunkSizeint
onChunkfunc([]byte)
Returns
NameTypeNotes
errorerror
Example
err := port.Listen(ctx, 256, func(b []byte) {
    fmt.Printf("rx: %q
", b)
})
ListenAsync Like Listen but returns a channel instead of a callback. Channel is closed when the stream ends or ctx is cancelled.
Signature
func (p *UartPort) ListenAsync(ctx context.Context, maxChunkSize int) (<-chan []byte, error)
Parameters
NameTypeNotes
ctxContext
maxChunkSizeint
Returns
NameTypeNotes
<-chan []byte
errorerror
Example
ch, err := port.ListenAsync(ctx, 256)
for b := range ch {
    fmt.Printf("rx: %q
", b)
}

I2C Manager

I²C bus discovery and data transfer.

PermissionI2cService/*
I2CManager
ListBuses Returns the indices of all available I²C buses.
Signature
func (m *I2CManager) ListBuses() ([]uint32, error)
Returns
NameTypeNotes
[]uint32
errorerror
Example
buses, err := client.I2CManager.ListBuses()
Open Configures the bus and returns a handle for all subsequent operations.
Signature
func (m *I2CManager) Open(bus uint32, clockHz uint32, tenBitAddr bool, clockStretching bool) (*I2CBus, error)
Parameters
NameTypeNotes
busuint32
clockHzuint32
tenBitAddrbool
clockStretchingbool
Returns
NameTypeNotes
*I2CBusI2CBus
errorerror
Example
b, err := client.I2CManager.Open(1, 400000, false, false)
I2CBus
Scan Probes all 7-bit addresses (0x03–0x77) and returns those that respond.
Signature
func (b *I2CBus) Scan() ([]uint32, error)
Returns
NameTypeNotes
[]uint32responding addresses
errorerror
Example
addrs, err := b.Scan()
GetConfig Returns the current configuration of the bus.
Signature
func (b *I2CBus) GetConfig() (I2CConfig, error)
Returns
NameTypeNotes
cfgI2CConfig
errorerror
Example
cfg, err := b.GetConfig()
Transfer Performs a write, read, or write-then-read transaction. Pass nil data for read-only; 0 readLen for write-only.
Signature
func (b *I2CBus) Transfer(addr uint32, data []byte, readLen uint32, flags uint32) ([]byte, error)
Parameters
NameTypeNotes
addruint327-bit device address (e.g. 0x48)
data[]bytebytes to write (nil for read-only)
readLenuint32bytes to read back (0 for write-only)
flagsuint32i2c_msg flags (0 for most uses)
Returns
NameTypeNotes
[]bytereceived bytes (nil for write-only)
errorerror
Example
data, err := b.Transfer(0x48, []byte{0x00}, 2, 0)

SPI Manager

SPI bus configuration and full-duplex transfer.

PermissionSpiService/*
SpiManager
ListDevices Returns available SPI device names (e.g. "spidev0.0").
Signature
func (m *SpiManager) ListDevices() ([]string, error)
Returns
NameTypeNotes
[]string
errorerror
Example
devices, err := client.SpiManager.ListDevices()
Open Configures the SPI device at (bus, cs) and returns a handle for all subsequent operations.
Signature
func (m *SpiManager) Open(bus, cs uint32, maxSpeedHz, bitsPerWord uint32, mode int, lsbFirst bool) (*SpiDevice, error)
Parameters
NameTypeNotes
busuint32
csuint32Chip select index
maxSpeedHzuint32
bitsPerWorduint32
modeint0–3 (CPOL/CPHA)
lsbFirstbool
Returns
NameTypeNotes
*SpiDeviceSpiDevice
errorerror
Example
dev, err := client.SpiManager.Open(0, 0, 1000000, 8, 0, false)
SpiDevice
GetConfig Returns the current configuration of the device.
Signature
func (d *SpiDevice) GetConfig() (*SpiConfig, error)
Returns
NameTypeNotes
*SpiConfigSpiConfig
errorerror
Example
cfg, err := dev.GetConfig()
Transfer Performs a full-duplex SPI transfer. Pass readLength=0 for write-only; when smaller than len(dataOut), the last readLength bytes are returned.
Signature
func (d *SpiDevice) Transfer(dataOut []byte, readLength uint32) ([]byte, error)
Parameters
NameTypeNotes
dataOut[]byte
readLengthuint320 = write-only
Returns
NameTypeNotes
[]bytereceived MISO bytes
errorerror
Example
rx, err := dev.Transfer(txData, uint32(len(txData)))

Camera Manager

V4L2 camera capture and streaming.

PermissionCameraService/*
ListDevices Returns all V4L2 video devices available on the system.
Signature
func (m *CameraManager) ListDevices(ctx context.Context) ([]*CameraDeviceInfo, error)
Parameters
NameTypeNotes
ctxContext
Returns
NameTypeNotes
[]*CameraDeviceInfo
errorerror
Example
devices, err := client.CameraManager.ListDevices(ctx)
GetDeviceInfo Returns metadata (driver, card, formats, resolutions) for a specific camera device.
Signature
func (m *CameraManager) GetDeviceInfo(ctx context.Context, deviceID string) (*CameraDeviceInfo, error)
Parameters
NameTypeNotes
ctxContext
deviceIDstringe.g. "/dev/video0"
Returns
NameTypeNotes
*CameraDeviceInfo
errorerror
Example
info, err := client.CameraManager.GetDeviceInfo(ctx, "/dev/video0")
LockCamera Acquires an exclusive lock on a camera for a given client ID. Must be called before CaptureImage or StreamFrames.
Signature
func (m *CameraManager) LockCamera(ctx context.Context, deviceID, clientID string) error
Parameters
NameTypeNotes
ctxContext
deviceIDstring
clientIDstring
Returns
NameTypeNotes
errorerror
Example
err := client.CameraManager.LockCamera(ctx, "/dev/video0", "myapp")
UnlockCamera Releases the lock obtained with LockCamera.
Signature
func (m *CameraManager) UnlockCamera(ctx context.Context, deviceID, clientID string) error
Parameters
NameTypeNotes
ctxContext
deviceIDstring
clientIDstring
Returns
NameTypeNotes
errorerror
Example
err := client.CameraManager.UnlockCamera(ctx, "/dev/video0", "myapp")
CaptureImage Captures a single frame from a camera device. Requires LockCamera first.
Signature
func (m *CameraManager) CaptureImage(ctx context.Context, deviceID string, width, height int32, format string) (*CaptureImageResult, error)
Parameters
NameTypeNotes
ctxContext
deviceIDstring
widthint32
heightint32
formatstring"mjpeg" or "yuyv"
Returns
NameTypeNotes
*CaptureImageResult
errorerror
Example
img, err := client.CameraManager.CaptureImage(ctx, "/dev/video0", 1280, 720, "mjpeg")
StreamFrames Opens a server-streaming frame stream at the requested FPS and resolution. Read from the stream until io.EOF or error.
Signature
func (m *CameraManager) StreamFrames(ctx context.Context, req *StreamFramesRequest) (ServerStream[Frame], error)
Parameters
NameTypeNotes
ctxContext
req*StreamFramesRequest
Returns
NameTypeNotes
ServerStream[Frame]
errorerror
Example
stream, err := client.CameraManager.StreamFrames(ctx, &StreamFramesRequest{
    DeviceId: "/dev/video0", Fps: 30, Width: 1280, Height: 720,
})
for {
    frame, err := stream.Recv()
    if err == io.EOF { break }
}

AI Manager

On-device AI model management and inference. LoadModel / UploadAndLoadModel return an AIModel handle — inference and lifecycle operations are called on the handle.

PermissionAiService/*
AIManager
ListModels Returns metadata for all currently loaded models.
Signature
func (m *AIManager) ListModels() ([]*ModelInfo, error)
Returns
NameTypeNotes
[]*ModelInfo
errorerror
Example
models, err := client.AIManager.ListModels()
LoadModel Loads a model already present on the device filesystem. Returns an AIModel handle.
Signature
func (m *AIManager) LoadModel(modelID, modelPath string, backend ModelBackend, execution ExecutionMode) (*AIModel, error)
Parameters
NameTypeNotes
modelIDstring
modelPathstringAbsolute path on the device
backendModelBackend
executionExecutionMode
Returns
NameTypeNotes
*AIModel
errorerror
Example
model, err := client.AIManager.LoadModel(
    "detector", "/models/yolo.onnx",
    ModelBackend_ONNX, ExecutionMode_EXEC_CPU,
)
UploadAndLoadModel Streams a local model file to the device in chunks then loads it. Returns an AIModel handle.
Signature
func (m *AIManager) UploadAndLoadModel(modelID, localPath string, backend ModelBackend, execution ExecutionMode) (*AIModel, error)
Parameters
NameTypeNotes
modelIDstring
localPathstringPath to the model file on the host
backendModelBackend
executionExecutionMode
Returns
NameTypeNotes
*AIModel
errorerror
Example
model, err := client.AIManager.UploadAndLoadModel(
    "detector", "./yolo.onnx",
    ModelBackend_ONNX, ExecutionMode_EXEC_CPU,
)
AIModel
Unload Frees the model from the inference backend.
Signature
func (m *AIModel) Unload() error
Returns
NameTypeNotes
errorerror
Example
err := model.Unload()
IsLoaded Returns whether the model is loaded and its tensor schema.
Signature
func (m *AIModel) IsLoaded() (*IsModelLoadedResponse, error)
Returns
NameTypeNotes
*IsModelLoadedResponse
errorerror
Example
r, err := model.IsLoaded()
Infer Runs a single synchronous forward pass. inputShape nil uses the schema from load.
Signature
func (m *AIModel) Infer(ctx context.Context, inputData []byte, inputShape []int32, dtype TensorDataType) (*InferResponse, error)
Parameters
NameTypeNotes
ctxContext
inputData[]byteRaw little-endian bytes
inputShape[]int32nil = use schema from LoadModel
dtypeTensorDataType
Returns
NameTypeNotes
*InferResponse
errorerror
Example
resp, err := model.Infer(ctx, inputData, []int32{1, 3, 640, 640}, TensorDataType_TENSOR_FLOAT32)
StreamInfer Opens a bidirectional inference stream. Returns an AIInferStream handle.
Signature
func (m *AIModel) StreamInfer(ctx context.Context) (*AIInferStream, error)
Parameters
NameTypeNotes
ctxContext
Returns
NameTypeNotes
*AIInferStream
errorerror
Example
s, err := model.StreamInfer(ctx)
AIInferStream
Send Submits an inference request on the stream.
Signature
func (s *AIInferStream) Send(inputData []byte, inputShape []int32, dtype TensorDataType) error
Parameters
NameTypeNotes
inputData[]byte
inputShape[]int32
dtypeTensorDataType
Returns
NameTypeNotes
errorerror
Example
err := s.Send(inputData, nil, TensorDataType_TENSOR_FLOAT32)
Recv Reads the next inference result. Returns io.EOF when the server closes the stream.
Signature
func (s *AIInferStream) Recv() (*InferResponse, error)
Returns
NameTypeNotes
*InferResponse
errorerror
Example
resp, err := s.Recv()
Close Signals the end of the send side of the stream.
Signature
func (s *AIInferStream) Close() error
Returns
NameTypeNotes
errorerror
Example
err := s.Close()

Firewall Manager

Network firewall zone and rule management.

PermissionFirewallService/*
Zones
ListZones Returns all configured firewall zones.
Signature
func (f *FirewallManager) ListZones() ([]*ZoneRequest, error)
Returns
NameTypeNotes
[]*ZoneRequest
errorerror
Example
zones, err := client.FirewallManager.ListZones()
AddZone Creates a new firewall zone.
Signature
func (f *FirewallManager) AddZone(name string, interfaces []string, inputPolicy, outputPolicy ZonePolicy, masquerade bool) (bool, error)
Parameters
NameTypeNotes
namestring
interfaces[]string
inputPolicyZonePolicy
outputPolicyZonePolicy
masqueradebool
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.FirewallManager.AddZone("lan", []string{"eth0"}, ZonePolicy_ACCEPT, ZonePolicy_ACCEPT, false)
RemoveZone Deletes a firewall zone by name.
Signature
func (f *FirewallManager) RemoveZone(name string) (bool, error)
Parameters
NameTypeNotes
namestring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.FirewallManager.RemoveZone("lan")
Rules
ListRules Returns all configured firewall rules.
Signature
func (f *FirewallManager) ListRules() ([]*FirewallRule, error)
Returns
NameTypeNotes
[]*FirewallRule
errorerror
Example
rules, err := client.FirewallManager.ListRules()
AddRule Adds a traffic rule between two zones.
Signature
func (f *FirewallManager) AddRule(srcZone, dstZone string, protocol FirewallProtocol, srcIP string, destPort int32, action ZonePolicy, comment string) (bool, error)
Parameters
NameTypeNotes
srcZonestring
dstZonestring
protocolFirewallProtocolPROTO_ANY | PROTO_TCP | PROTO_UDP | PROTO_ICMP
srcIPstringCIDR or empty for any
destPortint320 for any
actionZonePolicy
commentstring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.FirewallManager.AddRule("lan", "wan", FirewallProtocol_TCP, "", 443, ZonePolicy_ACCEPT, "allow HTTPS")
RemoveRule Removes a traffic rule by its ID.
Signature
func (f *FirewallManager) RemoveRule(id string) (bool, error)
Parameters
NameTypeNotes
idstring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.FirewallManager.RemoveRule(ruleID)
FlushRules Removes all traffic rules (zones are preserved).
Signature
func (f *FirewallManager) FlushRules() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.FirewallManager.FlushRules()
ApplyFirewall Commits all pending zone and rule changes to the active firewall.
Signature
func (f *FirewallManager) ApplyFirewall() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.FirewallManager.ApplyFirewall()

VPN Manager

VPN profile management and connection control.

PermissionVpnService/*
Capabilities
GetCapabilities Reports which VPN providers are available on the device.
Signature
func (v *VPNManager) GetCapabilities() (*VpnCapabilities, error)
Returns
NameTypeNotes
*VpnCapabilities
errorerror
Example
caps, err := client.VPNManager.GetCapabilities()
Profiles
ListProfiles Returns all saved VPN profiles (config data not included).
Signature
func (v *VPNManager) ListProfiles() ([]*VpnProfile, error)
Returns
NameTypeNotes
[]*VpnProfile
errorerror
Example
profiles, err := client.VPNManager.ListProfiles()
ApplyProfile Creates or updates a VPN profile. If ProfileId is empty the server assigns one.
Signature
func (v *VPNManager) ApplyProfile(profile *VpnProfile, connectAfterApply bool) (string, error)
Parameters
NameTypeNotes
profile*VpnProfile
connectAfterApplybool
Returns
NameTypeNotes
profileIDstring
errorerror
Example
id, err := client.VPNManager.ApplyProfile(profile, false)
ApplyWireGuard Convenience wrapper — creates or updates a WireGuard profile from a raw .conf file.
Signature
func (v *VPNManager) ApplyWireGuard(displayName string, configData []byte, autoConnect bool) (string, error)
Parameters
NameTypeNotes
displayNamestring
configData[]byteRaw WireGuard .conf content
autoConnectbool
Returns
NameTypeNotes
profileIDstring
errorerror
Example
id, err := client.VPNManager.ApplyWireGuard("office", confBytes, true)
ApplyOpenVPN Convenience wrapper — creates or updates an OpenVPN profile from a raw .ovpn file.
Signature
func (v *VPNManager) ApplyOpenVPN(displayName string, configData []byte, autoConnect bool) (string, error)
Parameters
NameTypeNotes
displayNamestring
configData[]byteRaw .ovpn file content
autoConnectbool
Returns
NameTypeNotes
profileIDstring
errorerror
Example
id, err := client.VPNManager.ApplyOpenVPN("corp", ovpnBytes, false)
RemoveProfile Deletes a VPN profile by ID (disconnects first if active).
Signature
func (v *VPNManager) RemoveProfile(profileID string) (bool, error)
Parameters
NameTypeNotes
profileIDstring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.VPNManager.RemoveProfile(profileID)
Connection
Connect Activates a VPN profile and returns the session ID. The tunnel comes up asynchronously — use WatchEvents or GetStatus to track.
Signature
func (v *VPNManager) Connect(profileID string) (string, error)
Parameters
NameTypeNotes
profileIDstring
Returns
NameTypeNotes
sessionIDstring
errorerror
Example
sessionID, err := client.VPNManager.Connect(profileID)
Disconnect Tears down the active tunnel for the given profile. Pass empty string to disconnect the currently active profile.
Signature
func (v *VPNManager) Disconnect(profileID string) (bool, error)
Parameters
NameTypeNotes
profileIDstring
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.VPNManager.Disconnect(profileID)
Status
GetStatus Returns the current active session and provider details. Session is nil when no tunnel is active.
Signature
func (v *VPNManager) GetStatus() (*Session, string, error)
Returns
NameTypeNotes
*Session
providerDetailsstring
errorerror
Example
sess, details, err := client.VPNManager.GetStatus()
ListSessions Returns all active sessions (at most one in the current implementation).
Signature
func (v *VPNManager) ListSessions() ([]*Session, error)
Returns
NameTypeNotes
[]*Session
errorerror
Example
sessions, err := client.VPNManager.ListSessions()
IsConnected Reports whether there is an active tunnel in state UP.
Signature
func (v *VPNManager) IsConnected() (bool, error)
Returns
NameTypeNotes
bool
errorerror
Example
connected, err := client.VPNManager.IsConnected()
WatchEvents Streams VPN tunnel events. Blocks until ctx is cancelled or the server closes the connection. Pass empty profileID to receive events from all profiles.
Signature
func (v *VPNManager) WatchEvents(ctx context.Context, profileID string, handler func(*VPNEvent)) error
Parameters
NameTypeNotes
ctxContext
profileIDstringempty = all profiles
handlerfunc(*VPNEvent)
Returns
NameTypeNotes
errorerror
Example
err := client.VPNManager.WatchEvents(ctx, "", func(e *VPNEvent) {
    fmt.Println(e.GetState())
})

App Hub Manager

Service registration and HTTP routing via the Orbit app hub.

PermissionAppHubService/*
Registration
RegisterWebUI Convenience wrapper — registers a local HTTP server with a TCP health-check. Prefer this for the common case.
Signature
func (m *AppHubManager) RegisterWebUI(addr, route string) error
Parameters
NameTypeNotes
addrstring"host:port" or ":port"
routestringPath prefix to proxy, e.g. "/myapp"
Returns
NameTypeNotes
errorerror
Example
err := client.AppHubManager.RegisterWebUI("127.0.0.1:9033", "/myapp")
RegisterService Announces the app's HTTP server to the portal with full control over routes and health check.
Signature
func (m *AppHubManager) RegisterService(req *RegisterServiceRequest) error
Parameters
NameTypeNotes
req*RegisterServiceRequest
Returns
NameTypeNotes
errorerror
Example
err := client.AppHubManager.RegisterService(req)
UnregisterService Removes the app's registration from the portal. Safe to call on shutdown.
Signature
func (m *AppHubManager) UnregisterService() error
Returns
NameTypeNotes
errorerror
Example
err := client.AppHubManager.UnregisterService()
Discovery
GetService Returns registration details for a given service ID.
Signature
func (m *AppHubManager) GetService(serviceID string) (*Service, error)
Parameters
NameTypeNotes
serviceIDstring
Returns
NameTypeNotes
*Service
errorerror
Example
svc, err := client.AppHubManager.GetService("my-service-id")
ListServices Returns all services currently registered in the portal.
Signature
func (m *AppHubManager) ListServices() ([]*Service, error)
Returns
NameTypeNotes
[]*Service
errorerror
Example
services, err := client.AppHubManager.ListServices()
Routes
AddRoute Adds an extra path prefix to the already-registered service.
Signature
func (m *AppHubManager) AddRoute(path string) error
Parameters
NameTypeNotes
pathstring
Returns
NameTypeNotes
errorerror
Example
err := client.AppHubManager.AddRoute("/api/v2")
RemoveRoute Removes a path prefix from the registered service.
Signature
func (m *AppHubManager) RemoveRoute(path string) error
Parameters
NameTypeNotes
pathstring
Returns
NameTypeNotes
errorerror
Example
err := client.AppHubManager.RemoveRoute("/api/v1")
GetRoutingTable Returns all current proxy routing entries.
Signature
func (m *AppHubManager) GetRoutingTable() ([]*RoutingEntry, error)
Returns
NameTypeNotes
[]*RoutingEntry
errorerror
Example
entries, err := client.AppHubManager.GetRoutingTable()
Events
WatchServices Streams service lifecycle events. Blocks until ctx is cancelled or the server closes.
Signature
func (m *AppHubManager) WatchServices(ctx context.Context, handler func(*ServiceEvent)) error
Parameters
NameTypeNotes
ctxContext
handlerfunc(*ServiceEvent)
Returns
NameTypeNotes
errorerror
Example
err := client.AppHubManager.WatchServices(ctx, func(e *ServiceEvent) {
    fmt.Println(e.GetType(), e.GetService().GetServiceId())
})

Event Manager

System-wide event bus.

PermissionEventService/*
Subscribe Subscribes to system events. Calls handler for each event. Blocks until context is cancelled.
Signature
func (e *EventManager) Subscribe(ctx context.Context, handler func(*Event), types ...EventType) error
Parameters
NameTypeNotes
ctxContext
handlerfunc(*Event)
types...EventTypeOmit to receive all events (EVENT_APP_INSTALLED, EVENT_APP_REMOVED, EVENT_APP_STARTED, etc.)
Returns
NameTypeNotes
errorerror
Example
err := client.EventManager.Subscribe(ctx, func(e *Event) {
    fmt.Println(e.Type, e.Payload)
}, client.EVENT_APP_STARTED)

Development Manager

Live log streaming from running applications.

PermissionDevelopmentService/*
SubscribeLogs Streams log entries matching the given filter. Blocks until context is cancelled.
Signature
func (d *DevelopmentManager) SubscribeLogs(ctx context.Context, app string, tag string, level LogLevel, onEntry func(LogEntry)) error
Parameters
NameTypeNotes
ctxContext
appstringapp name filter (empty = all)
tagstringtag filter (empty = all)
levelLogLevelminimum log level (LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL)
onEntryfunc(LogEntry)
Returns
NameTypeNotes
errorerror
Example
err := client.DevelopmentManager.SubscribeLogs(ctx, "myapp", "", client.LOG_LEVEL_INFO, func(e LogEntry) {
    fmt.Println(e.Timestamp, e.Message)
})
SubscribeLogsAsync Starts SubscribeLogs in a goroutine with automatic reconnection. Returns a channel.
Signature
func (d *DevelopmentManager) SubscribeLogsAsync(ctx context.Context, app string, tag string, level LogLevel) <-chan LogEntry
Parameters
NameTypeNotes
ctxContext
appstringapp name filter (empty = all)
tagstringtag filter (empty = all)
levelLogLevelminimum log level (LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL)
Returns
NameTypeNotes
<-chan LogEntrychan
errorerror
Example
ch := client.DevelopmentManager.SubscribeLogsAsync(ctx, "myapp", "", client.LOG_LEVEL_INFO)

Update Manager

OTA firmware update and factory reset.

PermissionUpdateService/*
Update Sends a .orbit system image to the device to perform an OS update.
Signature
func (u *UpdateManager) Update(ctx context.Context, orbitPath string) error
Parameters
NameTypeNotes
ctxContext
orbitPathstring
Returns
NameTypeNotes
errorerror
Example
err := client.UpdateManager.Update(ctx, "/path/to/update.orbit")
FactoryReset Performs a factory reset, erasing all user data.
Signature
func (u *UpdateManager) FactoryReset() (bool, error)
Returns
NameTypeNotes
okbool
errorerror
Example
ok, err := client.UpdateManager.FactoryReset()

Power Manager

Device power control.

PermissionPowerService/*
Reboot Reboots the device.
Signature
func (p *PowerManager) Reboot(force bool, reason string) (*PowerResult, error)
Parameters
NameTypeNotes
forcebool
reasonstring
Returns
NameTypeNotes
*PowerResult{ Success, Message }
errorerror
Example
res, err := client.PowerManager.Reboot(false, "update")
Shutdown Shuts down the device.
Signature
func (p *PowerManager) Shutdown(force bool, reason string) (*PowerResult, error)
Parameters
NameTypeNotes
forcebool
reasonstring
Returns
NameTypeNotes
*PowerResult{ Success, Message }
errorerror
Example
res, err := client.PowerManager.Shutdown(false, "maintenance")

Types

Complex objects returned or accepted by the SDK methods.

GpioPin Identifies a GPIO line by chip index and line offset.
Fields
FieldTypeDescription
NamestringHuman-readable pin name (e.g. "GPIO17", "PWM0_OUT")
Numberint32Line offset within the chip
ChipNumberint32Chip index (0 = /dev/gpiochip0)
GpioDirection GPIO pin direction enum.
Fields
FieldTypeDescription
GPIO_DIR_OUT0Output
GPIO_DIR_IN1Input
GpioLevel GPIO pin logic level enum.
Fields
FieldTypeDescription
GPIO_LEVEL_LOW0
GPIO_LEVEL_HIGH1
UartConfig Configuration used to open a UART port.
Fields
FieldTypeDescription
PortstringPort name (e.g. "ttyS0", "ttyAMA0")
BaudrateintBaud rate (e.g. 9600, 115200)
DataBitsint5, 6, 7 or 8
ParityUartParityNone / Even / Odd
StopBitsUartStopBits1 or 2 stop bits
FlowControlUartFlowControlNone / Hardware (RTS/CTS) / Software (XON/XOFF)
UartParity Parity mode for a UART port.
Fields
FieldTypeDescription
UartParityNone0No parity
UartParityEven1Even parity
UartParityOdd2Odd parity
UartStopBits Number of stop bits for a UART port.
Fields
FieldTypeDescription
UartStopBits101 stop bit
UartStopBits212 stop bits
UartFlowControl Flow control mode for a UART port.
Fields
FieldTypeDescription
UartFlowNone0No flow control
UartFlowHardware1Hardware flow control (RTS/CTS)
UartFlowSoftware2Software flow control (XON/XOFF)
I2CConfig I²C bus configuration as returned by I2CBus.GetConfig().
Fields
FieldTypeDescription
Busuint32
ClockHzuint32
TenBitAddrbool
ClockStretchingbool
I2CBus Handle to a specific I²C bus returned by I2CManager.Open().
Fields
FieldTypeDescription
(bus number stored internally)
SpiConfig SPI device configuration as returned by SpiDevice.GetConfig().
Fields
FieldTypeDescription
Busuint32
ChipSelectuint32
MaxSpeedHzuint32
BitsPerWorduint32
Modeint0–3 (CPOL/CPHA)
LSBFirstbool
SpiDevice Handle to a configured SPI device (bus + chip select) returned by SpiManager.Open().
Fields
FieldTypeDescription
(bus + cs stored internally)
MetricsInfoResponse Response returned by SystemManager.GetMetrics.
Fields
FieldTypeDescription
Metrics*MetricsInfoSystem metrics snapshot
Error*ErrorInfoNon-nil when the request failed
MetricsInfo Full snapshot of system metrics at the time of the call.
Fields
FieldTypeDescription
SysUptime*MetricsInfo_SysUptimeSystem uptime and load
CpuUsagefloat64Overall CPU usage (0–100 %)
CpuCorePercent[]float64Per-core CPU usage (0–100 %)
MemoryUsagefloat64Memory usage percentage
SocThermalfloat64SoC temperature (°C)
CpuStats*MetricsInfo_CpuStatsCPU context-switch and interrupt counters
CpuFreq*MetricsInfo_CpuFreqCPU frequency info (MHz)
VirtualMemory*MetricsInfo_VirtualMemoryDetailed memory breakdown
DiskUsagemap[string]*MetricsInfo_DiskUsageDisk usage per mount point
DiskIoCounters*MetricsInfo_DiskIoCountersDisk I/O counters
Network*MetricsInfo_NetworkNetwork I/O counters
SensorsTemperaturesint32Sensor temperature reading
MetricsInfo_SysUptime System uptime and load average.
Fields
FieldTypeDescription
TimestringCurrent system time string
Uptimeint64Uptime in seconds
Usersint32Number of logged-in users
LoadAverage[]float641-min, 5-min, 15-min load averages
MetricsInfo_CpuStats CPU context-switch and interrupt counters since boot.
Fields
FieldTypeDescription
CtxSwitchesint64Total context switches
Interruptsint64Total hardware interrupts
SoftInterruptsint64Total software interrupts
Syscallsint64Total system calls
MetricsInfo_CpuFreq CPU frequency information in MHz.
Fields
FieldTypeDescription
Currentfloat64Current CPU frequency (MHz)
Minfloat64Minimum CPU frequency (MHz)
Maxfloat64Maximum CPU frequency (MHz)
MetricsInfo_VirtualMemory Detailed virtual memory breakdown (all sizes in bytes).
Fields
FieldTypeDescription
Totalint64Total installed RAM (bytes)
Availableint64Available memory (bytes)
Percentfloat64Usage percentage
Usedint64Used memory (bytes)
Freeint64Free memory (bytes)
Activeint64Active memory (bytes)
Inactiveint64Inactive memory (bytes)
Buffersint64Buffer cache (bytes)
Cachedint64Page cache (bytes)
Sharedint64Shared memory (bytes)
Slabint64Kernel slab cache (bytes)
MetricsInfo_DiskUsage Disk usage for a single mount point (all sizes in bytes).
Fields
FieldTypeDescription
Totalint64Total disk size (bytes)
Usedint64Used space (bytes)
Freeint64Free space (bytes)
Percentfloat64Usage percentage
MetricsInfo_DiskIoCounters Disk I/O counters since boot.
Fields
FieldTypeDescription
ReadCountint64Number of reads
WriteCountint64Number of writes
ReadBytesint64Bytes read
WriteBytesint64Bytes written
ReadTimeint64Time spent reading (ms)
WriteTimeint64Time spent writing (ms)
ReadMergedCountint64Merged read operations
WriteMergedCountint64Merged write operations
BusyTimeint64Time disk was busy (ms)
MetricsInfo_Network Aggregated network I/O counters across all interfaces.
Fields
FieldTypeDescription
BytesSentint64Total bytes sent
BytesRecvint64Total bytes received
PacketsSentint64Total packets sent
PacketsRecvint64Total packets received
Errinint64Total input errors
Erroutint64Total output errors
Dropinint64Total inbound packets dropped
Dropoutint64Total outbound packets dropped
EthernetLinkProperties Link-layer and IP properties of an Ethernet interface.
Fields
FieldTypeDescription
InterfaceNamestringInterface name (e.g. "eth0")
MacAddressstringMAC address
StateEthernetStateCurrent link state
Mtuint32Maximum transmission unit
DhcpEnableboolTrue when DHCP is active
Ipv4AddressstringIPv4 address with prefix length (e.g. "192.168.1.10/24")
Ipv4GatewaystringDefault IPv4 gateway
Ipv4Dns[]stringList of DNS server addresses
EthernetState Link state of an Ethernet interface.
Fields
FieldTypeDescription
ETH_UNKNOWN0Unknown state
ETH_UNMANAGED10Device not managed by NetworkManager
ETH_UNAVAILABLE20Device present but not available
ETH_DISCONNECTED30Disconnected
ETH_PREPARE40Preparing connection
ETH_CONFIG50Configuring
ETH_NEED_AUTH60Authentication required
ETH_IP_CONFIG70Configuring IP
ETH_IP_CHECK80Verifying IP configuration
ETH_SECONDARIES90Configuring secondary connections
ETH_CONNECTED100Connected
ETH_DEACTIVATING110Deactivating
ETH_FAILED120Failed
WiFiLinkProperties Link-layer and mode properties of a Wi-Fi interface.
Fields
FieldTypeDescription
InterfaceNamestringInterface name (e.g. "wlan0")
MacAddressstringMAC address
ModeWiFiModeCurrent operating mode
StateWiFiStateCurrent connection state
Mtuint32Maximum transmission unit
ApProperties*APPropertiesSet when mode is AP
ClientProperties*ClientPropertiesSet when mode is Client
ClientProperties IP and radio properties of the current client (station) connection.
Fields
FieldTypeDescription
InterfaceNamestringInterface name
MacAddressstringMAC address
StateWiFiStateConnection state
Mtuint32MTU
SsidstringConnected network SSID
BssidstringConnected AP BSSID
SecuritystringSecurity type (e.g. "wpa2")
SignalStrengthint32RSSI in dBm
Channelint32Radio channel
Bandstring"2.4GHz" or "5GHz"
DhcpEnableboolTrue when DHCP is active
Ipv4AddressstringIPv4 address with prefix (CIDR)
Ipv4GatewaystringDefault IPv4 gateway
Ipv4Dns[]stringDNS servers
APProperties Properties of the active access point.
Fields
FieldTypeDescription
InterfaceNamestringInterface name
SsidstringAP SSID
SecuritystringSecurity type (e.g. "wpa2")
Ipv4AddressstringAP IPv4 address
Channelint32Radio channel
Bandstring"2.4GHz" or "5GHz"
HiddenboolTrue if SSID is hidden
ActiveboolTrue if AP is currently active
ConnectedClientsint32Number of connected clients
ScannedNetwork A Wi-Fi network found during a scan.
Fields
FieldTypeDescription
SsidstringNetwork SSID
BssidstringAP BSSID (MAC)
SecuritystringSecurity type (e.g. "wpa2")
SignalStrengthint32RSSI in dBm
Channelint32Radio channel
Bandstring"2.4GHz" or "5GHz"
HiddenboolTrue if SSID is hidden
WiFiMode Operating mode of a Wi-Fi interface.
Fields
FieldTypeDescription
WIFI_MODE_UNKNOWN0Unknown
WIFI_MODE_AP1Access Point only
WIFI_MODE_CLIENT2Client (station) only
WIFI_MODE_AP_CLIENT3AP + Client simultaneously
WIFI_MODE_DISABLED4Disabled
WiFiState Connection state of a Wi-Fi interface.
Fields
FieldTypeDescription
WIFI_UNKNOWN0Unknown
WIFI_UNMANAGED10Not managed by NetworkManager
WIFI_UNAVAILABLE20Managed but not available (no carrier)
WIFI_DISCONNECTED30Disconnected
WIFI_PREPARE40Preparing connection
WIFI_CONFIG50Configuring
WIFI_NEED_AUTH60Authentication required
WIFI_IP_CONFIG70Configuring IP
WIFI_IP_CHECK80Verifying IP configuration
WIFI_SECONDARIES90Configuring secondary connections
WIFI_ACTIVATED100Connected
WIFI_DEACTIVATING110Deactivating
WIFI_FAILED120Failed
ModelBackend Inference backend / model format.
Fields
FieldTypeDescription
MODEL_BACKEND_UNSPECIFIED0Unspecified
ONNX1ONNX Runtime
TFLITE2TensorFlow Lite
ExecutionMode Hardware execution target for inference.
Fields
FieldTypeDescription
EXEC_CPU0CPU (single/multi core)
EXEC_GPU1GPU / NPU delegate
EXEC_HIGH_THREADS2CPU with maximum thread count
TensorDataType Element type of a tensor buffer.
Fields
FieldTypeDescription
TENSOR_FLOAT3204-byte little-endian IEEE 754, normalised [0, 1]
TENSOR_UINT811-byte unsigned integer [0, 255]
TENSOR_INT3224-byte little-endian signed integer
TENSOR_INT6438-byte little-endian signed integer
CameraDeviceInfo Metadata for a V4L2 camera node.
Fields
FieldTypeDescription
DeviceIDstringDevice path (e.g. "/dev/video0")
DriverstringKernel driver name
CardstringCamera card / model name
SupportedFormats[]stringPixel formats (e.g. "mjpeg", "yuyv")
Resolutions[]stringSupported resolutions (e.g. "1280x720")
CaptureImageResult A single captured frame returned by CaptureImage.
Fields
FieldTypeDescription
ImageData[]byteRaw frame bytes (e.g. JPEG)
FormatstringPixel format of the data
Timestampint64Capture timestamp (Unix µs)
StreamFramesRequest Parameters for StreamFrames.
Fields
FieldTypeDescription
DeviceIdstringCamera device path (e.g. "/dev/video0")
Fpsint32Requested frames per second
Widthint32Frame width in pixels
Heightint32Frame height in pixels
Frame A single video frame received from StreamFrames.
Fields
FieldTypeDescription
Data[]byteRaw frame bytes
Timestampint64Capture timestamp (Unix µs)
Widthint32Frame width in pixels
Heightint32Frame height in pixels
FormatstringPixel format
AIModel Handle to a loaded model. Returned by LoadModel / UploadAndLoadModel.
Fields
FieldTypeDescription
Response*LoadModelResponseTensor schema and metadata returned at load time
LoadModelResponse Response from LoadModel / UploadAndLoadModel.
Fields
FieldTypeDescription
ModelIdstringConfirmed model ID
SuccessboolTrue on success
ErrorErrorInfoSet on failure
Inputs[]*TensorInfoInput tensor schema
Outputs[]*TensorInfoOutput tensor schema
SkippedUploadboolTrue if model was already loaded
ModelInfo Metadata for a loaded model (returned by ListModels).
Fields
FieldTypeDescription
ModelIdstringModel identifier
VersionstringModel version string
BackendModelBackendActive backend
LoadedAtUnixint64Unix timestamp of load
IsModelLoadedResponse Response from IsModelLoaded.
Fields
FieldTypeDescription
LoadedboolTrue if the model is currently loaded
Inputs[]*TensorInfoInput tensor schema
Outputs[]*TensorInfoOutput tensor schema
InferResponse Result of a single inference pass.
Fields
FieldTypeDescription
SuccessboolTrue on success
ErrorErrorInfoSet on failure
OutputData[]byteRaw output tensor bytes
OutputShape[]int32Output tensor shape
NamedOutputsmap[string][]byteNamed output tensors
LatencyUsint64Inference latency in microseconds
TensorInfo Schema of a single input or output tensor.
Fields
FieldTypeDescription
NamestringTensor name
DtypeTensorDataTypeElement data type
Shape[]int32Tensor dimensions
LogLevel Log severity level enum used by DevelopmentManager.
Fields
FieldTypeDescription
LOG_LEVEL_DEBUG0
LOG_LEVEL_INFO1
LOG_LEVEL_WARNING2
LOG_LEVEL_ERROR3
LOG_LEVEL_FATAL4
PwmChannel Identifies a PWM channel.
Fields
FieldTypeDescription
Channeluint32Channel index
NamestringHuman-readable name
PwmProperties Current state and configuration of a PWM channel.
Fields
FieldTypeDescription
ChannelPwmChannel
Enabledbool
DutyCyclefloat640.0–1.0
FrequencyHzfloat64
VpnProfile VPN profile configuration passed to ApplyProfile.
Fields
FieldTypeDescription
ProfileIdstringEmpty = server assigns
DisplayNamestring
ProviderVpnProvider
ConfigData[]byteRaw .conf / .ovpn file content
AutoConnectbool
SecretRefstringOptional credential reference
RegisterServiceRequest Full registration payload passed to AppHubManager.RegisterService().
Fields
FieldTypeDescription
Hoststring
Portint32
Routes[]*RoutePath prefixes to proxy
Health*HealthCheckHealth check configuration
ExposureModestringVisibility scope
FirewallProtocol Protocol filter enum used in firewall rules.
Fields
FieldTypeDescription
PROTO_ANY0
PROTO_TCP1
PROTO_UDP2
PROTO_ICMP3
ZonePolicy Default zone policy or rule action enum.
Fields
FieldTypeDescription
POLICY_ACCEPT0
POLICY_DROP1
POLICY_REJECT2
ZoneRequest Firewall zone definition (as returned by ListZones).
Fields
FieldTypeDescription
NamestringZone name (e.g. "lan", "wan")
Interfaces[]stringNetwork interfaces assigned to this zone
InputPolicyZonePolicyPOLICY_ACCEPT | POLICY_DROP | POLICY_REJECT
OutputPolicyZonePolicyPOLICY_ACCEPT | POLICY_DROP | POLICY_REJECT
MasqueradeboolEnable NAT masquerade (typically wan only)
FirewallRule A firewall traffic rule as returned by ListRules.
Fields
FieldTypeDescription
IdstringServer-generated rule ID
SrcZonestringSource zone (empty = any)
DstZonestringDestination zone (empty = any)
ProtocolFirewallProtocolPROTO_ANY | PROTO_TCP | PROTO_UDP | PROTO_ICMP
SrcIpstringSource IP/CIDR (empty = any)
DestPortint32Destination port (0 = any)
ActionZonePolicyPOLICY_ACCEPT | POLICY_DROP | POLICY_REJECT
CommentstringOptional description
VPNEvent Tunnel event received via WatchEvents. Payload is one of Tunnel or ProviderEvent.
Fields
FieldTypeDescription
TsUnixMsint64Event timestamp (Unix ms)
ProfileIdstring
SessionIdstring
ProviderVpnProviderWIREGUARD | OPENVPN | IPSEC | CUSTOM
TunnelTunnelStateChangedSet when tunnel state changes
ProviderEventProviderNotificationSet for provider-specific events
VpnProvider VPN provider / protocol enum.
Fields
FieldTypeDescription
VPN_PROVIDER_WIREGUARD1
VPN_PROVIDER_OPENVPN2
VPN_PROVIDER_IPSEC3
VPN_PROVIDER_CUSTOM15
TunnelStateChanged Payload of a VPNEvent when the tunnel state changes.
Fields
FieldTypeDescription
NewStatestringDOWN | CONNECTING | UP | DEGRADED | ERROR
MessagestringOptional human-readable detail
ProviderNotification Payload of a VPNEvent for provider-specific notifications.
Fields
FieldTypeDescription
KindstringProvider-defined event kind
DetailsstringProvider-defined event details