BT_CHECK_INPUT_PARAMETER(node_handle);
bt_mesh_node_s *node = (bt_mesh_node_s*)node_handle;
-
BT_MESH_VALIDATE_HANDLE(node, node_list);
/* It is NOT allowed to destroy attached node: Do Reset */
BT_CHECK_MESH_INIT_STATUS();
BT_CHECK_INPUT_PARAMETER(model_handle);
- bt_mesh_node_s *node = (bt_mesh_node_s*)((bt_mesh_element_s*)((bt_mesh_model_s*)model_handle)->parent)->parent;
bt_mesh_model_s *model = (bt_mesh_model_s*)model_handle;
- bt_mesh_element_s *element = model->parent;
-
BT_MESH_VALIDATE_HANDLE(model, model_list);
+
+ bt_mesh_element_s *element = model->parent;
+ BT_CHECK_INPUT_PARAMETER(element);
BT_MESH_VALIDATE_HANDLE(element, element_list);
+ bt_mesh_node_s *node = element->parent;
+ BT_CHECK_INPUT_PARAMETER(node);
+ BT_MESH_VALIDATE_HANDLE(node, node_list);
+
/* It is NOT allowed to destroy remote model */
BT_CHECK_MESH_LOCAL(node);
BT_INFO("Mesh: Create Network: Name [%s]", network_name);
bt_mesh_node_s *node = (bt_mesh_node_s*)config_client;
-
BT_MESH_VALIDATE_HANDLE(node, node_list);
/* Error if remote node*/
netkey_s = (bt_mesh_netkey_s*)netkey;
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
network_s = netkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
memset(&net, 0x00, sizeof(bluetooth_mesh_network_t));
netkey_s = (bt_mesh_netkey_s*)netkey;
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
+
network_s = netkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
memset(&net, 0x00, sizeof(bluetooth_mesh_network_t));
netkey_s = (bt_mesh_netkey_s*)netkey;
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
+
network_s = netkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
memset(&net, 0x00, sizeof(bluetooth_mesh_network_t));
BT_CHECK_INPUT_PARAMETER(appkey);
appkey_s = (bt_mesh_appkey_s*)appkey;
+ BT_CHECK_INPUT_PARAMETER(appkey_s);
BT_MESH_VALIDATE_HANDLE(appkey_s, appkey_list);
+
netkey_s = appkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(netkey_s);
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
+
network_s = netkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
memset(&net, 0x00, sizeof(bluetooth_mesh_network_t));
appkey_s = (bt_mesh_appkey_s*)appkey;
BT_MESH_VALIDATE_HANDLE(appkey_s, appkey_list);
+
netkey_s = appkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(netkey_s);
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
+
network_s = netkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
memset(&net, 0x00, sizeof(bluetooth_mesh_network_t));
BT_MESH_VALIDATE_HANDLE(netkey, netkey_list);
netkey_s = (bt_mesh_netkey_s*)netkey;
+
network_s = netkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
+ BT_MESH_VALIDATE_HANDLE(network_s, networks);
appkeys = g_ptr_array_new();
if (appkeys == NULL) {
BT_MESH_VALIDATE_HANDLE(node, node_list);
node_s = (bt_mesh_node_s*) node;
- /* Only for Node which is attached to the Network */
-#if 0
- if (!node_s->is_attached)
- return BT_ERROR_INVALID_PARAMETER;
-#endif
total = g_slist_length(node_s->elements);
if (!total) {
callback(BT_ERROR_NONE, (bt_mesh_node_h) node, total,
BT_CHECK_INPUT_PARAMETER(element);
BT_CHECK_INPUT_PARAMETER(callback);
- BT_MESH_VALIDATE_HANDLE(element, element_list);
-
element_s = (bt_mesh_element_s*) element;
+ BT_MESH_VALIDATE_HANDLE(element_s, element_list);
+
node_s = (bt_mesh_node_s*) element_s->parent;
+ BT_CHECK_INPUT_PARAMETER(node_s);
+ BT_MESH_VALIDATE_HANDLE(node_s, node_list);
+
network_s = (bt_mesh_network_s*) node_s->parent;
/* Only for local Node */
return BT_ERROR_NONE;
}
-int bt_mesh_node_configure_netkey(bt_mesh_node_h node, bt_mesh_node_key_configuration_e netkey_op,
- bt_mesh_netkey_h netkey, bt_mesh_netkey_status_cb callback, void *user_data)
+int bt_mesh_node_configure_netkey(bt_mesh_node_h node,
+ bt_mesh_node_key_configuration_e netkey_op,
+ bt_mesh_netkey_h netkey,
+ bt_mesh_netkey_status_cb callback,
+ void *user_data)
{
int error_code = BT_ERROR_NONE;
bt_mesh_network_s *network_s;
BT_CHECK_INPUT_PARAMETER(callback);
node_s = (bt_mesh_node_s*) node;
- network_s = node_s->parent;
- netkey_s = (bt_mesh_netkey_s*) netkey;
+ BT_MESH_VALIDATE_HANDLE(node_s, node_list);
+ network_s = node_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
- BT_MESH_VALIDATE_HANDLE(node_s, node_list);
+
+ netkey_s = (bt_mesh_netkey_s*) netkey;
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
/* Return error, if node is not attached */
return BT_ERROR_NONE;
}
-int bt_mesh_node_configure_appkey(bt_mesh_node_h node, bt_mesh_node_key_configuration_e appkey_op,
- bt_mesh_appkey_h appkey, bt_mesh_appkey_status_cb callback, void *user_data)
+int bt_mesh_node_configure_appkey(bt_mesh_node_h node,
+ bt_mesh_node_key_configuration_e appkey_op,
+ bt_mesh_appkey_h appkey,
+ bt_mesh_appkey_status_cb callback,
+ void *user_data)
{
int error_code = BT_ERROR_NONE;
bt_mesh_network_s *network_s;
BT_CHECK_INPUT_PARAMETER(callback);
node_s = (bt_mesh_node_s*) node;
- network_s = node_s->parent;
- appkey_s = (bt_mesh_appkey_s*) appkey;
- netkey_s = (bt_mesh_netkey_s*) appkey_s->parent;
+ BT_MESH_VALIDATE_HANDLE(node_s, node_list);
+ network_s = node_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
- BT_MESH_VALIDATE_HANDLE(node_s, node_list);
+
+ appkey_s = (bt_mesh_appkey_s*) appkey;
BT_MESH_VALIDATE_HANDLE(appkey_s, appkey_list);
+
+ netkey_s = (bt_mesh_netkey_s*) appkey_s->parent;
+ BT_CHECK_INPUT_PARAMETER(netkey_s);
BT_MESH_VALIDATE_HANDLE(netkey_s, netkey_list);
/* Return error, if node is not attached */
return BT_ERROR_NONE;
}
-
/* Remote Node Operations: CONFIG: Non Key */
-int bt_mesh_node_get_features(bt_mesh_node_h node, bt_mesh_node_features_cb callback, void *user_data)
+int bt_mesh_node_get_features(bt_mesh_node_h node,
+ bt_mesh_node_features_cb callback, void *user_data)
{
int error_code = BT_ERROR_NONE;
bt_mesh_network_s *network_s;
BT_CHECK_INPUT_PARAMETER(callback);
node_s = (bt_mesh_node_s*) node;
+ BT_MESH_VALIDATE_HANDLE(node_s, node_list);
/* Return error, if node is not attached */
if (!node_s->is_attached)
return BT_ERROR_INVALID_PARAMETER;
network_s = (bt_mesh_network_s*) node_s->parent;
-
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
- BT_MESH_VALIDATE_HANDLE(node_s, node_list);
memset(&req, 0x00, sizeof(bluetooth_mesh_node_features_t));
BT_CHECK_INPUT_PARAMETER(callback);
node_s = (bt_mesh_node_s*) node;
- network_s = node_s->parent;
+ BT_MESH_VALIDATE_HANDLE(node_s, node_list);
+ network_s = node_s->parent;
+ BT_CHECK_INPUT_PARAMETER(network_s);
BT_MESH_VALIDATE_HANDLE(network_s, networks);
- BT_MESH_VALIDATE_HANDLE(node_s, node_list);
/* Return error, if node is not attached */
if (!node_s->is_attached)