Skip to content

Commit 78cc07e

Browse files
NordicBuildercvinayak
authored andcommitted
openthread: add libraries based on commit 57ef721
Update OpenThread libraries with newest commit Signed-off-by: Nordic Builder <[email protected]>
1 parent 363f1bb commit 78cc07e

File tree

98 files changed

+3246
-1383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3246
-1383
lines changed

openthread/include/openthread-system.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern "C" {
4242
#endif
4343

4444
/**
45-
* This function performs all platform-specific initialization of OpenThread's drivers.
45+
* Performs all platform-specific initialization of OpenThread's drivers.
4646
*
4747
* @note This function is not called by the OpenThread library. Instead, the system/RTOS should call this function
4848
* when initialization of OpenThread's drivers is most appropriate.
@@ -54,7 +54,7 @@ extern "C" {
5454
void otSysInit(int argc, char *argv[]);
5555

5656
/**
57-
* This function performs all platform-specific deinitialization for OpenThread's drivers.
57+
* Performs all platform-specific deinitialization for OpenThread's drivers.
5858
*
5959
* @note This function is not called by the OpenThread library. Instead, the system/RTOS should call this function
6060
* when deinitialization of OpenThread's drivers is most appropriate.
@@ -63,7 +63,7 @@ void otSysInit(int argc, char *argv[]);
6363
void otSysDeinit(void);
6464

6565
/**
66-
* This function returns true if a pseudo-reset was requested.
66+
* Returns true if a pseudo-reset was requested.
6767
*
6868
* In such a case, the main loop should shut down and re-initialize the OpenThread instance.
6969
*
@@ -74,7 +74,7 @@ void otSysDeinit(void);
7474
bool otSysPseudoResetWasRequested(void);
7575

7676
/**
77-
* This function performs all platform-specific processing for OpenThread's example applications.
77+
* Performs all platform-specific processing for OpenThread's example applications.
7878
*
7979
* @note This function is not called by the OpenThread library. Instead, the system/RTOS should call this function
8080
* in the main loop when processing OpenThread's drivers is most appropriate.
@@ -85,7 +85,7 @@ bool otSysPseudoResetWasRequested(void);
8585
void otSysProcessDrivers(otInstance *aInstance);
8686

8787
/**
88-
* This function is called whenever platform drivers needs processing.
88+
* Is called whenever platform drivers needs processing.
8989
*
9090
* @note This function is not handled by the OpenThread library. Instead, the system/RTOS should handle this function
9191
* and schedule a call to `otSysProcessDrivers()`.

openthread/include/openthread/backbone_router.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C" {
5252
*/
5353

5454
/**
55-
* This structure represents Backbone Router configuration.
55+
* Represents Backbone Router configuration.
5656
*
5757
*/
5858
typedef struct otBackboneRouterConfig
@@ -64,7 +64,7 @@ typedef struct otBackboneRouterConfig
6464
} otBackboneRouterConfig;
6565

6666
/**
67-
* This function gets the Primary Backbone Router information in the Thread Network.
67+
* Gets the Primary Backbone Router information in the Thread Network.
6868
*
6969
* @param[in] aInstance A pointer to an OpenThread instance.
7070
* @param[out] aConfig A pointer to where to put Primary Backbone Router information.

openthread/include/openthread/backbone_router_ftd.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ otError otBackboneRouterSetConfig(otInstance *aInstance, const otBackboneRouterC
161161
otError otBackboneRouterRegister(otInstance *aInstance);
162162

163163
/**
164-
* This method returns the Backbone Router registration jitter value.
164+
* Returns the Backbone Router registration jitter value.
165165
*
166166
* @returns The Backbone Router registration jitter value.
167167
*
@@ -171,7 +171,7 @@ otError otBackboneRouterRegister(otInstance *aInstance);
171171
uint8_t otBackboneRouterGetRegistrationJitter(otInstance *aInstance);
172172

173173
/**
174-
* This method sets the Backbone Router registration jitter value.
174+
* Sets the Backbone Router registration jitter value.
175175
*
176176
* @param[in] aJitter the Backbone Router registration jitter value to set.
177177
*
@@ -181,7 +181,7 @@ uint8_t otBackboneRouterGetRegistrationJitter(otInstance *aInstance);
181181
void otBackboneRouterSetRegistrationJitter(otInstance *aInstance, uint8_t aJitter);
182182

183183
/**
184-
* This method gets the local Domain Prefix configuration.
184+
* Gets the local Domain Prefix configuration.
185185
*
186186
* @param[in] aInstance A pointer to an OpenThread instance.
187187
* @param[out] aConfig A pointer to the Domain Prefix configuration.
@@ -193,7 +193,7 @@ void otBackboneRouterSetRegistrationJitter(otInstance *aInstance, uint8_t aJitte
193193
otError otBackboneRouterGetDomainPrefix(otInstance *aInstance, otBorderRouterConfig *aConfig);
194194

195195
/**
196-
* This method configures response status for next DUA registration.
196+
* Configures response status for next DUA registration.
197197
*
198198
* Note: available only when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled.
199199
* Only used for test and certification.
@@ -235,7 +235,7 @@ typedef enum
235235
} otBackboneRouterMulticastListenerEvent;
236236

237237
/**
238-
* This function pointer is called whenever the Multicast Listeners change.
238+
* Pointer is called whenever the Multicast Listeners change.
239239
*
240240
* @param[in] aContext The user context pointer.
241241
* @param[in] aEvent The Multicast Listener event.
@@ -247,7 +247,7 @@ typedef void (*otBackboneRouterMulticastListenerCallback)(void
247247
const otIp6Address *aAddress);
248248

249249
/**
250-
* This method sets the Backbone Router Multicast Listener callback.
250+
* Sets the Backbone Router Multicast Listener callback.
251251
*
252252
* @param[in] aInstance A pointer to an OpenThread instance.
253253
* @param[in] aCallback A pointer to the Multicast Listener callback.
@@ -302,7 +302,7 @@ otError otBackboneRouterMulticastListenerAdd(otInstance *aInstance, const otIp6A
302302
typedef uint16_t otBackboneRouterMulticastListenerIterator; ///< Used to iterate through Multicast Listeners.
303303

304304
/**
305-
* This structure represents a Backbone Router Multicast Listener info.
305+
* Represents a Backbone Router Multicast Listener info.
306306
*
307307
*/
308308
typedef struct otBackboneRouterMulticastListenerInfo
@@ -312,7 +312,7 @@ typedef struct otBackboneRouterMulticastListenerInfo
312312
} otBackboneRouterMulticastListenerInfo;
313313

