Skip to content

Commit

Permalink
[cli] add references to CoAP concepts guide from CLI (openthread#9856)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhodie authored Feb 20, 2024
1 parent 08d21f1 commit 6cfe14c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 40 deletions.
9 changes: 5 additions & 4 deletions src/cli/cli_coap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ template <> otError Coap::Process<Cmd("set")>(Arg aArgs[])
* coap start
* Done
* @endcode
* @par api_copy
* #otCoapStart
* @par
* Starts the CoAP server. @moreinfo{@coap}.
* @sa otCoapStart
*/
template <> otError Coap::Process<Cmd("start")>(Arg aArgs[])
{
Expand Down Expand Up @@ -491,7 +492,7 @@ template <> otError Coap::Process<Cmd("get")>(Arg aArgs[]) { return ProcessReque
* the number of blocks to send. The `block-` type requires
* `OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE` to be set.
* @par
* Creates the specified CoAP resource.
* Creates the specified CoAP resource. @moreinfo{@coap}.
*/
template <> otError Coap::Process<Cmd("post")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_POST); }

Expand Down Expand Up @@ -526,7 +527,7 @@ template <> otError Coap::Process<Cmd("post")>(Arg aArgs[]) { return ProcessRequ
* the number of blocks to send. The `block-` type requires
* `OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE` to be set.
* @par
* Modifies the specified CoAP resource.
* Modifies the specified CoAP resource. @moreinfo{@coap}.
*/
template <> otError Coap::Process<Cmd("put")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_PUT); }

