Skip to content

Commit 55f9378

Browse files
committed
feat(openthread): formatting text
1 parent 11ec1d1 commit 55f9378

File tree

2 files changed

+54
-18
lines changed

2 files changed

+54
-18
lines changed

Diff for: libraries/OpenThread/examples/COAP/coap_lamp/coap_lamp.ino

+31-9
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,41 @@
77
#define OT_COAP_RESOURCE_NAME "Lamp"
88

99
const char *otSetupLeader[] = {
10-
// clear/disable all
11-
"coap", "stop", "thread", "stop", "ifconfig", "down", "dataset", "clear",
12-
// set dataset
13-
"dataset", "init new", "dataset channel", OT_CHANNEL, "dataset networkkey", OT_NETWORK_KEY, "dataset", "commit active",
14-
// network start
15-
"ifconfig", "up", "thread", "start"
10+
// -- clear/disable all
11+
// stop CoAP
12+
"coap", "stop",
13+
// stop Thread
14+
"thread", "stop",
15+
// stop the interface
16+
"ifconfig", "down",
17+
// clear the dataset
18+
"dataset", "clear",
19+
// -- set dataset
20+
// create a new complete dataset with random data
21+
"dataset", "init new",
22+
// set the channel
23+
"dataset channel", OT_CHANNEL,
24+
// set the network key
25+
"dataset networkkey", OT_NETWORK_KEY,
26+
// commit the dataset
27+
"dataset", "commit active",
28+
// -- network start
29+
// start the interface
30+
"ifconfig", "up",
31+
// start the Thread network
32+
"thread", "start"
1633
};
1734

1835
const char *otCoapLamp[] = {
19-
// create a multicast IPv6 Address for this device
36+
// -- create a multicast IPv6 Address for this device
2037
"ipmaddr add", OT_MCAST_ADDR,
21-
// start and create a CoAP resource
22-
"coap", "start", "coap resource", OT_COAP_RESOURCE_NAME, "coap set", "0"
38+
// -- start and create a CoAP resource
39+
// start CoAP as server
40+
"coap", "start",
41+
// create a CoAP resource
42+
"coap resource", OT_COAP_RESOURCE_NAME,
43+
// set the CoAP resource initial value
44+
"coap set", "0"
2345
};
2446

2547
bool otDeviceSetup(const char **otSetupCmds, uint8_t nCmds1, const char **otCoapCmds, uint8_t nCmds2, ot_device_role_t expectedRole) {

Diff for: libraries/OpenThread/examples/COAP/coap_switch/coap_switch.ino

+23-9
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,32 @@
88
#define OT_COAP_RESOURCE_NAME "Lamp"
99

1010
const char *otSetupChild[] = {
11-
// clear/disable all
12-
"coap", "stop", "thread", "stop", "ifconfig", "down", "dataset", "clear",
13-
// set dataset
14-
"dataset channel", OT_CHANNEL, "dataset networkkey", OT_NETWORK_KEY, "dataset", "commit active",
15-
// network start
16-
"ifconfig", "up", "thread", "start"
11+
// -- clear/disable all
12+
// stop CoAP
13+
"coap", "stop",
14+
// stop Thread
15+
"thread", "stop",
16+
// stop the interface
17+
"ifconfig", "down",
18+
// clear the dataset
19+
"dataset", "clear",
20+
// -- set dataset
21+
// set the channel
22+
"dataset channel", OT_CHANNEL,
23+
// set the network key
24+
"dataset networkkey", OT_NETWORK_KEY,
25+
// commit the dataset
26+
"dataset", "commit active",
27+
// -- network start
28+
// start the interface
29+
"ifconfig", "up",
30+
// start the Thread network
31+
"thread", "start"
1732
};
1833

1934
const char *otCoapSwitch[] = {
20-
// start and create a CoAP resource
21-
"coap",
22-
"start",
35+
// -- start CoAP as client
36+
"coap", "start"
2337
};
2438

2539
bool otDeviceSetup(

0 commit comments

Comments
 (0)