Skip to content

Commit

Permalink
fix(openthread): Include Openthread guarding
Browse files Browse the repository at this point in the history
  • Loading branch information
SuGlider committed Jun 20, 2024
1 parent 739b77c commit 3687c5f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions libraries/OpenThread/src/OThreadCLI.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "OThreadCLI.h"
#if SOC_IEEE802154_SUPPORTED
#if CONFIG_OPENTHREAD_ENABLED

#include "Arduino.h"
#include "OThreadCLI.h"
Expand Down Expand Up @@ -422,4 +423,5 @@ void OpenThreadCLI::flush() {

OpenThreadCLI OThreadCLI;

#endif /* CONFIG_OPENTHREAD_ENABLED */
#endif /* SOC_IEEE802154_SUPPORTED */
6 changes: 3 additions & 3 deletions libraries/OpenThread/src/OThreadCLI.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#pragma once
#include "soc/soc_caps.h"
#include "sdkconfig.h"
#if SOC_IEEE802154_SUPPORTED
#if CONFIG_OPENTHREAD_ENABLED

#include "esp_openthread.h"
#include "esp_openthread_cli.h"
#include "esp_openthread_lock.h"
#include "esp_openthread_netif_glue.h"
#include "esp_openthread_types.h"

#include "sdkconfig.h"
#if CONFIG_OPENTHREAD_ENABLED

#include "openthread/cli.h"
#include "openthread/instance.h"
#include "openthread/logging.h"
Expand Down Expand Up @@ -52,5 +51,6 @@ class OpenThreadCLI : public Stream {
};

extern OpenThreadCLI OThreadCLI;

#endif /* CONFIG_OPENTHREAD_ENABLED */
#endif /* SOC_IEEE802154_SUPPORTED */
4 changes: 4 additions & 0 deletions libraries/OpenThread/src/OThreadCLI_Util.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "OThreadCLI.h"
#if SOC_IEEE802154_SUPPORTED
#if CONFIG_OPENTHREAD_ENABLED

#include "OThreadCLI_Util.h"

static const char *otRoleString[] = {
Expand Down Expand Up @@ -70,4 +72,6 @@ bool otExecCommand(const char *cmd, const char *arg, ot_cmd_return_t *returnCode
return false;
}
}

#endif /* CONFIG_OPENTHREAD_ENABLED */
#endif /* SOC_IEEE802154_SUPPORTED */
3 changes: 3 additions & 0 deletions libraries/OpenThread/src/OThreadCLI_Util.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include "soc/soc_caps.h"
#include "sdkconfig.h"
#if SOC_IEEE802154_SUPPORTED
#if CONFIG_OPENTHREAD_ENABLED

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

#endif /* CONFIG_OPENTHREAD_ENABLED */
#endif /* SOC_IEEE802154_SUPPORTED */

0 comments on commit 3687c5f

Please sign in to comment.