Calling "BT_MESH_ELEM" from a C++ file

Hi,

I have a model_handler.c which builds fine, but the moment I change it to model_handler.cpp, I get build errors saying "duplicate descriptor is not allowed".

I am struggling to build "BT_MESH_ELEM" definition in a C++ file

static struct bt_mesh_elem elements[] = {
	BT_MESH_ELEM(
		1,
		BT_MESH_MODEL_LIST(
			BT_MESH_MODEL_CFG_SRV,
			BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub)),
		BT_MESH_MODEL_LIST(BT_MESH_MODEL_CHAT_CLI(&chat))),
};

Please suggest how I can get this to build.

Thanks,

Related