314314
/**
315-
* This function gets the next Multicast Listener info (using an iterator).
315+
* Gets the next Multicast Listener info (using an iterator).
316316
*
317317
* @param[in] aInstance A pointer to an OpenThread instance.
318318
* @param[in,out] aIterator A pointer to the iterator. On success the iterator will be updated to point to next
@@ -346,7 +346,7 @@ typedef enum
346346
} otBackboneRouterNdProxyEvent;
347347

348348
/**
349-
* This function pointer is called whenever the Nd Proxy changed.
349+
* Pointer is called whenever the Nd Proxy changed.
350350
*
351351
* @param[in] aContext The user context pointer.
352352
* @param[in] aEvent The ND Proxy event.
@@ -359,7 +359,7 @@ typedef void (*otBackboneRouterNdProxyCallback)(void *aCo
359359
const otIp6Address *aDua);
360360

361361
/**
362-
* This method sets the Backbone Router ND Proxy callback.
362+
* Sets the Backbone Router ND Proxy callback.
363363
*
364364
* @param[in] aInstance A pointer to an OpenThread instance.
365365
* @param[in] aCallback A pointer to the ND Proxy callback.
@@ -382,7 +382,7 @@ typedef struct otBackboneRouterNdProxyInfo
382382
} otBackboneRouterNdProxyInfo;
383383

384384
/**
385-
* This method gets the Backbone Router ND Proxy info.
385+
* Gets the Backbone Router ND Proxy info.
386386
*
387387
* @param[in] aInstance A pointer to an OpenThread instance.
388388
* @param[in] aDua The Domain Unicast Address.
@@ -408,7 +408,7 @@ typedef enum
408408
} otBackboneRouterDomainPrefixEvent;
409409

410410
/**
411-
* This function pointer is called whenever the Domain Prefix changed.
411+
* Pointer is called whenever the Domain Prefix changed.
412412
*
413413
* @param[in] aContext The user context pointer.
414414
* @param[in] aEvent The Domain Prefix event.
@@ -419,7 +419,7 @@ typedef void (*otBackboneRouterDomainPrefixCallback)(void
419419
otBackboneRouterDomainPrefixEvent aEvent,
420420
const otIp6Prefix *aDomainPrefix);
421421
/**
422-
* This method sets the Backbone Router Domain Prefix callback.
422+
* Sets the Backbone Router Domain Prefix callback.
423423
*
424424
* @param[in] aInstance A pointer to an OpenThread instance.
425425
* @param[in] aCallback A pointer to the Domain Prefix callback.

openthread/include/openthread/border_agent.h

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,31 @@ extern "C" {
5252
*/
5353

5454
/**
55-
* This enumeration defines the Border Agent state.
55+
* The length of Border Agent/Router ID in bytes.
56+
*
57+
*/
58+
#define OT_BORDER_AGENT_ID_LENGTH (16)
59+
60+
/**
61+
* @struct otBorderAgentId
62+
*
63+
* Represents a Border Agent ID.
64+
*
65+
*/
66+
OT_TOOL_PACKED_BEGIN
67+
struct otBorderAgentId
68+
{
69+
uint8_t mId[OT_BORDER_AGENT_ID_LENGTH];
70+
} OT_TOOL_PACKED_END;
71+
72+
/**
73+
* Represents a Border Agent ID.
74+
*
75+
*/
76+
typedef struct otBorderAgentId otBorderAgentId;
77+
78+
/**
79+
* Defines the Border Agent state.
5680
*
5781
*/
5882
typedef enum otBorderAgentState
@@ -82,6 +106,42 @@ otBorderAgentState otBorderAgentGetState(otInstance *aInstance);
82106
*/
83107
uint16_t otBorderAgentGetUdpPort(otInstance *aInstance);
84108

