mesh: Add header file support for C++

Add preprocessor directive for C++ compatibility.
This commit is contained in:
Michał Narajowski
2019-01-31 17:50:26 +01:00
parent 1630de1a67
commit 9b77b4cfcd
11 changed files with 86 additions and 0 deletions
+8
View File
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
#define BT_MESH_ADDR_UNASSIGNED 0x0000
#define BT_MESH_ADDR_ALL_NODES 0xffff
#define BT_MESH_ADDR_PROXIES 0xfffc
@@ -408,6 +412,10 @@ struct bt_mesh_comp {
struct bt_mesh_elem *elem;
};
#ifdef __cplusplus
}
#endif
/**
* @}
*/
+7
View File
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** Mesh Configuration Client Model Context */
struct bt_mesh_cfg_cli {
struct bt_mesh_model *model;
@@ -219,6 +223,9 @@ int bt_mesh_cfg_hb_pub_get(u16_t net_idx, u16_t addr,
s32_t bt_mesh_cfg_cli_timeout_get(void);
void bt_mesh_cfg_cli_timeout_set(s32_t timeout);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
+7
View File
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** Mesh Configuration Server Model Context */
struct bt_mesh_cfg_srv {
struct bt_mesh_model *model;
@@ -62,6 +66,9 @@ extern const struct bt_mesh_model_op bt_mesh_cfg_srv_op[];
BT_MESH_MODEL(BT_MESH_MODEL_ID_CFG_SRV, \
bt_mesh_cfg_srv_op, NULL, srv_data)
#ifdef __cplusplus
}
#endif
/**
* @}
+8
View File
@@ -45,6 +45,10 @@
#include "config/config.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define u8_t uint8_t
#define s8_t int8_t
#define u16_t uint16_t
@@ -455,4 +459,8 @@ settings_load(void)
#define BUILD_ASSERT(cond) _Static_assert(cond, "")
#ifdef __cplusplus
}
#endif
#endif /* _MESH_GLUE_ */
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** Mesh Health Client Model Context */
struct bt_mesh_health_cli {
struct bt_mesh_model *model;
@@ -65,6 +69,10 @@ int bt_mesh_health_attention_set(u16_t net_idx, u16_t addr, u16_t app_idx,
s32_t bt_mesh_health_cli_timeout_get(void);
void bt_mesh_health_cli_timeout_set(s32_t timeout);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
struct bt_mesh_health_srv_cb {
/* Fetch current faults */
int (*fault_get_cur)(struct bt_mesh_model *model, u8_t *test_id,
@@ -84,6 +88,10 @@ extern const struct bt_mesh_model_op bt_mesh_health_srv_op[];
BT_MESH_MODEL(BT_MESH_MODEL_ID_HEALTH_SRV, \
bt_mesh_health_srv_op, pub, srv)
#ifdef __cplusplus
}
#endif
/**
* @}
*/
+8
View File
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
BT_MESH_NO_OUTPUT = 0,
BT_MESH_BLINK = BIT(0),
@@ -358,6 +362,10 @@ int bt_mesh_lpn_poll(void);
*/
void bt_mesh_lpn_set_cb(void (*cb)(u16_t friend_addr, bool established));
#ifdef __cplusplus
}
#endif
/**
* @}
*/
@@ -7,6 +7,10 @@
#ifndef __MODEL_CLI_H__
#define __MODEL_CLI_H__
#ifdef __cplusplus
extern "C" {
#endif
struct bt_mesh_gen_model_cli {
struct bt_mesh_model *model;
@@ -40,4 +44,8 @@ int bt_mesh_gen_level_set(u16_t net_idx, u16_t addr, u16_t app_idx,
s16_t val, s16_t *state);
int bt_mesh_gen_model_cli_init(struct bt_mesh_model *model, bool primary);
#ifdef __cplusplus
}
#endif
#endif /* __MODEL_CLI_H__ */
@@ -7,6 +7,10 @@
#ifndef __MODEL_SRV_H__
#define __MODEL_SRV_H__
#ifdef __cplusplus
extern "C" {
#endif
struct bt_mesh_gen_onoff_srv_cb {
int (*get)(struct bt_mesh_model *model, u8_t *state);
int (*set)(struct bt_mesh_model *model, u8_t state);
@@ -45,4 +49,8 @@ void bt_mesh_set_gen_onoff_srv_cb(struct bt_mesh_gen_onoff_srv_cb *gen_onoff_cb)
void bt_mesh_set_gen_level_srv_cb(struct bt_mesh_gen_level_srv_cb *gen_level_cb);
void bt_mesh_set_light_lightness_srv_cb(struct bt_mesh_light_lightness_srv_cb *light_lightness_cb);
#ifdef __cplusplus
}
#endif
#endif /* __MODEL_SRV_H__ */
+8
View File
@@ -10,8 +10,16 @@
#ifndef __BT_MESH_PORTING_H
#define __BT_MESH_PORTING_H
#ifdef __cplusplus
extern "C" {
#endif
void mesh_adv_thread(void *args);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
+8
View File
@@ -17,6 +17,10 @@
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enable advertising with Node Identity.
*
@@ -28,6 +32,10 @@
*/
int bt_mesh_proxy_identity_enable(void);
#ifdef __cplusplus
}
#endif
/**
* @}
*/