OpenThread Remote Procedure Call

The OpenThread Remote Procedure Call (RPC) solution is a set of libraries that enable controlling the Thread stack running on a remote device or processor.

Overview

The solution allows calling the OpenThread API on one device to control the OpenThread stack running on another device. This is accomplished by serializing the API call and sending it to the remote device over a selected transport. 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.

Implementation

The OpenThread RPC consists of the following libraries:

  • OpenThread RPC Client, which includes the OpenThread RPC common library. This library serializes the OpenThread API using the Remote procedure call library (nRF RPC) library. OpenThread RPC Client has to be part of the user application.

  • OpenThread RPC Server, which includes the OpenThread RPC common library and the OpenThread stack. This library enables communication with OpenThread RPC Client, and has to run on a device that has an 802.15.4 radio hardware peripheral.

Configuration

These Kconfig options must be enabled to use OpenThread RPC:

These Kconfig options must additionally be enabled for the server:

Read Configuring Thread in the nRF Connect SDK to learn more about configuring the OpenThread stack.

The 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. This option must be set to the same value on both the client and server, and is enabled by default.

Samples using the library

The following nRF Connect SDK samples use this library:

Limitations

OpenThread RPC currently supports the serialization of the following OpenThread functions:

  • otCliInit()

  • otCliInputLine()

  • otCoapAddResource()

  • otCoapMessageAppendUriPathOptions()

  • otCoapMessageGetCode()

  • otCoapMessageGetMessageId()

  • otCoapMessageGetToken()

  • otCoapMessageGetTokenLength()

  • otCoapMessageGetType()

  • otCoapMessageInit()

  • otCoapMessageInitResponse()

  • otCoapMessageSetPayloadMarker()

  • otCoapNewMessage()

  • otCoapRemoveResource()

  • otCoapSendRequest()

  • otCoapSendRequestWithParameters()

  • otCoapSendResponse()

  • otCoapSendResponseWithParameters()

  • otCoapSetDefaultHandler()

  • otCoapStart()

  • otCoapStop()

  • otDatasetGetActive()

  • otDatasetGetActiveTlvs()

  • otDatasetGetPending()

  • otDatasetGetPendingTlvs()

  • otDatasetIsCommissioned()

  • otDatasetSetActive()

  • otDatasetSetActiveTlvs()

  • otDatasetSetPending()

  • otDatasetSetPendingTlvs()

  • otDnsAddressResponseGetAddress()

  • otDnsAddressResponseGetHostName()

  • otDnsBrowseResponseGetHostAddress()

  • otDnsBrowseResponseGetServiceInfo()

  • otDnsBrowseResponseGetServiceInstance()

  • otDnsBrowseResponseGetServiceName()

  • otDnsClientBrowse()

  • otDnsClientGetDefaultConfig()

  • otDnsClientResolveAddress()

  • otDnsClientResolveIp4Address()

  • otDnsClientResolveService()

  • otDnsClientResolveServiceAndHostAddress()

  • otDnsClientSetDefaultConfig()

  • otDnsServiceResponseGetHostAddress()

  • otDnsServiceResponseGetServiceInfo()

  • otDnsServiceResponseGetServiceName()

  • otGetVersionString()

  • otInstanceErasePersistentInfo()

  • otInstanceFinalize()

  • otInstanceGetId()

  • otInstanceInitSingle()

  • otInstanceIsInitialized()

  • otIp6GetMulticastAddresses()

  • otIp6GetUnicastAddresses()

  • otIp6AddressToString()

  • otIp6IsEnabled()

  • otIp6SetEnabled()

  • otIp6SubscribeMulticastAddress()

  • otIp6UnsubscribeMulticastAddress()

  • otLinkGetChannel()

  • otLinkGetCounters()

  • otLinkGetExtendedAddress()

  • otLinkGetFactoryAssignedIeeeEui64()

  • otLinkGetPanId()

  • otLinkGetPollPeriod()

  • otLinkRawGetRadioTime()

  • otLinkSetEnabled()

  • otLinkSetMaxFrameRetriesDirect()

  • otLinkSetMaxFrameRetriesIndirect()

  • otLinkSetPollPeriod()

  • otMeshDiagCancel()

  • otMeshDiagDiscoverTopology()

  • otMeshDiagGetNextChildInfo()

  • otMeshDiagGetNextIp6Address()

  • otMessageAppend()

  • otMessageFree()

  • otMessageGetLength()

  • otMessageGetOffset()

  • otMessageGetThreadLinkInfo()

  • otMessageRead()

  • otNetDataGet()

  • otNetDataGetNextOnMeshPrefix()

  • otNetDataGetNextService()

  • otNetDataGetStableVersion()

  • otNetDataGetVersion()

  • otRemoveStateChangeCallback()

  • otSetStateChangedCallback()

  • otSrpClientAddService()

  • otSrpClientClearHostAndServices()

  • otSrpClientClearService()

  • otSrpClientDisableAutoStartMode()

  • otSrpClientEnableAutoHostAddress()

  • otSrpClientEnableAutoStartMode()

  • otSrpClientGetHostInfo()

  • otSrpClientGetKeyLeaseInterval()

  • otSrpClientGetLeaseInterval()

  • otSrpClientGetServerAddress()

  • otSrpClientGetServices()

  • otSrpClientGetTtl()

  • otSrpClientIsAutoStartModeEnabled()

  • otSrpClientIsRunning()

  • otSrpClientItemStateToString()

  • otSrpClientRemoveHostAndServices()

  • otSrpClientRemoveService()

  • otSrpClientSetCallback()

  • otSrpClientSetHostAddresses()

  • otSrpClientSetHostName()

  • otSrpClientSetKeyLeaseInterval()

  • otSrpClientSetLeaseInterval()

  • otSrpClientSetTtl()

  • otSrpClientStart()

  • otSrpClientStop()

  • otThreadDiscover()

  • otThreadErrorToString()

  • otThreadGetDeviceRole()

  • otThreadGetExtendedPanId()

  • otThreadGetLeaderRouterId()

  • otThreadGetLeaderWeight()

  • otThreadGetLinkMode()

  • otThreadGetMeshLocalPrefix()

  • otThreadGetMleCounters()

  • otThreadGetNetworkName()

  • otThreadGetNextDiagnosticTlv()

  • otThreadGetPartitionId()

  • otThreadGetRloc16()

  • otThreadGetVendorModel()

  • otThreadGetVendorName()

  • otThreadGetVendorSwVersion()

  • otThreadGetVersion()

  • otThreadSendDiagnosticGet()

  • otThreadSendDiagnosticReset()

  • otThreadSetEnabled()

  • otThreadSetLinkMode()

  • otThreadSetVendorModel()

  • otThreadSetVendorName()

  • otThreadSetVendorSwVersion()

  • otUdpBind()

  • otUdpClose()

  • otUdpConnect()

  • otUdpIsOpen()

  • otUdpNewMessage()

  • otUdpOpen()

  • otUdpSend()

The libraries will be extended to support more functions in the future.

Dependencies

The libraries have the following dependencies:

API documentation

This library is an implementation of the existing OpenThread C API. Please refer to OpenThread Reference for the OpenThread C API documentation.

In addition, the library also implements some API additions.

Header file: include/net/ot_rpc.h
Source files: subsys/net/openthread/rpc
OpenThread over RPC API additions