Skip to content

Commit 018bf1b

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 4d24fc6 commit 018bf1b

File tree

5 files changed

+71
-75
lines changed

5 files changed

+71
-75
lines changed

docs/en/libraries.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ OpenThread APIs
114114
openthread/openthread_cli
115115
openthread/openthread_core
116116
openthread/openthread_dataset
117-
117+
118118
Zigbee APIs
119119
-----------
120120

docs/en/openthread/openthread.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Thread Network Topology
3434
┌─────────────────┐
3535
│ Internet │
3636
└─────────────────┘
37-
37+
3838
3939
4040
┌─────────────────┐
@@ -233,26 +233,26 @@ Using the Classes API:
233233
234234
void setup() {
235235
Serial.begin(115200);
236-
236+
237237
// Initialize OpenThread stack
238238
OpenThread::begin();
239-
239+
240240
// Wait for OpenThread to be ready
241241
while (!OThread) {
242242
delay(100);
243243
}
244-
244+
245245
// Create and configure dataset
246246
DataSet dataset;
247247
dataset.initNew();
248248
dataset.setNetworkName("MyThreadNetwork");
249249
dataset.setChannel(15);
250-
250+
251251
// Apply dataset and start network
252252
OThread.commitDataSet(dataset);
253253
OThread.start();
254254
OThread.networkInterfaceUp();
255-
255+
256256
// Print network information
257257
OpenThread::otPrintNetworkInformation(Serial);
258258
}
@@ -267,31 +267,30 @@ Using the CLI Helper Functions API:
267267
268268
void setup() {
269269
Serial.begin(115200);
270-
270+
271271
// Initialize OpenThread stack
272272
OpenThread::begin();
273-
273+
274274
// Initialize and start CLI
275275
OThreadCLI.begin();
276276
OThreadCLI.startConsole(Serial);
277-
277+
278278
// Wait for CLI to be ready
279279
while (!OThreadCLI) {
280280
delay(100);
281281
}
282-
282+
283283
// Execute CLI commands
284284
char resp[256];
285285
if (otGetRespCmd("state", resp)) {
286286
Serial.printf("Thread state: %s\r\n", resp);
287287
}
288-
288+
289289
if (otExecCommand("networkname", "MyThreadNetwork", NULL)) {
290290
Serial.println("Network name set successfully");
291291
}
292-
292+
293293
if (otExecCommand("ifconfig", "up", NULL)) {
294294
Serial.println("Network interface up");
295295
}
296296
}
297-

