Netd is a background daemon that runs on stacktoggle and exposes various network interface related information and functions over a NATS API.
Command API (CMD) is meat to trigger some action on the device. It returns a response synchronously informing whether the action was triggered successfully or not. It does not respond with the result of that action. It is a request-response based API.
NATS subject: NatsNetdCmdSub
Implemented commands: NetdCmdName
Request Payload: NetdCmd
Response Payload: NatsResponse
Get API is meant to get some information from the device. It returns a response synchronously with the requested information. It is a request-response based API.
NATS subject: NatsNetdGetSub
Implemented commands: NetdGetName
Request Payload: NetdGet
Response Payload: NatsResponse or NetdGetNetworkStatusResponse
Some information or results of CMD is published on specific NATS subjects. Client should subscribe to those subjects to receive the information.
Scan results subject: NatsScanResultsSub
To trigger a scan for available Wi-Fi networks send a request to NatsNetdCmdSub with SCAN command name. Resonse to this request will indicate whether the scan was triggered successfully or not.
When the scan is done (approx. 3 seconds later) scan results will be published on NatsScanResultsSub subject and will be in form of ScanResults.
To get network status send a request to NatsNetdGetSub with NETWORK_STATUS command name. Response to this request will contain NetdGetNetworkStatusResponse with network status information.
To get Wi-Fi station status send a request to NatsNetdGetSub with WIFI_STA_STATUS command name. Response to this request will contain NetdGetWifiStaStatusResponse with Wi-Fi station status information.
To get Wi-Fi station connection attempt result subscribe to NatsWifiConnectAttemptSub subject. On every finished connection attempt a message will be posted containing WifiConnectAttempt with Wi-Fi station connection attempt result information.
To get NTP server status send a request to NatsNetdGetSub with NTP_STATUS command name. Response to this request will contain NetdGetNtpStatusResponse with NTP server status information.
To get NATS Leaf connection status (aka Fleet manager connection status) send a request to NatsNetdGetSub with LEAF_CONNECTION_STATUS command name. Response to this request will contain NetdLeafConnectionStatus with NATS Leaf connection status information.
Generated using TypeDoc