You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to get the bridge device example to work over a local network (only over WiFi), I ran into the following problem:
If you disable the CHIPoBLE option in the menuconfig, the project is not built.
Compiller output
`
matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp
In file included from matter/src/lib/dnssd/Resolver.h:31,
from matter/src/lib/dnssd/TxtFields.h:21,
from matter/src/lib/dnssd/Advertiser.h:26,
from matter/src/app/server/CommissioningModeProvider.h:20,
from matter/src/app/server/Dnssd.h:20,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:35:
matter/src/lib/dnssd/Constants.h:56:60: error: macro "max" requires 2 arguments, but only 1 given
constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
^
In file included from matter/src/lib/dnssd/Resolver.h:31,
from matter/src/lib/dnssd/TxtFields.h:21,
from matter/src/lib/dnssd/Advertiser.h:26,
from matter/src/app/server/CommissioningModeProvider.h:20,
from matter/src/app/server/Dnssd.h:20,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:35:
matter/src/lib/dnssd/Constants.h:76:60: error: macro "max" requires 2 arguments, but only 1 given
constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
^
In file included from matter/src/app/util/af.h:43,
from matter/src/app/util/util.h:53,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:36:
matter/src/lib/support/SafeInt.h:69:58: error: macro "max" requires 2 arguments, but only 1 given
if (static_cast<intmax_t>(numeric_limits<V>::max()) <= static_cast<intmax_t>(numeric_limits<T>::max()) &&
^
matter/src/lib/support/SafeInt.h:69:109: error: macro "max" requires 2 arguments, but only 1 given
if (static_cast<intmax_t>(numeric_limits<V>::max()) <= static_cast<intmax_t>(numeric_limits<T>::max()) &&
^
matter/src/lib/support/SafeInt.h:70:58: error: macro "min" requires 2 arguments, but only 1 given
static_cast<intmax_t>(numeric_limits<V>::min()) >= static_cast<intmax_t>(numeric_limits<T>::min()))
^
matter/src/lib/support/SafeInt.h:70:109: error: macro "min" requires 2 arguments, but only 1 given
static_cast<intmax_t>(numeric_limits<V>::min()) >= static_cast<intmax_t>(numeric_limits<T>::min()))
^
matter/src/lib/support/SafeInt.h:77:61: error: macro "min" requires 2 arguments, but only 1 given
return static_cast<intmax_t>(numeric_limits<T>::min()) <= static_cast<intmax_t>(arg) &&
^
matter/src/lib/support/SafeInt.h:78:88: error: macro "max" requires 2 arguments, but only 1 given
static_cast<intmax_t>(arg) <= static_cast<intmax_t>(numeric_limits<T>::max());
^
matter/src/lib/support/SafeInt.h:83:59: error: macro "max" requires 2 arguments, but only 1 given
if (static_cast<uintmax_t>(numeric_limits<V>::max()) <= static_cast<uintmax_t>(numeric_limits<T>::max()))
^
matter/src/lib/support/SafeInt.h:83:111: error: macro "max" requires 2 arguments, but only 1 given
if (static_cast<uintmax_t>(numeric_limits<V>::max()) <= static_cast<uintmax_t>(numeric_limits<T>::max()))
^
matter/src/lib/support/SafeInt.h:90:93: error: macro "max" requires 2 arguments, but only 1 given
return static_cast<uintmax_t>(arg) <= static_cast<uintmax_t>(numeric_limits<T>::max());
^
matter/src/lib/support/SafeInt.h:95:46: error: macro "max" requires 2 arguments, but only 1 given
static_assert(numeric_limits<T>::max() >= 0, "What weird type is this?");
^
matter/src/lib/support/SafeInt.h:96:59: error: macro "max" requires 2 arguments, but only 1 given
if (static_cast<uintmax_t>(numeric_limits<V>::max()) <= static_cast<uintmax_t>(numeric_limits<T>::max()))
^
matter/src/lib/support/SafeInt.h:96:111: error: macro "max" requires 2 arguments, but only 1 given
if (static_cast<uintmax_t>(numeric_limits<V>::max()) <= static_cast<uintmax_t>(numeric_limits<T>::max()))
^
matter/src/lib/support/SafeInt.h:101:93: error: macro "max" requires 2 arguments, but only 1 given
return static_cast<uintmax_t>(arg) <= static_cast<uintmax_t>(numeric_limits<T>::max());
^
matter/src/lib/support/SafeInt.h:104:101: error: macro "max" requires 2 arguments, but only 1 given
return 0 <= arg && static_cast<uintmax_t>(arg) <= static_cast<uintmax_t>(numeric_limits<T>::max());
^
matter/src/lib/support/SafeInt.h:133:64: error: macro "max" requires 2 arguments, but only 1 given
if (arg <= static_cast<T>(numeric_limits<signed_type>::max()))
^
matter/src/lib/support/SafeInt.h:145:72: error: macro "max" requires 2 arguments, but only 1 given
signed_type diff = static_cast<signed_type>(numeric_limits<T>::max() - arg);
^
In file included from matter/src/lib/dnssd/Resolver.h:31,
from matter/src/lib/dnssd/TxtFields.h:21,
from matter/src/lib/dnssd/Advertiser.h:26,
from matter/src/app/server/CommissioningModeProvider.h:20,
from matter/src/app/server/Dnssd.h:20,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:35:
matter/src/lib/dnssd/Constants.h:56:48: error: cannot resolve overloaded function 'max' based on conversion to type 'const size_t' {aka 'const unsigned int'}
constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
^~~
In file included from matter/src/lib/dnssd/Resolver.h:31,
from matter/src/lib/dnssd/TxtFields.h:21,
from matter/src/lib/dnssd/Advertiser.h:26,
from matter/src/app/server/CommissioningModeProvider.h:20,
from matter/src/app/server/Dnssd.h:20,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:35:
matter/src/lib/dnssd/Constants.h:76:48: error: cannot resolve overloaded function 'max' based on conversion to type 'const size_t' {aka 'const unsigned int'}
constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES);
^~~
In file included from /esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os_mempool.h:32,
from /esp-idf/components/bt/host/nimble/nimble/nimble/include/nimble/ble_hci_trans.h:24,
from /esp-idf/components/bt/host/nimble/esp-hci/include/esp_nimble_hci.h:25,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:24:
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:34:19: error: expected unqualified-id before '(' token
#define max(a, b) ((a)>(b)?(a):(b))
^
matter/src/lib/dnssd/Constants.h:89:48: note: in expansion of macro 'max'
constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commission::kInstanceNameMaxLength);
^~~
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:34:19: error: expected unqualified-id before '(' token
#define max(a, b) ((a)>(b)?(a):(b))
^
matter/src/lib/dnssd/Constants.h:90:48: note: in expansion of macro 'max'
constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commission::kSubTypeMaxNumber);
^~~
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:34:19: error: expected unqualified-id before '(' token
#define max(a, b) ((a)>(b)?(a):(b))
^
matter/src/lib/dnssd/Constants.h:91:48: note: in expansion of macro 'max'
constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commission::kSubTypeMaxLength);
^~~
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:34:19: error: expected unqualified-id before '(' token
#define max(a, b) ((a)>(b)?(a):(b))
^
matter/src/lib/dnssd/Constants.h:92:48: note: in expansion of macro 'max'
constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commission::kSubTypeTotalLength);
^~~
matter/src/lib/dnssd/Advertiser.h: In member function 'Derived& chip::Dnssd::BaseAdvertisingParams<Derived>::SetMac(chip::ByteSpan)':
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:30:19: error: expected unqualified-id before '(' token
#define min(a, b) ((a)<(b)?(a):(b))
^
matter/src/lib/dnssd/Advertiser.h:84:27: note: in expansion of macro 'min'
mMacLength = std::min(mac.size(), kMaxMacSize);
^~~
matter/src/lib/dnssd/Advertiser.h: At global scope:
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:34:19: error: expected unqualified-id before '(' token
#define max(a, b) ((a)>(b)?(a):(b))
^
matter/src/lib/dnssd/Advertiser.h:143:55: note: in expansion of macro 'max'
static constexpr uint8_t kTxtMaxKeySize = std::max(kCommonTxtMaxKeySize, MaxKeyLen(TxtKeyUse::kCommission));
^~~
/esp-idf/components/bt/host/nimble/nimble/porting/nimble/include/os/os.h:34:19: error: expected unqualified-id before '(' token
#define max(a, b) ((a)>(b)?(a):(b))
^
matter/src/lib/dnssd/Advertiser.h:144:55: note: in expansion of macro 'max'
static constexpr uint8_t kTxtMaxValueSize = std::max(kCommonTxtMaxValueSize, MaxValueLen(TxtKeyUse::kCommission));
^~~
In file included from matter/src/messaging/ExchangeMgr.h:33,
from matter/src/app/util/util.h:21,
from matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:36:
matter/src/messaging/ReliableMessageMgr.h:225:69: error: template argument 2 is invalid
ObjectPool<RetransTableEntry, CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE> mRetransTable;
^
matter/src/messaging/ReliableMessageMgr.h: In member function 'void chip::Messaging::ReliableMessageMgr::EnumerateRetransTable(F&&)':
matter/src/messaging/ReliableMessageMgr.h:204:23: error: request for member 'ForEachActiveObject' in '((chip::Messaging::ReliableMessageMgr*)this)->chip::Messaging::ReliableMessageMgr::mRetransTable', which is of non-class type 'int'
mRetransTable.ForEachActiveObject(std::forward<F>(functor));
^~~~~~~~~~~~~~~~~~~
matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp: In member function 'virtual void CommonDeviceCallbacks::DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent*, intptr_t)':
matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:83:13: error: 'ble_hs_is_enabled' was not declared in this scope
if (ble_hs_is_enabled())
^~~~~~~~~~~~~~~~~
matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:83:13: note: maximum limit of 1000 namespaces searched for 'ble_hs_is_enabled'
matter/examples/bridge-app/esp32/third_party/connectedhomeip/examples/platform/esp32/common/CommonDeviceCallbacks.cpp:83:13: note: suggested alternative: 'dhcps_dns_enabled'
if (ble_hs_is_enabled())
It can be solved by direct include host/ble_hs.h in /examples/platform/esp32/common/CommonDeviceCallbacks.cpp
#define min
#define max
#include "host/ble_hs.h"
#undef min
#undef max
Looks like a bug
Bug prevalence
Every time during compilation
GitHub hash of the SDK that was being used
V1.0.0.1
Platform
esp32
Platform Version(s)
4.4.2
Anything else?
No response
The text was updated successfully, but these errors were encountered:
CrowdedFuzzball
changed the title
[BUG] Bridge example over Wi-Fi (CHIPoBLE disabled) seems to be broken
[BUG] Bridge example over Wi-Fi (CHIPoBLE disabled) compilation error
Dec 24, 2022
Hi @CrowdedFuzzball The above error occurs because the nimble related code gets compiled even when CHIPoBLE option is disabled
Added a fix here: #24303
Reproduction steps
Hello,
When trying to get the bridge device example to work over a local network (only over WiFi), I ran into the following problem:
If you disable the CHIPoBLE option in the menuconfig, the project is not built.
Compiller output
It can be solved by direct include host/ble_hs.h in /examples/platform/esp32/common/CommonDeviceCallbacks.cpp
Looks like a bug
Bug prevalence
Every time during compilation
GitHub hash of the SDK that was being used
V1.0.0.1
Platform
esp32
Platform Version(s)
4.4.2
Anything else?
No response
The text was updated successfully, but these errors were encountered: