Greetings,
I've been developing a nrfxlib/zboss based Zigbee device and hitting a wall when trying to add more than one endpoint of a given type.
This is because the endpoint descriptor macros do magic behind-the-scenes type definitions:
- based on the # of in/out clusters and nothing else;
- regardless of any possible previous definitions
which is pretty awful.
I was working around this, in the meantime, by defining only sets of different endpoints (e.g. a light and an outlet), but this isn't what our end product will be, and it's only a stop-gap. The solutions I've read seem to basically force you to re-invent the wheel and declare custom clusters and endpoints, but that's hard and makes the whole ZCL library pretty irrelevant.
Instead, I've changed the library to stop declaring the simple descriptor types as just
zb_af_simple_desc_ ## in_clusters_count ## _ ## out_clusters_count ## _t
and now they include the endpoint name (so e.g. zb_af_simple_desc_4_0_t becomes zb_af_simple_desc_myendpoint_4_0_t which you totally don't care about but avoids the conflicts). This means that if you have three outlet endpoints, you'll end up with three declarations... not so pretty, but who cares, type declarations don't take up space.
So, for anyone facing the same issue I'm attaching the diff/patch file for the nrfxlib Zboss, here.
I may wind up making a PR, if someone from Nordic says this is worthwhile, but for now I have a working dev setup and don't want to break everything by pulling fresh SDK.
Questions/comments/input welcome.
