Skip to content

Commit dcb09f3

Browse files
committed
fix(openthread): wrong return type and parameter
1 parent a89fcea commit dcb09f3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

libraries/OpenThread/keywords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
check #######################################
1+
#######################################
22
# Syntax Coloring Map For OpenThread
33
#######################################
44

libraries/OpenThread/src/OThread.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ const uint8_t *OpenThread::getNetworkKey() const {
393393
return nullptr;
394394
}
395395
static otNetworkKey networkKey; // Static storage to persist after function return
396-
otError error = otThreadGetNetworkKey(mInstance, &networkKey);
397-
return (error == OT_ERROR_NONE) ? networkKey.m8 : nullptr;
396+
otThreadGetNetworkKey(mInstance, &networkKey);
397+
return networkKey.m8;
398398
}
399399

400400
// Get the Node Channel
@@ -492,8 +492,9 @@ IPAddress OpenThread::getLeaderRloc() const {
492492
log_w("Error: OpenThread instance not initialized");
493493
return IPAddress(IPv6); // Return empty IPv6 address
494494
}
495-
const otIp6Address *otAddr = otThreadGetLeaderRloc(mInstance);
496-
if (!otAddr) {
495+
otIp6Address otAddr;
496+
otError error = otThreadGetLeaderRloc(mInstance, &otAddr);
497+
if (error != OT_ERROR_NONE) {
497498
log_w("Failed to get Leader RLOC");
498499
return IPAddress(IPv6);
499500
}

0 commit comments

Comments
 (0)