I'm currently porting all my C++ code from SD130 SDK10 to SD132 SDK12 and I also upgrading from device_manger to peer_manager.
I've noticed that in peer_manager_types.h file there is a declaration with an empty array:
/**@brief Data on a local GATT database.
uint32_t flags; /**< @brief Flags that describe the database attributes. */
uint16_t len; /**< @brief Size of the attribute array. */
uint8_t data; /**< @brief Array to hold the database attributes. */
.. and this won't compile even if the #ifdef __cplusplus precompiler instruction is set. To fix that I've just sized the array data with one element.
It may be my poor understanding of C but wasn't it meant for data to be an array pointer so it should corrected to uint8_t* data?
Yes of course @Keton, we can set it as a pointer... I've fixed this problem with an array of 1 element just to respect you way it's done in all other header's files, like ble_gattc.h.
It seems like this is C99 feature only. Some compilers might optionally add this feature but it seems not so common. Peer manager header files did not add support for CPP by adding#ifdef __cplusplus`, so they are not compiled and tested with any CPP compilers.
seems not so common. Peer manager header files did not add support for CPP by adding
Thanks Aryan for your comment...
By the way, you Nordic guys have changed this in the header files of the SoftDevice API (ble_gattc.h, ble_gatts.h & ble_l2cap.h) from SDK10 to SDK11 in the same way I did here for the peer_manager module. That's why I thought it was an oversight...
hi Patrice, this could be an oversight, i will inform the designer to change it but i cannot create any ticket on it. I hope this is ok.
just talked to the developer and he will change this member to data;