109+
/**
110+
* Gets the randomly generated Border Agent ID.
111+
*
112+
* The ID is saved in persistent storage and survives reboots. The typical use case of the ID is to
113+
* be published in the MeshCoP mDNS service as the `id` TXT value for the client to identify this
114+
* Border Router/Agent device.
115+
*
116+
* @param[in] aInstance A pointer to an OpenThread instance.
117+
* @param[out] aId A pointer to buffer to receive the ID.
118+
*
119+
* @retval OT_ERROR_NONE If successfully retrieved the Border Agent ID.
120+
* @retval ... If failed to retrieve the Border Agent ID.
121+
*
122+
* @sa otBorderAgentSetId
123+
*
124+
*/
125+
otError otBorderAgentGetId(otInstance *aInstance, otBorderAgentId *aId);
126+
127+
/**
128+
* Sets the Border Agent ID.
129+
*
130+
* The Border Agent ID will be saved in persistent storage and survive reboots. It's required to
131+
* set the ID only once after factory reset. If the ID has never been set by calling this function,
132+
* a random ID will be generated and returned when `otBorderAgentGetId` is called.
133+
*
134+
* @param[in] aInstance A pointer to an OpenThread instance.
135+
* @param[out] aId A pointer to the Border Agent ID.
136+
*
137+
* @retval OT_ERROR_NONE If successfully set the Border Agent ID.
138+
* @retval ... If failed to set the Border Agent ID.
139+
*
140+
* @sa otBorderAgentGetId
141+
*
142+
*/
143+
otError otBorderAgentSetId(otInstance *aInstance, const otBorderAgentId *aId);
144+
85145
/**
86146
* @}
87147
*

openthread/include/openthread/border_router.h

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern "C" {
5454
*/
5555

5656
/**
57-
* This method provides a full or stable copy of the local Thread Network Data.
57+
* Provides a full or stable copy of the local Thread Network Data.
5858
*
5959
* @param[in] aInstance A pointer to an OpenThread instance.
6060
* @param[in] aStable TRUE when copying the stable version, FALSE when copying the full version.
@@ -94,7 +94,7 @@ otError otBorderRouterAddOnMeshPrefix(otInstance *aInstance, const otBorderRoute
9494
otError otBorderRouterRemoveOnMeshPrefix(otInstance *aInstance, const otIp6Prefix *aPrefix);
9595

9696
/**
97-
* This function gets the next On Mesh Prefix in the local Network Data.
97+
* Gets the next On Mesh Prefix in the local Network Data.
9898
*
9999
* @param[in] aInstance A pointer to an OpenThread instance.
100100
* @param[in,out] aIterator A pointer to the Network Data iterator context. To get the first on-mesh entry
@@ -139,7 +139,7 @@ otError otBorderRouterAddRoute(otInstance *aInstance, const otExternalRouteConfi
139139
otError otBorderRouterRemoveRoute(otInstance *aInstance, const otIp6Prefix *aPrefix);
140140

141141
/**
142-
* This function gets the next external route in the local Network Data.
142+
* Gets the next external route in the local Network Data.
143143
*
144144
* @param[in] aInstance A pointer to an OpenThread instance.
145145
* @param[in,out] aIterator A pointer to the Network Data iterator context. To get the first external route entry
@@ -168,6 +168,35 @@ otError otBorderRouterGetNextRoute(otInstance *aInstance,
168168
*/
169169
otError otBorderRouterRegister(otInstance *aInstance);
170170

171+
/**
172+
* Function pointer callback which is invoked when Network Data (local or leader) gets full.
173+
*
174+
* @param[in] aContext A pointer to arbitrary context information.
175+
*
176+
*/
177+
typedef void (*otBorderRouterNetDataFullCallback)(void *aContext);
178+
179+
/**
180+
* Sets the callback to indicate when Network Data gets full.
181+
*
182+
* Requires `OPENTHREAD_CONFIG_BORDER_ROUTER_SIGNAL_NETWORK_DATA_FULL`.
183+
*
184+
* The callback is invoked whenever:
185+
* - The device is acting as a leader and receives a Network Data registration from a Border Router (BR) that it cannot
186+
* add to Network Data (running out of space).
187+
* - The device is acting as a BR and new entries cannot be added to its local Network Data.
188+
* - The device is acting as a BR and tries to register its local Network Data entries with the leader, but determines
189+
* that its local entries will not fit.
190+
*
191+
* @param[in] aInstance A pointer to an OpenThread instance.
192+
* @param[in] aCallback The callback.
193+
* @param[in] aContext A pointer to arbitrary context information used with @p aCallback.
194+
*
195+
*/
196+
void otBorderRouterSetNetDataFullCallback(otInstance *aInstance,
197+
otBorderRouterNetDataFullCallback aCallback,
198+
void *aContext);
199+
171200
/**
172201
* @}
173202
*

0 commit comments

Comments
 (0)