Skip to content

Commit 71f6d48

Browse files
Damian-Nordicnordicjm
authored andcommitted
doc: document OpenThread RPC
Add a documentation page about OpenThread RPC. Signed-off-by: Damian Krolik <[email protected]>
1 parent ff130b3 commit 71f6d48

File tree

5 files changed

+176
-2
lines changed

5 files changed

+176
-2
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
/doc/nrf/libraries/networking/nrf_cloud.rst @nrfconnect/ncs-nrf-cloud-doc
170170
/doc/nrf/libraries/networking/nrf_cloud_*.rst @nrfconnect/ncs-nrf-cloud-doc
171171
/doc/nrf/libraries/networking/nrf_provisioning.rst @nrfconnect/ncs-iot-oulu-tampere-doc
172+
/doc/nrf/libraries/networking/ot_rpc.rst @nrfconnect/ncs-terahertz-doc @nrfconnect/ncs-protocols-serialization
172173
/doc/nrf/libraries/networking/rest_client.rst @nrfconnect/ncs-iot-positioning-doc
173174
/doc/nrf/libraries/networking/softap_wifi_provision.rst @nrfconnect/ncs-cia-doc
174175
/doc/nrf/libraries/networking/wifi_credentials.rst @nrfconnect/ncs-cia-doc
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
.. _ot_rpc:
2+
3+
OpenThread Remote Procedure Call
4+
################################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
The OpenThread Remote Procedure Call (RPC) solution is a set of libraries that enable controlling the :ref:`ug_thread` stack running on a remote device or processor.
11+
12+
Overview
13+
********
14+
15+
The solution allows calling the OpenThread API on one device to control the OpenThread stack running on another device.
16+
This is accomplished by serializing the API call and sending it to the remote device over a selected transport.
17+
Use this solution when you cannot or do not want to include the OpenThread stack in your application firmware, for example to offload the application CPU, save memory, or optimize the power consumption.
18+
19+
Implementation
20+
==============
21+
22+
The OpenThread RPC consists of the following libraries:
23+
24+
* OpenThread RPC Client, which includes the OpenThread RPC common library.
25+
This library serializes the OpenThread API using the :ref:`nrf_rpc` library.
26+
OpenThread RPC Client has to be part of the user application.
27+
* OpenThread RPC Server, which includes the OpenThread RPC common library and the OpenThread stack.
28+
This library enables communication with OpenThread RPC Client, and has to run on a device that has a 802.15.4 radio hardware peripheral.
29+
30+
Configuration
31+
*************
32+
33+
These Kconfig options must be enabled to use OpenThread RPC:
34+
35+
* :kconfig:option:`CONFIG_OPENTHREAD_RPC`
36+
* :kconfig:option:`CONFIG_OPENTHREAD_RPC_CLIENT` (for the user application with OpenThread RPC Client)
37+
* :kconfig:option:`CONFIG_OPENTHREAD_RPC_SERVER` (for the device that has a 802.15.4 radio hardware peripheral and OpenThread RPC Server)
38+
39+
These Kconfig options must additionally be enabled for the server:
40+
41+
* :kconfig:option:`CONFIG_NETWORKING`
42+
* :kconfig:option:`CONFIG_NET_L2_OPENTHREAD`
43+
* :kconfig:option:`CONFIG_OPENTHREAD_MANUAL_START`
44+
45+
Read :ref:`ug_thread_configuring` to learn more about configuring the OpenThread stack.
46+
47+
The :kconfig:option:`CONFIG_OPENTHREAD_RPC_NET_IF` Kconfig option enables the network interface on the client, which forwards and receives IPv6 packets to and from the server.
48+
This option must be set to the same value on both the client and server, and is enabled by default.
49+
50+
Samples using the library
51+
*************************
52+
53+
The following |NCS| samples use this library:
54+
55+
* :ref:`nrf_rpc_protocols_serialization_client`
56+
* :ref:`nrf_rpc_protocols_serialization_server`
57+
58+
Limitations
59+
***********
60+
61+
OpenThread RPC currently supports the serialization of the following OpenThread functions:
62+
63+
* :c:func:`otCliInit`
64+
* :c:func:`otCliInputLine`
65+
* :c:func:`otCoapAddResource`
66+
* :c:func:`otCoapMessageAppendUriPathOptions`
67+
* :c:func:`otCoapMessageGetCode`
68+
* :c:func:`otCoapMessageGetMessageId`
69+
* :c:func:`otCoapMessageGetToken`
70+
* :c:func:`otCoapMessageGetTokenLength`
71+
* :c:func:`otCoapMessageGetType`
72+
* :c:func:`otCoapMessageInit`
73+
* :c:func:`otCoapMessageInitResponse`
74+
* :c:func:`otCoapMessageSetPayloadMarker`
75+
* :c:func:`otCoapNewMessage`
76+
* :c:func:`otCoapRemoveResource`
77+
* :c:func:`otCoapSendRequest`
78+
* :c:func:`otCoapSendRequestWithParameters`
79+
* :c:func:`otCoapSendResponse`
80+
* :c:func:`otCoapSendResponseWithParameters`
81+
* :c:func:`otCoapSetDefaultHandler`
82+
* :c:func:`otCoapStart`
83+
* :c:func:`otCoapStop`
84+
* :c:func:`otDatasetGetActive`
85+
* :c:func:`otDatasetGetActiveTlvs`
86+
* :c:func:`otDatasetIsCommissioned`
87+
* :c:func:`otDatasetSetActive`
88+
* :c:func:`otDatasetSetActiveTlvs`
89+
* :c:func:`otGetVersionString`
90+
* :c:func:`otInstanceErasePersistentInfo`
91+
* :c:func:`otInstanceFinalize`
92+
* :c:func:`otInstanceGetId`
93+
* :c:func:`otInstanceInitSingle`
94+
* :c:func:`otInstanceIsInitialized`
95+
* :c:func:`otIp6GetMulticastAddresses`
96+
* :c:func:`otIp6GetUnicastAddresses`
97+
* :c:func:`otIp6IsEnabled`
98+
* :c:func:`otIp6SetEnabled`
99+
* :c:func:`otIp6SubscribeMulticastAddress`
100+
* :c:func:`otIp6UnsubscribeMulticastAddress`
101+
* :c:func:`otLinkGetChannel`
102+
* :c:func:`otLinkGetExtendedAddress`
103+
* :c:func:`otLinkGetFactoryAssignedIeeeEui64`
104+
* :c:func:`otLinkGetPanId`
105+
* :c:func:`otLinkGetPollPeriod`
106+
* :c:func:`otLinkSetEnabled`
107+
* :c:func:`otLinkSetMaxFrameRetriesDirect`
108+
* :c:func:`otLinkSetMaxFrameRetriesIndirect`
109+
* :c:func:`otLinkSetPollPeriod`
110+
* :c:func:`otMessageAppend`
111+
* :c:func:`otMessageFree`
112+
* :c:func:`otMessageGetLength`
113+
* :c:func:`otMessageGetOffset`
114+
* :c:func:`otMessageRead`
115+
* :c:func:`otNetDataGet`
116+
* :c:func:`otNetDataGetNextOnMeshPrefix`
117+
* :c:func:`otNetDataGetNextService`
118+
* :c:func:`otNetDataGetStableVersion`
119+
* :c:func:`otNetDataGetVersion`
120+
* :c:func:`otRemoveStateChangeCallback`
121+
* :c:func:`otSetStateChangedCallback`
122+
* :c:func:`otSrpClientAddService`
123+
* :c:func:`otSrpClientClearHostAndServices`
124+
* :c:func:`otSrpClientClearService`
125+
* :c:func:`otSrpClientDisableAutoStartMode`
126+
* :c:func:`otSrpClientEnableAutoHostAddress`
127+
* :c:func:`otSrpClientEnableAutoStartMode`
128+
* :c:func:`otSrpClientRemoveHostAndServices`
129+
* :c:func:`otSrpClientRemoveService`
130+
* :c:func:`otSrpClientSetCallback`
131+
* :c:func:`otSrpClientSetHostName`
132+
* :c:func:`otSrpClientSetKeyLeaseInterval`
133+
* :c:func:`otSrpClientSetLeaseInterval`
134+
* :c:func:`otSrpClientSetTtl`
135+
* :c:func:`otThreadDiscover`
136+
* :c:func:`otThreadErrorToString`
137+
* :c:func:`otThreadGetDeviceRole`
138+
* :c:func:`otThreadGetExtendedPanId`
139+
* :c:func:`otThreadGetLeaderRouterId`
140+
* :c:func:`otThreadGetLeaderWeight`
141+
* :c:func:`otThreadGetLinkMode`
142+
* :c:func:`otThreadGetMeshLocalPrefix`
143+
* :c:func:`otThreadGetMleCounters`
144+
* :c:func:`otThreadGetNetworkName`
145+
* :c:func:`otThreadGetPartitionId`
146+
* :c:func:`otThreadGetVersion`
147+
* :c:func:`otThreadSetEnabled`
148+
* :c:func:`otThreadSetLinkMode`
149+
* :c:func:`otUdpBind`
150+
* :c:func:`otUdpClose`
151+
* :c:func:`otUdpConnect`
152+
* :c:func:`otUdpNewMessage`
153+
* :c:func:`otUdpOpen`
154+
* :c:func:`otUdpSend`
155+
156+
The libraries will be extended to support more functions in the future.
157+
158+
Dependencies
159+
************
160+
161+
The libraries have the following dependencies:
162+
163+
* :ref:`nrf_rpc`
164+
* :ref:`ug_thread`
165+
166+
.. _ot_rpc_api:
167+
168+
API documentation
169+
*****************
170+
171+
This library does not define a new OpenThread API.
172+
Please refer to `OpenThread Reference`_ for the OpenThread C API documentation.

