duplicate designator is not allowed C/C++ (2906)

Hi,

There is code for vendor model element creation in nCS provided Chat client sample, as in below:

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))),
};

This works fine in "model_handler.c",

But when I import the same code to the file "model_handler.cpp", I get a build error saying 

On : 

BT_MESH_ELEM(

I cannot avoid C++ here, kindly suggest for me to solve this.
Thanks,
Ubaid
Parents Reply Children
No Data
Related