Expand Down
27 changes: 11 additions & 16 deletions src/cli/cli_srp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ template <> otError SrpClient::Process<Cmd("autostart")>(Arg aArgs[])
* @endcode
* @par
* Indicates the current state of auto-start mode (enabled or disabled).
* @moreinfo{@srp}.
* @sa otSrpClientIsAutoStartModeEnabled
* @sa @srp
*/
if (aArgs[0].IsEmpty())
{
Expand Down Expand Up @@ -160,8 +160,8 @@ template <> otError SrpClient::Process<Cmd("autostart")>(Arg aArgs[])
* @cparam srp client callback [@ca{enable}|@ca{disable}]
* @par
* Gets or enables/disables printing callback events from the SRP client.
* @moreinfo{@srp}.
* @sa otSrpClientSetCallback
* @sa @srp
*/
template <> otError SrpClient::Process<Cmd("callback")>(Arg aArgs[])
{
Expand Down Expand Up @@ -212,9 +212,8 @@ template <> otError SrpClient::Process<Cmd("host")>(Arg aArgs[])
* To set the client host name when the host has either been removed or not yet
* registered with the server, use the `name` parameter.
* @par
* Gets or sets the host name of the SRP client.
* Gets or sets the host name of the SRP client. @moreinfo{@srp}.
* @sa otSrpClientSetHostName
* @sa @srp
*/
else if (aArgs[0] == "name")
{
Expand Down Expand Up @@ -288,8 +287,8 @@ template <> otError SrpClient::Process<Cmd("host")>(Arg aArgs[])
* @par
* Indicates whether auto address mode is enabled. If auto address mode is not
* enabled, then the list of SRP client host addresses is returned.
* @moreinfo{@srp}.
* @sa otSrpClientGetHostInfo
* @sa @srp
*/
if (aArgs[1].IsEmpty())
{
Expand Down Expand Up @@ -330,10 +329,9 @@ template <> otError SrpClient::Process<Cmd("host")>(Arg aArgs[])
* running. This will also disable auto host address mode.
* @par
* Enable auto host address mode or explicitly set the list of host
* addresses.
* addresses. @moreinfo{@srp}.
* @sa otSrpClientEnableAutoHostAddress
* @sa otSrpClientSetHostAddresses
* @sa @srp
*/
else if (aArgs[1] == "auto")
{
Expand Down Expand Up @@ -388,9 +386,9 @@ template <> otError SrpClient::Process<Cmd("host")>(Arg aArgs[])
* `removekeylease` parameter is specified first in the command.
* @par
* Removes SRP client host information and all services from the SRP server.
* @moreinfo{@srp}.
* @sa otSrpClientRemoveHostAndServices
* @sa otSrpClientSetHostName
* @sa @srp
*/
else if (aArgs[0] == "remove")
{
Expand Down Expand Up @@ -496,9 +494,8 @@ template <> otError SrpClient::Process<Cmd("server")>(Arg aArgs[])
* @par
* Gets the socket address (IPv6 address and port number) of the SRP server
* that is being used by the SRP client. If the client is not running, the address
* is unspecified (all zeros) with a port number of 0.
* is unspecified (all zeros) with a port number of 0. @moreinfo{@srp}.
* @sa otSrpClientGetServerAddress
* @sa @srp
*/
if (aArgs[0].IsEmpty())
{
Expand Down Expand Up @@ -585,8 +582,8 @@ template <> otError SrpClient::Process<Cmd("service")>(Arg aArgs[])
* TXT data byte sequence.
* @par
* Adds a service with a given instance name, service name, and port number.
* @moreinfo{@srp}.
* @sa otSrpClientAddService
* @sa @srp
*/
else if (aArgs[0] == "add")
{
Expand Down Expand Up @@ -660,9 +657,8 @@ template <> otError SrpClient::Process<Cmd("service")>(Arg aArgs[])
* @par
* Gets or sets the service key record inclusion mode in the SRP client.
* This command is intended for testing only, and requires that
* `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` be enabled.
* `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` be enabled. @moreinfo{@srp}.
* @sa otSrpClientIsServiceKeyRecordEnabled
* @sa @srp
*/
else if (aArgs[0] == "key")
{
Expand Down Expand Up @@ -853,9 +849,8 @@ void SrpClient::OutputService(uint8_t aIndentSize, const otSrpClientService &aSe
* @endcode
* @cparam srp client start @ca{serveraddr} @ca{serverport}
* @par
* Starts the SRP client operation.
* Starts the SRP client operation. @moreinfo{@srp}.
* @sa otSrpClientStart
* @sa @srp
*/
template <> otError SrpClient::Process<Cmd("start")>(Arg aArgs[])
{
Expand All @@ -881,7 +876,7 @@ template <> otError SrpClient::Process<Cmd("start")>(Arg aArgs[])
* @endcode
* @par api_copy
* #otSrpClientIsRunning
* @sa @srp
* @moreinfo{@srp}.
*/
template <> otError SrpClient::Process<Cmd("state")>(Arg aArgs[])
{
Expand Down
13 changes: 6 additions & 7 deletions src/cli/cli_srp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ template <> otError SrpServer::Process<Cmd("addrmode")>(Arg aArgs[])
* to enable or disable the SRP server.
* @par
* This command requires that `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` be enabled.
* @moreinfo{@srp}.
* @sa otSrpServerIsAutoEnableMode
* @sa otSrpServerSetAutoEnableMode
* @sa @srp
*/
template <> otError SrpServer::Process<Cmd("auto")>(Arg aArgs[])
{
Expand Down Expand Up @@ -174,8 +174,9 @@ template <> otError SrpServer::Process<Cmd("domain")>(Arg aArgs[])
* The SRP server may become active when the existing
* SRP servers are no longer active within the Thread network.
* * `running`: The SRP server is active and can handle service registrations.
* @par
* @moreinfo{@srp}.
* @sa otSrpServerGetState
* @sa @srp
*/
template <> otError SrpServer::Process<Cmd("state")>(Arg aArgs[])
{
Expand Down Expand Up @@ -213,9 +214,8 @@ template <> otError SrpServer::Process<Cmd("enable")>(Arg aArgs[])
* @endcode
* @cparam srp server [@ca{enable}|@ca{disable}]
* @par
* Enables or disables the SRP server.
* Enables or disables the SRP server. @moreinfo{@srp}.
* @sa otSrpServerSetEnabled
* @sa @srp
*/
template <> otError SrpServer::Process<Cmd("disable")>(Arg aArgs[])
{
Expand Down Expand Up @@ -311,11 +311,10 @@ template <> otError SrpServer::Process<Cmd("lease")>(Arg aArgs[])
* Done
* @endcode
* @par
* Returns information about all registered hosts.
* Returns information about all registered hosts. @moreinfo{@srp}.
* @sa otSrpServerGetNextHost
* @sa otSrpServerHostGetAddresses
* @sa otSrpServerHostGetFullName
* @sa @srp
*/
template <> otError SrpServer::Process<Cmd("host")>(Arg aArgs[])
{
Expand Down Expand Up @@ -415,10 +414,10 @@ void SrpServer::OutputHostAddresses(const otSrpServerHost *aHost)
* The `TXT` record is displayed
* as an array of entries. If an entry contains a key, the key is printed in
* ASCII format. The value portion is printed in hexadecimal bytes.
* @moreinfo{@srp}.
* @sa otSrpServerServiceGetInstanceName
* @sa otSrpServerServiceGetServiceName
* @sa otSrpServerServiceGetSubTypeServiceNameAt
* @sa @srp
*/
template <> otError SrpServer::Process<Cmd("service")>(Arg aArgs[])
{
Expand Down
12 changes: 4 additions & 8 deletions src/cli/cli_tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@ template <> otError TcpExample::Process<Cmd("deinit")>(Arg aArgs[])
* Associates an IPv6 address and a port to the example TCP endpoint provided by
* the `tcp` CLI. Associating the TCP endpoint to an IPv6
* address and port is referred to as "naming the TCP endpoint." This binds the
* endpoint for communication.
* endpoint for communication. @moreinfo{@tcp}.
* @sa otTcpBind
* @sa @tcp
*/
template <> otError TcpExample::Process<Cmd("bind")>(Arg aArgs[])
{
Expand Down Expand Up @@ -368,9 +367,8 @@ template <> otError TcpExample::Process<Cmd("bind")>(Arg aArgs[])
* Establishes a connection with the specified peer.
* @par
* If the connection establishment is successful, the resulting TCP connection
* is associated with the example TCP endpoint.
* is associated with the example TCP endpoint. @moreinfo{@tcp}.
* @sa otTcpConnect
* @sa @tcp
*/
template <> otError TcpExample::Process<Cmd("connect")>(Arg aArgs[])
{
Expand Down Expand Up @@ -450,8 +448,7 @@ template <> otError TcpExample::Process<Cmd("connect")>(Arg aArgs[])
* remote TCP endpoint.
* @par
* Sends data over the TCP connection associated with the example TCP endpoint
* that is provided with the `tcp` CLI.
* @sa @tcp
* that is provided with the `tcp` CLI. @moreinfo{@tcp}.
*/
template <> otError TcpExample::Process<Cmd("send")>(Arg aArgs[])
{
Expand Down Expand Up @@ -684,9 +681,8 @@ template <> otError TcpExample::Process<Cmd("abort")>(Arg aArgs[])
* and are associated with the example TCP endpoint.
* @par
* Uses the example TCP listener to listen for incoming connections on the
* specified IPv6 address and port.
* specified IPv6 address and port. @moreinfo{@tcp}.
* @sa otTcpListen
* @sa @tcp
*/
template <> otError TcpExample::Process<Cmd("listen")>(Arg aArgs[])
{
Expand Down
8 changes: 3 additions & 5 deletions src/cli/cli_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ UdpExample::UdpExample(otInstance *aInstance, OutputImplementer &aOutputImplemen
* - `port`: UDP port number to bind to. Each of the examples is using port number 1234.
* @par
* Assigns an IPv6 address and a port to an open socket, which binds the socket for communication.
* Assigning the IPv6 address and port is referred to as naming the socket.
* Assigning the IPv6 address and port is referred to as naming the socket. @moreinfo{@udp}.
* @sa otUdpBind
* @sa @udp
*/
template <> otError UdpExample::Process<Cmd("bind")>(Arg aArgs[])
{
Expand Down Expand Up @@ -127,7 +126,7 @@ template <> otError UdpExample::Process<Cmd("bind")>(Arg aArgs[])
* `InvalidState` when the preferred NAT64 prefix is unavailable.
* @par api_copy
* #otUdpConnect
* @sa @udp
* @moreinfo{@udp}.
*/
template <> otError UdpExample::Process<Cmd("connect")>(Arg aArgs[])
{
Expand Down Expand Up @@ -244,12 +243,11 @@ template <> otError UdpExample::Process<Cmd("open")>(Arg aArgs[])
* - `-s`: Auto-generated payload with the specified length given in the `value` parameter.
* - `-x`: Binary data in hexadecimal representation given in the `value` parameter.
* @par
* Sends a UDP message using the socket.
* Sends a UDP message using the socket. @moreinfo{@udp}.
* @csa{udp open}
* @csa{udp bind}
* @csa{udp connect}
* @sa otUdpSend
* @sa @udp
*/
template <> otError UdpExample::Process<Cmd("send")>(Arg aArgs[])
{
Expand Down

0 comments on commit 6cfe14c

Please sign in to comment.