}
API int bluetooth_mesh_netkey_get_all_appkey(bluetooth_mesh_network_t *network,
- uint16_t netkey_idx,GPtrArray **appkeys)
+ uint16_t netkey_idx, GPtrArray **appkeys)
{
return BLUETOOTH_ERROR_NONE;
}
bluetooth_mesh_provisioning_result_t *prov_result = NULL;
prov_result = g_malloc0(sizeof(bluetooth_mesh_provisioning_result_t));
- memcpy(prov_result->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH);
- memcpy(prov_result->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH);
+ g_strlcpy(prov_result->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ g_strlcpy(prov_result->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
bt_event->event = BLUETOOTH_EVENT_MESH_PROVISIONING_FINISHED;
{
return BLUETOOTH_ERROR_NONE;
}
+
+API int bluetooth_mesh_browse_remote_node(bluetooth_mesh_node_discover_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_node_discover_t *node_result = NULL;
+
+ node_result = g_malloc0(sizeof(bluetooth_mesh_node_discover_t));
+ g_strlcpy(node_result->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
+ g_strlcpy(node_result->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
+ node_result->unicast = req->unicast;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_NODE_BROWSED;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = node_result;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_node_browse_vendor_features(bluetooth_mesh_node_features_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_node_features_t *node_feature = NULL;
+
+ node_feature = g_malloc0(sizeof(bluetooth_mesh_node_features_t));
+ g_strlcpy(node_feature->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
+ g_strlcpy(node_feature->dev_uuid, req->dev_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
+ node_feature->unicast = req->unicast;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_NODE_VENDOR_FEATURES;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = node_feature;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_node_get_all_netkeys(bluetooth_mesh_node_discover_t *node, GPtrArray **netkeys)
+{
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_node_get_all_appkeys(bluetooth_mesh_node_discover_t *req, GPtrArray **appkeys)
+{
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_node_ttl_execute(bluetooth_mesh_node_ttl_info_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_node_ttl_info_t *node_ttl = NULL;
+
+ node_ttl = g_malloc0(sizeof(bluetooth_mesh_node_ttl_info_t));
+ g_strlcpy(node_ttl->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
+ node_ttl->unicast = req->unicast;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_NODE_TTL_CONFIGURED;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = node_ttl;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_node_configure_key(bluetooth_mesh_key_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_key_configure_t *node_config = NULL;
+
+ node_config = g_malloc0(sizeof(bluetooth_mesh_key_configure_t));
+ g_strlcpy(node_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH + 1);
+ node_config->primary_unicast = req->primary_unicast;
+ node_config->is_netkey = req->is_netkey;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_NODE_KEY_CONFIGURED;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = node_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_configure_appkey(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+ model_config->appkey_idx = req->appkey_idx;
+ model_config->is_bind = req->is_bind;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_APPKEY_BIND;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_get_all_appkeys(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_APPKEY_LIST;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_configure_group_sub(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+ model_config->op = req->op;
+ model_config->sub_addr = req->sub_addr;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_CONFGURED;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_configure_virtual_group_sub(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+ model_config->op = req->op;
+ model_config->sub_addr = req->sub_addr;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_VIRTUAL_SUBSCRIPTION_CONFGURED;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_get_subscriptopn_list(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_SUBSCRIPTION_LIST;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_set_publication(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+ model_config->appkey_idx = req->appkey_idx;
+ model_config->pub_addr = req->pub_addr;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
+
+API int bluetooth_mesh_model_get_publication(bluetooth_mesh_model_configure_t *req)
+{
+ bluetooth_event_param_t *bt_event = NULL;
+ bluetooth_mesh_model_configure_t *model_config = NULL;
+
+ model_config = g_malloc0(sizeof(bluetooth_mesh_model_configure_t));
+ g_strlcpy(model_config->net_uuid, req->net_uuid, BLUETOOTH_MESH_NETWORK_UUID_STRING_LENGTH +1);
+ model_config->primary_unicast = req->primary_unicast;
+ model_config->elem_index = req->elem_index;
+ model_config->model = req->model;
+ model_config->appkey_idx = req->appkey_idx;
+ model_config->pub_addr = req->pub_addr;
+
+ bt_event = g_malloc0(sizeof(bluetooth_event_param_t));
+ bt_event->event = BLUETOOTH_EVENT_MESH_MODEL_PUBLICATION_STATUS;
+ bt_event->result = BLUETOOTH_ERROR_NONE;
+ bt_event->param_data = model_config;
+
+ g_timeout_add(500, __mesh_event_cb, bt_event);
+ return BLUETOOTH_ERROR_NONE;
+}
extern int utc_bluetooth_bt_mesh_authentication_set_request_cb_p(void);
extern int utc_bluetooth_bt_mesh_authentication_reply_p(void);
extern int utc_bluetooth_bt_mesh_network_set_provisioning_capabilities_p(void);
+extern int utc_bluetooth_bt_mesh_network_discover_node_p(void);
+extern int utc_bluetooth_bt_mesh_node_get_features_p(void);
+extern int utc_bluetooth_bt_mesh_node_foreach_netkeys_p(void);
+extern int utc_bluetooth_bt_mesh_node_foreach_appkeys_p(void);
+extern int utc_bluetooth_bt_mesh_node_get_ttl_p(void);
+extern int utc_bluetooth_bt_mesh_node_set_ttl_p(void);
+extern int utc_bluetooth_bt_mesh_node_configure_netkey_p(void);
+extern int utc_bluetooth_bt_mesh_node_configure_appkey_p(void);
+extern int utc_bluetooth_bt_mesh_model_bind_appkey_p(void);
+extern int utc_bluetooth_bt_mesh_model_unbind_appkey_p(void);
+extern int utc_bluetooth_bt_mesh_model_get_appkey_list_p(void);
+extern int utc_bluetooth_bt_mesh_model_configure_group_subscription_p(void);
+extern int utc_bluetooth_bt_mesh_model_configure_virtual_group_subscription_p(void);
+extern int utc_bluetooth_bt_mesh_model_get_subscription_list_p(void);
+extern int utc_bluetooth_bt_mesh_model_set_publication_p(void);
+extern int utc_bluetooth_bt_mesh_model_get_publication_p(void);
+extern int utc_bluetooth_bt_mesh_appkey_get_netkey_p(void);
+
+
extern void utc_bluetooth_mesh_network_negative_startup(void);
extern void utc_bluetooth_mesh_network_negative_cleanup(void);
extern int utc_bluetooth_bt_mesh_deinitialize_n(void);
extern int utc_bluetooth_bt_mesh_authentication_set_request_cb_n(void);
extern int utc_bluetooth_bt_mesh_authentication_reply_n(void);
extern int utc_bluetooth_bt_mesh_network_set_provisioning_capabilities_n(void);
+extern int utc_bluetooth_bt_mesh_network_discover_node_n(void);
+extern int utc_bluetooth_bt_mesh_node_get_features_n(void);
+extern int utc_bluetooth_bt_mesh_node_foreach_netkeys_n(void);
+extern int utc_bluetooth_bt_mesh_node_foreach_appkeys_n(void);
+extern int utc_bluetooth_bt_mesh_node_get_ttl_n(void);
+extern int utc_bluetooth_bt_mesh_node_set_ttl_n(void);
+extern int utc_bluetooth_bt_mesh_node_configure_netkey_n(void);
+extern int utc_bluetooth_bt_mesh_node_configure_appkey_n(void);
+extern int utc_bluetooth_bt_mesh_model_bind_appkey_n(void);
+extern int utc_bluetooth_bt_mesh_model_unbind_appkey_n(void);
+extern int utc_bluetooth_bt_mesh_model_get_appkey_list_n(void);
+extern int utc_bluetooth_bt_mesh_model_configure_group_subscription_n(void);
+extern int utc_bluetooth_bt_mesh_model_configure_virtual_group_subscription_n(void);
+extern int utc_bluetooth_bt_mesh_model_get_subscription_list_n(void);
+extern int utc_bluetooth_bt_mesh_model_set_publication_n(void);
+extern int utc_bluetooth_bt_mesh_model_get_publication_n(void);
+extern int utc_bluetooth_bt_mesh_appkey_get_netkey_n(void);
testcase tc_array[] = {
{"utc_bluetooth_bt_mesh_authentication_set_request_cb_p",utc_bluetooth_bt_mesh_authentication_set_request_cb_p,utc_bluetooth_mesh_network_positive_startup, utc_bluetooth_mesh_network_positive_cleanup},
{"utc_bluetooth_bt_mesh_authentication_reply_p",utc_bluetooth_bt_mesh_authentication_reply_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
{"utc_bluetooth_bt_mesh_network_set_provisioning_capabilities_p",utc_bluetooth_bt_mesh_network_set_provisioning_capabilities_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_network_discover_node_p",utc_bluetooth_bt_mesh_network_discover_node_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_get_features_p",utc_bluetooth_bt_mesh_node_get_features_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_foreach_netkeys_p",utc_bluetooth_bt_mesh_node_foreach_netkeys_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_foreach_appkeys_p",utc_bluetooth_bt_mesh_node_foreach_appkeys_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_get_ttl_p",utc_bluetooth_bt_mesh_node_get_ttl_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_set_ttl_p",utc_bluetooth_bt_mesh_node_set_ttl_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_configure_netkey_p",utc_bluetooth_bt_mesh_node_configure_netkey_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_node_configure_appkey_p",utc_bluetooth_bt_mesh_node_configure_appkey_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_bind_appkey_p",utc_bluetooth_bt_mesh_model_bind_appkey_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_unbind_appkey_p",utc_bluetooth_bt_mesh_model_unbind_appkey_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_get_appkey_list_p",utc_bluetooth_bt_mesh_model_get_appkey_list_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_configure_group_subscription_p",utc_bluetooth_bt_mesh_model_configure_group_subscription_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_configure_virtual_group_subscription_p",utc_bluetooth_bt_mesh_model_configure_virtual_group_subscription_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_get_subscription_list_p",utc_bluetooth_bt_mesh_model_get_subscription_list_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_set_publication_p",utc_bluetooth_bt_mesh_model_set_publication_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_model_get_publication_p",utc_bluetooth_bt_mesh_model_get_publication_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
+ {"utc_bluetooth_bt_mesh_appkey_get_netkey_p",utc_bluetooth_bt_mesh_appkey_get_netkey_p,utc_bluetooth_mesh_network_positive_startup,utc_bluetooth_mesh_network_positive_cleanup},
{"utc_bluetooth_bt_mesh_deinitialize_n",utc_bluetooth_bt_mesh_deinitialize_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
{"utc_bluetooth_bt_mesh_create_node_n",utc_bluetooth_bt_mesh_create_node_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
{"utc_bluetooth_bt_mesh_node_destroy_n",utc_bluetooth_bt_mesh_node_destroy_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
{"utc_bluetooth_bt_mesh_authentication_set_request_cb_n",utc_bluetooth_bt_mesh_authentication_set_request_cb_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
{"utc_bluetooth_bt_mesh_authentication_reply_n",utc_bluetooth_bt_mesh_authentication_reply_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
{"utc_bluetooth_bt_mesh_network_set_provisioning_capabilities_n",utc_bluetooth_bt_mesh_network_set_provisioning_capabilities_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_network_discover_node_n",utc_bluetooth_bt_mesh_network_discover_node_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_get_features_n",utc_bluetooth_bt_mesh_node_get_features_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_foreach_netkeys_n",utc_bluetooth_bt_mesh_node_foreach_netkeys_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_foreach_appkeys_n",utc_bluetooth_bt_mesh_node_foreach_appkeys_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_get_ttl_n",utc_bluetooth_bt_mesh_node_get_ttl_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_set_ttl_n",utc_bluetooth_bt_mesh_node_set_ttl_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_configure_netkey_n",utc_bluetooth_bt_mesh_node_configure_netkey_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_node_configure_appkey_n",utc_bluetooth_bt_mesh_node_configure_appkey_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_bind_appkey_n",utc_bluetooth_bt_mesh_model_bind_appkey_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_unbind_appkey_n",utc_bluetooth_bt_mesh_model_unbind_appkey_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_get_appkey_list_n",utc_bluetooth_bt_mesh_model_get_appkey_list_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_configure_group_subscription_n",utc_bluetooth_bt_mesh_model_configure_group_subscription_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_get_subscription_list_n",utc_bluetooth_bt_mesh_model_get_subscription_list_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_set_publication_n",utc_bluetooth_bt_mesh_model_set_publication_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_model_get_publication_n",utc_bluetooth_bt_mesh_model_get_publication_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
+ {"utc_bluetooth_bt_mesh_appkey_get_netkey_n",utc_bluetooth_bt_mesh_appkey_get_netkey_n,utc_bluetooth_mesh_network_negative_startup,utc_bluetooth_mesh_network_negative_cleanup},
{NULL, NULL}
};
static bt_mesh_network_h network = NULL;
static char *token;
static char *network_name = "test-mesh";
+static bt_mesh_node_h node_h = NULL;
+static bt_mesh_element_h elem_h = NULL;
+static bt_mesh_model_h model_h = NULL;
static bt_mesh_netkey_h netkey_h = NULL;
static bt_mesh_appkey_h appkey_h = NULL;
int utc_bluetooth_bt_mesh_node_create_element_n(void)
{
int ret = BT_ERROR_NONE;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create_element(node, &elem);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create_element(node, &elem);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_network_h net_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_network_h net = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
+ ret = bt_mesh_node_create(&features, &node);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create_element(node, &elem);
- ret = bt_mesh_node_get_network(NULL, &net_h);
+ ret = bt_mesh_node_get_network(NULL, &net);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_node_get_network(node_h, &net_h);
+ ret = bt_mesh_node_get_network(node, &net);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_element_h elem_h1 = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_element_h elem1 = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h1);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
+ ret = bt_mesh_node_create_element(node, &elem1);
mod_id.model_id = BT_MESH_MODEL_ID_CFG_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h1, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem1, &mod_id, &model);
assert_eq(ret, BT_ERROR_OPERATION_FAILED);
} else {
- ret = bt_mesh_element_create_model(elem_h1, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem1, &mod_id, &model);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
memset(&mod_id, 0x00, sizeof(bt_mesh_model_id_s));
- model_h = NULL;
- ret = bt_mesh_model_get_id(model_h, &mod_id);
+ ret = bt_mesh_model_get_id(NULL, &mod_id);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_model_get_id(model_h, &mod_id);
+ ret = bt_mesh_model_get_id(model, &mod_id);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
- memset(&mod_id, 0x00, sizeof(bt_mesh_model_id_s));
- model_h = NULL;
+ ret = bt_mesh_node_destroy(node);
- ret = bt_mesh_model_destroy(model_h);
+ ret = bt_mesh_model_destroy(model);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_model_destroy(model_h);
+ ret = bt_mesh_model_destroy(model);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
- elem_h = NULL;
- ret = bt_mesh_model_get_element(model_h, &elem_h);
+ elem = NULL;
+ ret = bt_mesh_model_get_element(model, &elem);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_model_get_element(model_h, &elem_h);
+ ret = bt_mesh_model_get_element(model, &elem);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
ret = bt_mesh_deinitialize();
- ret = bt_mesh_element_destroy(elem_h);
+ ret = bt_mesh_element_destroy(elem);
assert_eq(ret, BT_ERROR_NOT_INITIALIZED);
} else {
- ret = bt_mesh_element_destroy(elem_h);
+ ret = bt_mesh_element_destroy(elem);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
- elem_h = NULL;
- ret = bt_mesh_element_get_node(elem_h, &node_h);
+ elem = NULL;
+ ret = bt_mesh_element_get_node(elem, &node);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_element_get_node(elem_h, &node_h);
+ ret = bt_mesh_element_get_node(elem, &node);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
- ret = bt_mesh_node_foreach_element(node_h, NULL, NULL);
+ ret = bt_mesh_node_foreach_element(node, NULL, NULL);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_node_foreach_element(node_h, __bt_mesh_node_foreach_elem_cb, NULL);
+ ret = bt_mesh_node_foreach_element(node, __bt_mesh_node_foreach_elem_cb, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h element_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h element = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &element_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &element);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(element_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(element, &mod_id, &model);
- ret = bt_mesh_element_foreach_models(element_h, NULL, NULL);
+ ret = bt_mesh_element_foreach_models(element, NULL, NULL);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_element_foreach_models(element_h, __bt_mesh_elem_foreach_model_cb, NULL);
+ ret = bt_mesh_element_foreach_models(element, __bt_mesh_elem_foreach_model_cb, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
- ret = bt_mesh_network_create(node_h, (const char*)network_name, &network, NULL);
+ ret = bt_mesh_network_create(node, (const char*)network_name, &network, NULL);
assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
} else {
- ret = bt_mesh_network_create(node_h, (const char*)network_name, &network, NULL);
+ ret = bt_mesh_network_create(node, (const char*)network_name, &network, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
return 0;
}
+
+int utc_bluetooth_bt_mesh_network_discover_node_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ char* dev_uuid = "tempName";
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_network_add_netkey(network, &netkey_h);
+
+ ret = bt_mesh_network_discover_node(network, (const char*)dev_uuid, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_network_discover_node(network, (const char*)dev_uuid, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_get_features_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_get_features(node_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_get_features(node_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_foreach_netkeys_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_foreach_netkeys(node_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_foreach_netkeys(node_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_foreach_appkeys_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_netkey_add_appkey(netkey_h, &appkey_h);
+
+ ret = bt_mesh_node_foreach_appkeys(node_h, netkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_foreach_appkeys(node_h, netkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_get_ttl_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_get_ttl(node_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_get_ttl(node_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_set_ttl_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ int ttl = 120;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_set_ttl(node_h, ttl, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_set_ttl(node_h, ttl, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_configure_netkey_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_node_key_configuration_e config = 0;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_configure_netkey(node_h, config, netkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_configure_netkey(node_h, config, netkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_configure_appkey_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_node_key_configuration_e config = 0;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_configure_appkey(node_h, config, appkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_node_configure_appkey(node_h, config, appkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_model_bind_appkey_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_bind_appkey(model_h, appkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_bind_appkey(model_h, appkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_model_unbind_appkey_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_unbind_appkey(model_h, appkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_unbind_appkey(model_h, appkey_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_model_get_appkey_list_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_get_appkey_list(model_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_get_appkey_list(model_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_configure_group_subscription_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_model_subscription_op_e op = BT_MESH_MODEL_SUBSCRIPTION_ADD;
+ bt_mesh_group_h group_h = NULL;
+ uint16_t group_addr = 0xc001;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_mesh_network_create_group(network, group_addr, &group_h);
+
+ ret = bt_mesh_model_configure_group_subscription(op, model_h, group_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_configure_group_subscription(op, model_h, group_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_model_configure_virtual_group_subscription_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_model_subscription_op_e op = BT_MESH_MODEL_SUBSCRIPTION_ADD;
+ bt_mesh_group_h group_h = NULL;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_mesh_network_create_virtual_group(network, &group_h);
+
+ ret = bt_mesh_model_configure_virtual_group_subscription(op, model_h, group_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_configure_virtual_group_subscription(op, model_h, group_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_get_subscription_list_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_get_subscription_list(model_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_get_subscription_list(model_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_set_publication_n(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_model_pub_params_s param;
+ bt_mesh_group_h group_h = NULL;
+ uint16_t group_addr = 0xc001;
+
+ memset(¶m, 0x00, sizeof(bt_mesh_model_pub_params_s));
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ param.ttl = 120;
+ param.num_steps = 10;
+ param.per_res = BT_MESH_PUBLICATION_STEP_RES_1_SECOND;
+ param.retrans_cnt = BT_MESH_MAX_PUBISH_RETRANSMIT_COUNT;
+ param.retrans_step = BT_MESH_MAX_PUBISH_RETRANSMIT_INTERVAL_STEPS;
+
+ ret = bt_mesh_network_create_group(network, group_addr, &group_h);
+
+ ret = bt_mesh_model_set_publication(model_h, appkey_h, group_h, ¶m,
+ NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_set_publication(model_h, appkey_h, group_h, ¶m,
+ NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_model_get_publication_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_get_publication(model_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_model_get_publication(model_h, NULL, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_appkey_get_netkey_n(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_appkey_get_netkey(appkey_h, NULL);
+ assert_eq(ret, BT_ERROR_INVALID_PARAMETER);
+ } else {
+ ret = bt_mesh_appkey_get_netkey(appkey_h, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
static bt_mesh_network_h network = NULL;
static char *token;
static char *network_name = "test-mesh";
+static bt_mesh_node_h node_h = NULL;
+static bt_mesh_element_h elem_h = NULL;
+static bt_mesh_model_h model_h = NULL;
static bt_mesh_netkey_h netkey_h = NULL;
static bt_mesh_appkey_h appkey_h = NULL;
g_main_loop_quit(mainloop);
}
+static void __bt_mesh_node_discover_status_cb(int result, bt_mesh_network_h network,
+ bt_mesh_node_h node_param, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_node_features_cb(int result, bt_mesh_node_h node,
+ bt_mesh_node_features_s *features, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static bool __bt_mesh_node_foreach_netkeys_cb(int result, bt_mesh_node_h node, int total,
+ bt_mesh_netkey_h netkey, uint16_t netkey_index, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+
+ return true;
+}
+
+static bool __bt_mesh_node_foreach_appkeys_cb(int result, bt_mesh_node_h node, int total,
+ bt_mesh_netkey_h netkey, bt_mesh_appkey_h appkey,
+ uint16_t appkey_index, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+
+ return true;
+}
+
+static void __bt_mesh_node_ttl_cb(int result, bt_mesh_node_h node,
+ bt_mesh_node_ttl_operation_e ttl_op, uint8_t ttl, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_node_configure_netkey_cb(int result, bt_mesh_node_key_configuration_e op,
+ bt_mesh_node_h node, bt_mesh_netkey_h netkey, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_node_configure_appkey_cb(int result, bt_mesh_node_key_configuration_e op,
+ bt_mesh_node_h node, bt_mesh_netkey_h netkey, bt_mesh_appkey_h appkey, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_model_bind_cb(int result, bt_mesh_model_h model,
+ bt_mesh_appkey_h appkey, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_model_unbind_cb(int result, bt_mesh_model_h model,
+ bt_mesh_appkey_h appkey, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_model_appkey_list_cb(int result, bt_mesh_model_h model,
+ int total, const GSList *appkeylist, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static void __bt_mesh_model_subscription_op_cb(int result, bt_mesh_model_subscription_op_e op,
+ bt_mesh_model_h model, bt_mesh_group_h group, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
+static bool __bt_mesh_model_subscription_list_cb(int result, bt_mesh_model_h model,
+ int total, const GSList *sub_addr, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+
+ return true;
+}
+
+static void __bt_mesh_model_publication_status_cb(int result, bt_mesh_model_h model,
+ bt_mesh_group_h group, bt_mesh_appkey_h appkey, void *user_data)
+{
+ if (mainloop)
+ g_main_loop_quit(mainloop);
+}
+
static void wait_for_async()
{
mainloop = g_main_loop_new(NULL, FALSE);
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
+ ret = bt_mesh_node_create(&features, &node);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create_element(node, &elem);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create_element(node, &elem);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_network_h net_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_network_h net = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
+ ret = bt_mesh_node_create(&features, &node);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create_element(node, &elem);
- ret = bt_mesh_node_get_network(node_h, &net_h);
+ ret = bt_mesh_node_get_network(node, &net);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_node_get_network(node_h, &net_h);
+ ret = bt_mesh_node_get_network(node, &net);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
memset(&mod_id, 0x00, sizeof(bt_mesh_model_id_s));
- ret = bt_mesh_model_get_id(model_h, &mod_id);
+ ret = bt_mesh_model_get_id(model, &mod_id);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_model_get_id(model_h, &mod_id);
+ ret = bt_mesh_model_get_id(model, &mod_id);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
- ret = bt_mesh_model_destroy(model_h);
+ ret = bt_mesh_model_destroy(model);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_model_destroy(model_h);
+ ret = bt_mesh_model_destroy(model);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
- elem_h = NULL;
- ret = bt_mesh_model_get_element(model_h, &elem_h);
+ elem = NULL;
+ ret = bt_mesh_model_get_element(model, &elem);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_model_get_element(model_h, &elem_h);
+ ret = bt_mesh_model_get_element(model, &elem);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(elem_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(elem, &mod_id, &model);
- ret = bt_mesh_element_destroy(elem_h);
+ ret = bt_mesh_element_destroy(elem);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_element_destroy(elem_h);
+ ret = bt_mesh_element_destroy(elem);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
- ret = bt_mesh_element_get_node(elem_h, &node_h);
+ ret = bt_mesh_element_get_node(elem, &node);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_element_get_node(elem_h, &node_h);
+ ret = bt_mesh_element_get_node(elem, &node);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h elem = NULL;
if (mesh_supported) {
assert_eq(startup_flag, BT_ERROR_NONE);
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &elem_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &elem);
- ret = bt_mesh_node_foreach_element(node_h, __bt_mesh_node_foreach_elem_cb, NULL);
+ ret = bt_mesh_node_foreach_element(node, __bt_mesh_node_foreach_elem_cb, NULL);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_node_foreach_element(node_h, __bt_mesh_node_foreach_elem_cb, NULL);
+ ret = bt_mesh_node_foreach_element(node, __bt_mesh_node_foreach_elem_cb, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h element_h = NULL;
- bt_mesh_model_h model_h = NULL;
+ bt_mesh_node_h node = NULL;
+ bt_mesh_element_h element = NULL;
+ bt_mesh_model_h model = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
features.features = BT_MESH_FEATURE_RELAY;
features.features |= BT_MESH_FEATURE_LOWPOWER;
- ret = bt_mesh_node_create(&features, &node_h);
- ret = bt_mesh_node_create_element(node_h, &element_h);
+ ret = bt_mesh_node_create(&features, &node);
+ ret = bt_mesh_node_create_element(node, &element);
mod_id.model_id = BT_MESH_MODEL_ID_GEN_LEVEL_SRV;
mod_id.company_id = 0xFFFF;
- ret = bt_mesh_element_create_model(element_h, &mod_id, &model_h);
+ ret = bt_mesh_element_create_model(element, &mod_id, &model);
- ret = bt_mesh_element_foreach_models(element_h, __bt_mesh_elem_foreach_model_cb, NULL);
+ ret = bt_mesh_element_foreach_models(element, __bt_mesh_elem_foreach_model_cb, NULL);
assert_eq(ret, BT_ERROR_NONE);
} else {
- ret = bt_mesh_element_foreach_models(element_h, __bt_mesh_elem_foreach_model_cb, NULL);
+ ret = bt_mesh_element_foreach_models(element, __bt_mesh_elem_foreach_model_cb, NULL);
assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
}
{
int ret = BT_ERROR_NONE;
bt_mesh_node_features_s features;
- bt_mesh_node_h node_h = NULL;
- bt_mesh_element_h elem_h = NULL;
- bt_mesh_model_h model_h = NULL;
bt_mesh_model_id_s mod_id;
if (mesh_supported) {
return 0;
}
+int utc_bluetooth_bt_mesh_network_discover_node_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_netkey_h netkey_h = NULL;
+ char* dev_uuid = "tempName";
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_network_add_netkey(network, &netkey_h);
+
+ ret = bt_mesh_network_discover_node(network, (const char*)dev_uuid,
+ __bt_mesh_node_discover_status_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_network_discover_node(network, (const char*)dev_uuid,
+ __bt_mesh_node_discover_status_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_get_features_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_get_features(node_h, __bt_mesh_node_features_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_node_get_features(node_h, __bt_mesh_node_features_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_foreach_netkeys_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_foreach_netkeys(node_h, __bt_mesh_node_foreach_netkeys_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+ } else {
+ ret = bt_mesh_node_foreach_netkeys(node_h, __bt_mesh_node_foreach_netkeys_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_foreach_appkeys_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_foreach_appkeys(node_h, netkey_h,
+ __bt_mesh_node_foreach_appkeys_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+ } else {
+ ret = bt_mesh_node_foreach_appkeys(node_h, netkey_h,
+ __bt_mesh_node_foreach_appkeys_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_get_ttl_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_get_ttl(node_h, __bt_mesh_node_ttl_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_node_get_ttl(node_h, __bt_mesh_node_ttl_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_set_ttl_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ int ttl = 120;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_set_ttl(node_h, ttl, __bt_mesh_node_ttl_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_node_set_ttl(node_h, ttl, __bt_mesh_node_ttl_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_node_configure_netkey_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_node_key_configuration_e config = 0;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_configure_netkey(node_h, config, netkey_h,
+ __bt_mesh_node_configure_netkey_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_node_configure_netkey(node_h, config, netkey_h,
+ __bt_mesh_node_configure_netkey_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_node_configure_appkey_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_node_key_configuration_e config = 0;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_node_configure_appkey(node_h, config, appkey_h,
+ __bt_mesh_node_configure_appkey_cb, NULL);
+
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_node_configure_appkey(node_h, config, appkey_h,
+ __bt_mesh_node_configure_appkey_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_bind_appkey_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_bind_appkey(model_h, appkey_h, __bt_mesh_model_bind_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_bind_appkey(model_h, appkey_h, __bt_mesh_model_bind_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_unbind_appkey_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_unbind_appkey(model_h, appkey_h, __bt_mesh_model_unbind_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_unbind_appkey(model_h, appkey_h, __bt_mesh_model_unbind_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_get_appkey_list_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_get_appkey_list(model_h, __bt_mesh_model_appkey_list_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_get_appkey_list(model_h, __bt_mesh_model_appkey_list_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_configure_group_subscription_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_model_subscription_op_e op = BT_MESH_MODEL_SUBSCRIPTION_ADD;
+ bt_mesh_group_h group_h = NULL;
+ uint16_t group_addr = 0xc001;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_mesh_network_create_group(network, group_addr, &group_h);
+
+ ret = bt_mesh_model_configure_group_subscription(op, model_h, group_h,
+ __bt_mesh_model_subscription_op_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_configure_group_subscription(op, model_h, group_h,
+ __bt_mesh_model_subscription_op_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+int utc_bluetooth_bt_mesh_model_configure_virtual_group_subscription_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_model_subscription_op_e op = BT_MESH_MODEL_SUBSCRIPTION_ADD;
+ bt_mesh_group_h group_h = NULL;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+ ret = bt_mesh_network_create_virtual_group(network, &group_h);
+
+ ret = bt_mesh_model_configure_virtual_group_subscription(op, model_h, group_h,
+ __bt_mesh_model_subscription_op_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_configure_virtual_group_subscription(op, model_h, group_h,
+ __bt_mesh_model_subscription_op_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_get_subscription_list_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_get_subscription_list(model_h,
+ __bt_mesh_model_subscription_list_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_get_subscription_list(model_h,
+ __bt_mesh_model_subscription_list_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_set_publication_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_model_pub_params_s param;
+ bt_mesh_group_h group_h = NULL;
+ uint16_t group_addr = 0xc001;
+ bt_mesh_node_key_configuration_e config = 0;
+
+ memset(¶m, 0x00, sizeof(bt_mesh_model_pub_params_s));
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ param.ttl = 120;
+ param.num_steps = 10;
+ param.per_res = BT_MESH_PUBLICATION_STEP_RES_1_SECOND;
+ param.retrans_cnt = BT_MESH_MAX_PUBISH_RETRANSMIT_COUNT;
+ param.retrans_step = BT_MESH_MAX_PUBISH_RETRANSMIT_INTERVAL_STEPS;
+
+ ret = bt_mesh_network_create_group(network, group_addr, &group_h);
+
+ ret = bt_mesh_node_configure_appkey(node_h, config, appkey_h,
+ __bt_mesh_node_configure_appkey_cb, NULL);
+ wait_for_async();
+
+ ret = bt_mesh_model_set_publication(model_h, appkey_h, group_h, ¶m,
+ __bt_mesh_model_publication_status_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+
+ wait_for_async();
+ } else {
+ ret = bt_mesh_model_set_publication(model_h, appkey_h, group_h, ¶m,
+ __bt_mesh_model_publication_status_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_model_get_publication_p(void)
+{
+ int ret = BT_ERROR_NONE;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_model_get_publication(model_h, __bt_mesh_model_publication_status_cb, NULL);
+ assert_eq(ret, BT_ERROR_NONE);
+ } else {
+ ret = bt_mesh_model_get_publication(model_h, __bt_mesh_model_publication_status_cb, NULL);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}
+
+
+int utc_bluetooth_bt_mesh_appkey_get_netkey_p(void)
+{
+ int ret = BT_ERROR_NONE;
+ bt_mesh_netkey_h netkey_local;
+
+ if (mesh_supported) {
+ assert_eq(startup_flag, BT_ERROR_NONE);
+
+ ret = bt_mesh_appkey_get_netkey(appkey_h, &netkey_local);
+ assert_eq(ret, BT_ERROR_NONE);
+ } else {
+ ret = bt_mesh_appkey_get_netkey(appkey_h, &netkey_local);
+ assert_eq(ret, BT_ERROR_NOT_SUPPORTED);
+ }
+
+ return 0;
+}