doc: fix WARNING: Invalid definition" due to unamed structs/unions
Fix with a workaround in unnamed unions / structs in bluetooth, i2c, sensor and uart. Current documentation parsers (sphinx under Doxygen) don't seem to understand well unnamed structs / unions. They will not generate any documentation for any documented members (see left side of http://imgur.com/mcpBXWc). A workaround is to make the parser think there is something like a struct/union/enum name that is actually something with no effect to the compiler. Naming it with __unnamed_workaround__ ensures it is clear it is a workaround while we wait for a final fix. It is #defined to be a NO-OP to the compiler and rearrange the member documentation as *@param* so we have some documentation that the non-worked around code fails to document. Anonymous structs/union that declare a variable are just given an internal name. Workarounds documented in the contribution guidelines. Change-Id: I4d32cf444f3c5e7d2fb11581e4b41f80e93c9786 Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This commit is contained in:
parent
587e5a5198
commit
ecc4c765cc
7 changed files with 185 additions and 30 deletions
|
@ -135,19 +135,22 @@ enum {
|
|||
BT_CONN_ROLE_SLAVE,
|
||||
};
|
||||
|
||||
/** Connection Info Structure */
|
||||
/** @brief Connection Info Structure
|
||||
*
|
||||
*
|
||||
* @param type Connection Type
|
||||
* @param role Connection Role
|
||||
* @param le LE Connection specific Info
|
||||
* @param br BR/EDR Connection specific Info
|
||||
*/
|
||||
struct bt_conn_info {
|
||||
/** Connection Type */
|
||||
uint8_t type;
|
||||
|
||||
/** Connection Role */
|
||||
uint8_t role;
|
||||
|
||||
union {
|
||||
/** LE Connection specific Info */
|
||||
union __unnamed_workaround__ {
|
||||
struct bt_conn_le_info le;
|
||||
|
||||
/** BR/EDR Connection specific Info */
|
||||
struct bt_conn_br_info br;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue