nRF5 SDK for Thread and Zigbee v3.2.0
Data Structures | Macros | Typedefs | Functions
Server

This module includes functions to manage local network data with the OpenThread Server. More...

Data Structures

struct  otServerConfig
 
struct  otServiceConfig
 

Macros

#define OT_SERVICE_DATA_MAX_SIZE   252
 Maximum size of Service Data in bytes.
 
#define OT_SERVER_DATA_MAX_SIZE   248
 Maximum size of Server Data in bytes. This is theoretical limit, practical one is much lower.
 

Typedefs

typedef struct otServerConfig otServerConfig
 
typedef struct otServiceConfig otServiceConfig
 

Functions

OTAPI otError OTCALL otServerGetNetDataLocal (otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength)
 
OTAPI otError OTCALL otServerAddService (otInstance *aInstance, const otServiceConfig *aConfig)
 
OTAPI otError OTCALL otServerRemoveService (otInstance *aInstance, uint32_t aEnterpriseNumber, const uint8_t *aServiceData, uint8_t aServiceDataLength)
 
OTAPI otError OTCALL otServerGetNextService (otInstance *aInstance, otNetworkDataIterator *aIterator, otServiceConfig *aConfig)
 
OTAPI otError OTCALL otServerGetNextLeaderService (otInstance *aInstance, otNetworkDataIterator *aIterator, otServiceConfig *aConfig)
 
OTAPI otError OTCALL otServerRegister (otInstance *aInstance)
 

Detailed Description

This module includes functions to manage local network data with the OpenThread Server.

Typedef Documentation

This structure represents a Server configuration.

This structure represents a Service configuration.

Function Documentation

OTAPI otError OTCALL otServerAddService ( otInstance aInstance,
const otServiceConfig aConfig 
)

Add a service configuration to the local network data.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aConfigA pointer to the service configuration.
Return values
OT_ERROR_NONESuccessfully added the configuration to the local network data.
OT_ERROR_INVALID_ARGSOne or more configuration parameters were invalid.
OT_ERROR_NO_BUFSNot enough room is available to add the configuration to the local network data.
See also
otServerRemoveService
otServerRegister
OTAPI otError OTCALL otServerGetNetDataLocal ( otInstance aInstance,
bool  aStable,
uint8_t *  aData,
uint8_t *  aDataLength 
)

This method provides a full or stable copy of the local Thread Network Data.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aStableTRUE when copying the stable version, FALSE when copying the full version.
[out]aDataA pointer to the data buffer.
[in,out]aDataLengthOn entry, size of the data buffer pointed to by aData. On exit, number of copied bytes.
OTAPI otError OTCALL otServerGetNextLeaderService ( otInstance aInstance,
otNetworkDataIterator aIterator,
otServiceConfig aConfig 
)

This function gets the next service in the leader Network Data.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in,out]aIteratorA pointer to the Network Data iterator context. To get the first service entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT.
[out]aConfigA pointer to where the service information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next service.
OT_ERROR_NOT_FOUNDNo subsequent service exists in the leader Network Data.
OTAPI otError OTCALL otServerGetNextService ( otInstance aInstance,
otNetworkDataIterator aIterator,
otServiceConfig aConfig 
)

This function gets the next service in the local Network Data.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in,out]aIteratorA pointer to the Network Data iterator context. To get the first service entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT.
[out]aConfigA pointer to where the service information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next service.
OT_ERROR_NOT_FOUNDNo subsequent service exists in the Thread Network Data.
OTAPI otError OTCALL otServerRegister ( otInstance aInstance)

Immediately register the local network data with the Leader.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
OT_ERROR_NONESuccessfully queued a Server Data Request message for delivery.
See also
otServerAddService
otServerRemoveService
OTAPI otError OTCALL otServerRemoveService ( otInstance aInstance,
uint32_t  aEnterpriseNumber,
const uint8_t *  aServiceData,
uint8_t  aServiceDataLength 
)

Remove a service configuration from the local network data.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aEnterpriseNumberEnterprise Number of the service entry to be deleted.
[in]aServiceDataA pointer to an Service Data to look for during deletion.
[in]aServiceDataLengthThe length of aServiceData in bytes.
Return values
OT_ERROR_NONESuccessfully removed the configuration from the local network data.
OT_ERROR_NOT_FOUNDCould not find the Border Router entry.
See also
otServerAddService
otServerRegister

Documentation feedback | Developer Zone | Subscribe | Updated