doc/nrf/links.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@
11721172
.. ### Source: openthread.io
11731173

11741174
.. _`OpenThread.io`: https://openthread.io/
1175+
.. _`OpenThread Reference`: https://openthread.io/reference
11751176
.. _`Device Types in the OpenThread portal`: https://openthread.io/guides/thread-primer/node-roles-and-types#device_types
11761177
.. _`Thread Commissioning on OpenThread portal`: https://openthread.io/guides/build/commissioning
11771178
.. _`OpenThread logging`: https://openthread.io/guides/build/logs

samples/nrf_rpc/protocols_serialization/client/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following snippets are available:
4848
* ``coex`` - Enables shell commands for the :ref:`MPSL software coexistence <nrfxlib:mpsl_cx>` implementation on the server device.
4949
* ``debug`` - Enables debugging the sample by enabling :c:func:`__ASSERT()` statements globally and verbose logging.
5050
* ``log_rpc`` - Enables logging over RPC.
51-
* ``openthread`` - Enables the client part of the OpenThread RPC.
51+
* ``openthread`` - Enables the client part of the :ref:`OpenThread RPC <ot_rpc>`.
5252
* ``nfc`` - Enables the client part of the :ref:`NFC RPC <nfc_rpc>`.
5353

5454
Building and running

samples/nrf_rpc/protocols_serialization/server/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The following snippets are available:
4545
* ``coex`` - Enables the :ref:`MPSL software coexistence <nrfxlib:mpsl_cx>` implementation on the server device.
4646
* ``debug`` - Enables debugging the sample by enabling :c:func:`__ASSERT()` statements globally and verbose logging.
4747
* ``log_rpc`` - Enables logging over RPC.
48-
* ``openthread`` - Enables the server part of the OpenThread RPC.
48+
* ``openthread`` - Enables the server part of the :ref:`OpenThread RPC <ot_rpc>`.
4949
* ``nfc`` - Enables the server part of the :ref:`NFC RPC <nfc_rpc>`.
5050

5151
User interface

0 commit comments

Comments
 (0)