docs/en/openthread/openthread_cli.rst

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This function executes a CLI command and collects all response lines until "Done
4242
if (otGetRespCmd("state", response)) {
4343
Serial.printf("Thread state: %s\r\n", response);
4444
}
45-
45+
4646
if (otGetRespCmd("networkname", response)) {
4747
Serial.printf("Network name: %s\r\n", response);
4848
}
@@ -78,19 +78,19 @@ This function executes a CLI command with an optional argument and returns the s
7878
.. code-block:: arduino
7979
8080
ot_cmd_return_t errorInfo;
81-
81+
8282
// Set network name
8383
if (otExecCommand("networkname", "MyThreadNetwork", &errorInfo)) {
8484
Serial.println("Network name set successfully");
8585
} else {
8686
Serial.printf("Error %d: %s\r\n", errorInfo.errorCode, errorInfo.errorMessage.c_str());
8787
}
88-
88+
8989
// Set channel
9090
if (otExecCommand("channel", "15", &errorInfo)) {
9191
Serial.println("Channel set successfully");
9292
}
93-
93+
9494
// Bring interface up
9595
if (otExecCommand("ifconfig", "up", NULL)) {
9696
Serial.println("Interface is up");
@@ -121,7 +121,7 @@ This function executes a CLI command and prints all response lines to the specif
121121
if (otPrintRespCLI("ipaddr", Serial, 5000)) {
122122
Serial.println("IP addresses printed");
123123
}
124-
124+
125125
// Print all multicast addresses
126126
if (otPrintRespCLI("ipmaddr", Serial, 5000)) {
127127
Serial.println("Multicast addresses printed");
@@ -262,7 +262,7 @@ The callback function is called whenever a complete line of output is received f
262262
// Process response character
263263
}
264264
}
265-
265+
266266
OThreadCLI.onReceive(handleCLIResponse);
267267
268268
Buffer Management
@@ -404,43 +404,43 @@ Using CLI Helper Functions API
404404
405405
void setup() {
406406
Serial.begin(115200);
407-
407+
408408
// Initialize OpenThread
409409
OpenThread::begin();
410410
while (!OThread) {
411411
delay(100);
412412
}
413-
413+
414414
// Initialize CLI
415415
OThreadCLI.begin();
416416
while (!OThreadCLI) {
417417
delay(100);
418418
}
419-
419+
420420
// Get network state
421421
char resp[256];
422422
if (otGetRespCmd("state", resp)) {
423423
Serial.printf("Thread state: %s\r\n", resp);
424424
}
425-
425+
426426
// Set network name
427427
ot_cmd_return_t errorInfo;
428428
if (otExecCommand("networkname", "MyThreadNetwork", &errorInfo)) {
429429
Serial.println("Network name set");
430430
} else {
431431
Serial.printf("Error: %s\r\n", errorInfo.errorMessage.c_str());
432432
}
433-
433+
434434
// Set channel
435435
if (otExecCommand("channel", "15", NULL)) {
436436
Serial.println("Channel set");
437437
}
438-
438+
439439
// Bring interface up
440440
if (otExecCommand("ifconfig", "up", NULL)) {
441441
Serial.println("Interface up");
442442
}
443-
443+
444444
// Print IP addresses
445445
otPrintRespCLI("ipaddr", Serial, 5000);
446446
}
@@ -458,17 +458,17 @@ Interactive Console
458458
459459
void setup() {
460460
Serial.begin(115200);
461-
461+
462462
// Initialize OpenThread
463463
OpenThread::begin();
464464
while (!OThread) {
465465
delay(100);
466466
}
467-
467+
468468
// Initialize and start CLI console
469469
OThreadCLI.begin();
470470
OThreadCLI.startConsole(Serial, true, "ot> ");
471-
471+
472472
Serial.println("OpenThread CLI Console Ready");
473473
Serial.println("Type OpenThread CLI commands (e.g., 'state', 'networkname')");
474474
}
@@ -483,27 +483,27 @@ Programmatic CLI Access
483483
484484
void setup() {
485485
Serial.begin(115200);
486-
486+
487487
// Initialize OpenThread
488488
OpenThread::begin();
489489
while (!OThread) {
490490
delay(100);
491491
}
492-
492+
493493
// Initialize CLI
494494
OThreadCLI.begin();
495495
while (!OThreadCLI) {
496496
delay(100);
497497
}
498-
498+
499499
// Send CLI commands programmatically
500500
OThreadCLI.println("state");
501501
delay(100);
502502
while (OThreadCLI.available() > 0) {
503503
char c = OThreadCLI.read();
504504
Serial.write(c);
505505
}
506-
506+
507507
// Send command with argument
508508
OThreadCLI.print("networkname ");
509509
OThreadCLI.println("MyThreadNetwork");
@@ -539,17 +539,17 @@ Using Callback for Responses
539539
540540
void setup() {
541541
Serial.begin(115200);
542-
542+
543543
// Initialize OpenThread
544544
OpenThread::begin();
545545
while (!OThread) {
546546
delay(100);
547547
}
548-
548+
549549
// Initialize CLI with callback
550550
OThreadCLI.begin();
551551
OThreadCLI.onReceive(handleCLIResponse);
552-
552+
553553
// Send commands
554554
OThreadCLI.println("state");
555555
delay(500);
@@ -578,4 +578,3 @@ Here are some commonly used OpenThread CLI commands:
578578
* ``child table`` - Get child table
579579

580580
For a complete list of OpenThread CLI commands, refer to the `OpenThread CLI Reference <https://openthread.io/reference/cli>`_.
581-

docs/en/openthread/openthread_core.rst

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -483,39 +483,39 @@ Basic Thread Network Setup
483483
484484
void setup() {
485485
Serial.begin(115200);
486-
486+
487487
// Initialize OpenThread stack
488488
OpenThread::begin();
489-
489+
490490
// Wait for OpenThread to be ready
491491
while (!OThread) {
492492
delay(100);
493493
}
494-
494+
495495
// Create and configure dataset
496496
DataSet dataset;
497497
dataset.initNew();
498498
dataset.setNetworkName("MyThreadNetwork");
499499
dataset.setChannel(15);
500-
500+
501501
// Set network key (16 bytes)
502502
uint8_t networkKey[16] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
503503
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
504504
dataset.setNetworkKey(networkKey);
505-
505+
506506
// Apply dataset and start network
507507
OThread.commitDataSet(dataset);
508508
OThread.start();
509509
OThread.networkInterfaceUp();
510-
510+
511511
// Wait for network to be ready
512512
while (OpenThread::otGetDeviceRole() == OT_ROLE_DETACHED) {
513513
delay(100);
514514
}
515-
515+
516516
// Print network information
517517
OpenThread::otPrintNetworkInformation(Serial);
518-
518+
519519
// Get and print addresses
520520
Serial.printf("Mesh Local EID: %s\r\n", OThread.getMeshLocalEid().toString().c_str());
521521
Serial.printf("RLOC: %s\r\n", OThread.getRloc().toString().c_str());
@@ -530,9 +530,9 @@ Monitoring Device Role
530530
void loop() {
531531
ot_device_role_t role = OpenThread::otGetDeviceRole();
532532
const char *roleStr = OpenThread::otGetStringDeviceRole();
533-
533+
534534
Serial.printf("Current role: %s\r\n", roleStr);
535-
535+
536536
switch (role) {
537537
case OT_ROLE_LEADER:
538538
Serial.println("This device is the Thread Leader");
@@ -550,7 +550,7 @@ Monitoring Device Role
550550
Serial.println("Thread is disabled");
551551
break;
552552
}
553-
553+
554554
delay(5000);
555555
}
556556
@@ -566,15 +566,14 @@ Address Management
566566
for (size_t i = 0; i < unicastCount; i++) {
567567
Serial.printf(" [%zu] %s\r\n", i, OThread.getUnicastAddress(i).toString().c_str());
568568
}
569-
569+
570570
// Print multicast addresses
571571
size_t multicastCount = OThread.getMulticastAddressCount();
572572
Serial.printf("Multicast addresses: %zu\r\n", multicastCount);
573573
for (size_t i = 0; i < multicastCount; i++) {
574574
Serial.printf(" [%zu] %s\r\n", i, OThread.getMulticastAddress(i).toString().c_str());
575575
}
576-
576+
577577
// Clear cache to force refresh
578578
OThread.clearAllAddressCache();
579579
}
580-

0 commit comments

Comments
 (0)