GetId()
Gets the randomly generated Border Agent ID. The ID is saved in persistent storage and survives reboots. The typical use case of the ID is to be published in the MeshCoP mDNS service as the `id` TXT value for the client to identify this Border Router/Agent device.
SetId()
Sets the Border Agent ID. The Border Agent ID will be saved in persistent storage and survive reboots. It's required to set the ID only once after factory reset. If the ID has never been set by calling this method, a random ID will be generated and returned when `GetId()` is called.
GetUdpPort() const
Gets the UDP port of this service.
Start()
Stop()
Stops the Border Agent service.
GetState() const
Gets the state of the Border Agent service.
Disconnect()
Disconnects the Border Agent from any active secure sessions. If Border Agent is connected to a commissioner candidate with ephemeral key, calling this API will cause the ephemeral key to be cleared after the session is disconnected. The Border Agent state may not change immediately upon calling this method, the state will be updated when the connection update is notified by `HandleConnected()`.
SetEphemeralKey()
Sets the ephemeral key for a given timeout duration. The ephemeral key can be set when the Border Agent is already running and is not currently connected to any external commissioner (i.e., it is in `kStateStarted` state). To terminate active commissioner sessions, use the `Disconnect()` function. The given @p aKeyString is directly used as the ephemeral PSK (excluding the trailing null `\0` character). Its length must be between `kMinEphemeralKeyLength` and `kMaxEphemeralKeyLength`, inclusive. Setting the ephemeral key again before a previously set one is timed out will replace the previous one and will reset the timeout. During the timeout interval, the ephemeral key can be used only once by an external commissioner to establish a connection. After the commissioner disconnects, the ephemeral key is cleared, and the Border Agent reverts to using PSKc. If the timeout expires while a commissioner is still connected, the session will be terminated, and the Border Agent will cease using the ephemeral key and revert to PSKc.
ClearEphemeralKey()
Cancels the ephemeral key in use if any. Can be used to cancel a previously set ephemeral key before it times out. If the Border Agent is not running or there is no ephemeral key in use, calling this function has no effect. If a commissioner is connected using the ephemeral key and is currently active, calling this method does not change its state. In this case the `IsEphemeralKeyActive()` will continue to return `true` until the commissioner disconnects, or the ephemeral key timeout expires. To terminate active commissioner sessions, use the `Disconnect()` function.
IsEphemeralKeyActive() const
Indicates whether or not an ephemeral key is currently active.
SetEphemeralKeyCallback()
GetCounters()
Gets the set of border agent counters.
GetUdpProxyPort() const
Returns the UDP Proxy port to which the commissioner is currently bound.
Start()
Start()
HandleNotifierEvents()
CoapCodeFromError()
SendMessage()
SendErrorMessage()
SendErrorMessage()
HandleConnected()
HandleConnected()
HandleTmf()
HandleTmfDatasetGet()
HandleTimeout()
RestartAfterRemovingEphemeralKey()
HandleEphemeralKeyTimeout()
InvokeEphemeralKeyCallback()
HandleSecureAgentStopped()
HandleSecureAgentStopped()
HandleCoapResponse()
HandleCoapResponse()
ForwardToLeader()
ForwardToCommissioner()
HandleUdpReceive()
HandleUdpReceive()