Skip to content

Commit 3687c5f

Browse files
committed
fix(openthread): Include Openthread guarding
1 parent 739b77c commit 3687c5f

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

libraries/OpenThread/src/OThreadCLI.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "OThreadCLI.h"
22
#if SOC_IEEE802154_SUPPORTED
3+
#if CONFIG_OPENTHREAD_ENABLED
34

45
#include "Arduino.h"
56
#include "OThreadCLI.h"
@@ -422,4 +423,5 @@ void OpenThreadCLI::flush() {
422423

423424
OpenThreadCLI OThreadCLI;
424425

426+
#endif /* CONFIG_OPENTHREAD_ENABLED */
425427
#endif /* SOC_IEEE802154_SUPPORTED */

libraries/OpenThread/src/OThreadCLI.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#pragma once
22
#include "soc/soc_caps.h"
3+
#include "sdkconfig.h"
34
#if SOC_IEEE802154_SUPPORTED
5+
#if CONFIG_OPENTHREAD_ENABLED
46

57
#include "esp_openthread.h"
68
#include "esp_openthread_cli.h"
79
#include "esp_openthread_lock.h"
810
#include "esp_openthread_netif_glue.h"
911
#include "esp_openthread_types.h"
1012

11-
#include "sdkconfig.h"
12-
#if CONFIG_OPENTHREAD_ENABLED
13-
1413
#include "openthread/cli.h"
1514
#include "openthread/instance.h"
1615
#include "openthread/logging.h"
@@ -52,5 +51,6 @@ class OpenThreadCLI : public Stream {
5251
};
5352

5453
extern OpenThreadCLI OThreadCLI;
54+
5555
#endif /* CONFIG_OPENTHREAD_ENABLED */
5656
#endif /* SOC_IEEE802154_SUPPORTED */

libraries/OpenThread/src/OThreadCLI_Util.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "OThreadCLI.h"
22
#if SOC_IEEE802154_SUPPORTED
3+
#if CONFIG_OPENTHREAD_ENABLED
4+
35
#include "OThreadCLI_Util.h"
46

57
static const char *otRoleString[] = {
@@ -70,4 +72,6 @@ bool otExecCommand(const char *cmd, const char *arg, ot_cmd_return_t *returnCode
7072
return false;
7173
}
7274
}
75+
76+
#endif /* CONFIG_OPENTHREAD_ENABLED */
7377
#endif /* SOC_IEEE802154_SUPPORTED */

libraries/OpenThread/src/OThreadCLI_Util.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22
#include "soc/soc_caps.h"
3+
#include "sdkconfig.h"
34
#if SOC_IEEE802154_SUPPORTED
5+
#if CONFIG_OPENTHREAD_ENABLED
46

57
typedef enum {
68
OT_ROLE_DISABLED = 0, ///< The Thread stack is disabled.
@@ -19,4 +21,5 @@ ot_device_role_t getOtDeviceRole();
1921
const char* getStringOtDeviceRole();
2022
bool otExecCommand(const char *cmd, const char *arg, ot_cmd_return_t *returnCode = NULL);
2123

24+
#endif /* CONFIG_OPENTHREAD_ENABLED */
2225
#endif /* SOC_IEEE802154_SUPPORTED */

0 commit comments

Comments
 (0)