Using NIMBLE from C++
Posted: Tue Oct 29, 2019 9:53 pm
I'm running a C++ app and trying to fold in NIMBLE, but hitting some roadblocks - I'm also a C/C++ neophyte, and would appreciate some pointers and advice on approaches.
Specifically, I'm trying to get the blemesh example working under C++. As is, under C, it compiles and runs. Taking the C code and extrapolating it into a C++ class, I can get to the point where my C++ is compiling with out error, but individual files in NIMBLE are choking with C++ compile errors, even though the NIBLE code has #ifdef __cplusplus clauses.
The errors are accumulating in access.h and glue.h
Thanks in advance!
Specifically, I'm trying to get the blemesh example working under C++. As is, under C, it compiles and runs. Taking the C code and extrapolating it into a C++ class, I can get to the point where my C++ is compiling with out error, but individual files in NIMBLE are choking with C++ compile errors, even though the NIBLE code has #ifdef __cplusplus clauses.
The errors are accumulating in access.h and glue.h
Code: Select all
esp-idf/components/bt/host/nimble/nimble/nimble/host/mesh/include/mesh/access.h:194:15: error: expected identifier before numeric constant
.groups = { [0 ... (CONFIG_BT_MESH_MODEL_GROUP_COUNT - 1)] = \
Code: Select all
esp-idf/components/bt/host/nimble/nimble/nimble/host/mesh/include/mesh/access.h:194:61: error: expected '{' before '=' token
.groups = { [0 ... (CONFIG_BT_MESH_MODEL_GROUP_COUNT - 1)] = \
Code: Select all
/esp-idf/components/bt/host/nimble/nimble/nimble/host/mesh/include/mesh/access.h:24:35: error: no match for 'operator=' (operand types are 'mesh::<lambda()>' and 'int')
#define BT_MESH_ADDR_UNASSIGNED 0x0000
^~~~~~
Code: Select all
esp-idf/components/bt/host/nimble/nimble/nimble/host/mesh/include/mesh/glue.h:142:32: error: invalid application of 'sizeof' to incomplete type 'bt_mesh_elem []'
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))