"esp_ble_mesh/mesh_core/include"
"esp_ble_mesh/mesh_core/settings"
"esp_ble_mesh/btc/include"
- "esp_ble_mesh/mesh_models/include"
+ "esp_ble_mesh/mesh_models/common/include"
+ "esp_ble_mesh/mesh_models/client/include"
"esp_ble_mesh/api/core/include"
"esp_ble_mesh/api/models/include"
"esp_ble_mesh/api")
"esp_ble_mesh/mesh_core/settings.c"
"esp_ble_mesh/mesh_core/test.c"
"esp_ble_mesh/mesh_core/transport.c"
- "esp_ble_mesh/mesh_models/generic_client.c"
- "esp_ble_mesh/mesh_models/lighting_client.c"
- "esp_ble_mesh/mesh_models/mesh_common.c"
- "esp_ble_mesh/mesh_models/model_common.c"
- "esp_ble_mesh/mesh_models/sensor_client.c"
- "esp_ble_mesh/mesh_models/time_scene_client.c")
+ "esp_ble_mesh/mesh_models/common/mesh_common.c"
+ "esp_ble_mesh/mesh_models/client/client_common.c"
+ "esp_ble_mesh/mesh_models/client/generic_client.c"
+ "esp_ble_mesh/mesh_models/client/lighting_client.c"
+ "esp_ble_mesh/mesh_models/client/sensor_client.c"
+ "esp_ble_mesh/mesh_models/client/time_scene_client.c")
endif()
if(CONFIG_BT_NIMBLE_ENABLED)
endif
ifdef CONFIG_BLE_MESH
- COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_core \
- esp_ble_mesh/mesh_core/include \
- esp_ble_mesh/mesh_core/settings \
- esp_ble_mesh/btc/include \
- esp_ble_mesh/mesh_models/include \
- esp_ble_mesh/api/core/include \
- esp_ble_mesh/api/models/include \
+ COMPONENT_ADD_INCLUDEDIRS += esp_ble_mesh/mesh_core \
+ esp_ble_mesh/mesh_core/include \
+ esp_ble_mesh/mesh_core/settings \
+ esp_ble_mesh/btc/include \
+ esp_ble_mesh/mesh_models/common/include \
+ esp_ble_mesh/mesh_models/client/include \
+ esp_ble_mesh/api/core/include \
+ esp_ble_mesh/api/models/include \
esp_ble_mesh/api
COMPONENT_SRCDIRS += esp_ble_mesh/mesh_core \
esp_ble_mesh/mesh_core/settings \
esp_ble_mesh/btc \
- esp_ble_mesh/mesh_models \
+ esp_ble_mesh/mesh_models/common \
+ esp_ble_mesh/mesh_models/client \
esp_ble_mesh/api/core \
esp_ble_mesh/api/models
endif
#include "lighting_client.h"
#include "sensor_client.h"
#include "time_scene_client.h"
-#include "model_common.h"
+#include "client_common.h"
#include "btc_ble_mesh_prov.h"
#include "btc_ble_mesh_config_model.h"
#include "mesh_access.h"
#include "mesh_kernel.h"
-#include "model_common.h"
+#include "client_common.h"
/**
* @brief Bluetooth Mesh
#include "mesh_access.h"
#include "mesh_kernel.h"
-#include "model_common.h"
+#include "client_common.h"
/**
* @brief Bluetooth Mesh
#include "settings.h"
#include "transport.h"
#include "mesh_common.h"
-#include "model_common.h"
+#include "client_common.h"
#include "provisioner_main.h"
/* The transport layer needs at least three buffers for itself to avoid
#include "mesh_main.h"
#include "mesh.h"
-#include "model_common.h"
+#include "client_common.h"
bt_mesh_client_node_t *bt_mesh_is_model_message_publish(struct bt_mesh_model *model,
struct bt_mesh_msg_ctx *ctx,
return 0;
}
-u8_t bt_mesh_get_model_role(struct bt_mesh_model *model, bool srv_send)
-{
- bt_mesh_client_common_t *client = NULL;
-
- if (srv_send) {
- BT_DBG("%s, Message is sent by a server model", __func__);
- return NODE;
- }
-
- if (!model || !model->user_data) {
- BT_ERR("%s, Invalid parameter", __func__);
- return ROLE_NVAL;
- }
-
- client = (bt_mesh_client_common_t *)model->user_data;
-
- return client->msg_role;
-}
*/
int bt_mesh_set_model_role(bt_mesh_role_param_t *common);
-/**
- * @brief This function gets msg role for stack internal use.
- *
- * @param[in] model: Pointer to the model structure
- * @param[in] srv_send: Indicate if the message is sent by a server model
- *
- * @return 0 - Node, 1 - Provisioner
- */
-u8_t bt_mesh_get_model_role(struct bt_mesh_model *model, bool srv_send);
-
#endif /* _MODEL_COMMON_H_ */
#include "mesh_access.h"
#include "mesh_kernel.h"
-#include "model_common.h"
+#include "client_common.h"
/* Generic client model common structure */
typedef bt_mesh_client_common_t bt_mesh_generic_client_t;
#include "mesh_access.h"
#include "mesh_kernel.h"
-#include "model_common.h"
+#include "client_common.h"
/* Light client model common structure */
typedef bt_mesh_client_common_t bt_mesh_light_client_t;
#include "mesh_access.h"
#include "mesh_kernel.h"
-#include "model_common.h"
+#include "client_common.h"
/* Sensor Client Model Context */
extern const struct bt_mesh_model_op sensor_cli_op[];
#include "mesh_access.h"
#include "mesh_kernel.h"
-#include "model_common.h"
+#include "client_common.h"
/* Time scene client model common structure */
typedef bt_mesh_client_common_t bt_mesh_time_scene_client_t;
#include "mesh_types.h"
#include "mesh_buf.h"
#include "mesh_trace.h"
+#include "mesh_access.h"
/**
* @brief This function allocates memory to store outgoing message.
*/
void bt_mesh_free_buf(struct net_buf_simple *buf);
+/**
+ * @brief This function gets device role for stack internal use.
+ *
+ * @Note Currently Provisioner only support client models, Node supports
+ * client models and server models. Hence if srv_send is set to be
+ * TRUE, then role NODE will be returned.
+ *
+ * @param[in] model: Pointer to the model structure
+ * @param[in] srv_send: Indicate if the message is sent by a server model
+ *
+ * @return 0 - Node, 1 - Provisioner
+ */
+u8_t bt_mesh_get_model_role(struct bt_mesh_model *model, bool srv_send);
+
#endif /* _MESH_COMMON_H_ */
\ No newline at end of file
#include <string.h>
#include <errno.h>
+#include "client_common.h"
#include "mesh_common.h"
struct net_buf_simple *bt_mesh_alloc_buf(u16_t size)
osi_free(buf);
}
}
+
+u8_t bt_mesh_get_model_role(struct bt_mesh_model *model, bool srv_send)
+{
+ bt_mesh_client_common_t *client = NULL;
+
+ if (srv_send) {
+ BT_DBG("%s, Message is sent by a server model", __func__);
+ return NODE;
+ }
+
+ if (!model || !model->user_data) {
+ BT_ERR("%s, Invalid parameter", __func__);
+ return ROLE_NVAL;
+ }
+
+ client = (bt_mesh_client_common_t *)model->user_data;
+
+ return client->msg_role;
+}