BT_MESH_MODEL_CONFIG_GROUP_SUB, req->data,
sizeof(bluetooth_mesh_model_configure_t));
break;
+ case MESH_OPCODE_CONFIG_MODEL_PUB_GET:
+ /* Send event with timeout */
+ __bt_mesh_handle_pending_dev_config_request_info(
+ BLUETOOTH_ERROR_TIMEOUT,
+ BT_MESH_MODEL_GET_PUBLICATION, req->data,
+ sizeof(bluetooth_mesh_model_configure_t));
+ break;
+ case MESH_OPCODE_CONFIG_MODEL_PUB_SET:
+ /* Send event with timeout */
+ __bt_mesh_handle_pending_dev_config_request_info(
+ BLUETOOTH_ERROR_TIMEOUT,
+ BT_MESH_MODEL_SET_PUBLICATION, req->data,
+ sizeof(bluetooth_mesh_model_configure_t));
+ break;
+ case MESH_OPCODE_MODEL_APP_BIND:
+ case MESH_OPCODE_MODEL_APP_UNBIND:
+ /* Send event with timeout */
+ __bt_mesh_handle_pending_dev_config_request_info(
+ BLUETOOTH_ERROR_TIMEOUT,
+ BT_MESH_MODEL_CONFIGURE_APPKEY, req->data,
+ sizeof(bluetooth_mesh_model_configure_t));
+ break;
default:
break;
}
BT_INFO("Subscr Addr\t%4.4x\n", addr);
BT_INFO("Model ID\t%4.4x\n", mod_id);
+ if (data[0] == MESH_STATUS_SUCCESS) {
+ /* Update cdb */
+ switch (cmd->opcode) {
+ case MESH_OPCODE_CONFIG_MODEL_SUB_ADD:
+ case MESH_OPCODE_CONFIG_MODEL_SUB_VIRT_ADD:
+ if (!_bt_mesh_network_add_model_subscription(
+ event->net_uuid.uuid, event->source,
+ ele_addr - event->source, mod_id, addr)) {
+ BT_INFO("Failed to add model subscription!");
+ }
+ break;
+ case MESH_OPCODE_CONFIG_MODEL_SUB_DELETE:
+ case MESH_OPCODE_CONFIG_MODEL_SUB_VIRT_DELETE:
+ if (!_bt_mesh_network_delete_model_subscription(
+ event->net_uuid.uuid, event->source,
+ ele_addr - event->source, mod_id, addr)) {
+ BT_INFO("Failed to delete model subscription!");
+ }
+ break;
+ case MESH_OPCODE_CONFIG_MODEL_SUB_DELETE_ALL:
+ if (!_bt_mesh_network_delete_all_model_subscription(
+ event->net_uuid.uuid, event->source,
+ ele_addr - event->source, mod_id)) {
+ BT_INFO("Failed to delete all model subscription!");
+ }
+ break;
+ case MESH_OPCODE_CONFIG_MODEL_SUB_OVERWRITE:
+ case MESH_OPCODE_CONFIG_MODEL_SUB_VIRT_OVERWRITE:
+ if (!_bt_mesh_network_overwrite_model_subscription(
+ event->net_uuid.uuid, event->source,
+ ele_addr - event->source, mod_id, addr)) {
+ BT_INFO("Failed to overwrite model subscription!");
+ }
+ break;
+ }
+ }
+
if (cmd)
__mesh_handle_model_subscription_event(result, ¶m, cmd);
*param.sub_list[k] = l_get_le16(data + i);
}
}
+
+ /* <TO-DO> Update model sub in cdb */
+
__bt_mesh_handle_pending_dev_config_request_info(result,
BT_MESH_MODEL_GET_SUBSCRIPTION_LIST, ¶m,
sizeof(bluetooth_mesh_model_configure_t));