Lines Matching refs:slot

89 static int slot_del(struct bt_mesh_dfd_srv *srv, const struct bt_mesh_dfu_slot *slot)  in slot_del()  argument
92 srv->cb->del(srv, slot); in slot_del()
95 return bt_mesh_dfu_slot_del(slot); in slot_del()
195 static enum bt_mesh_dfu_iter slot_space_cb(const struct bt_mesh_dfu_slot *slot, in slot_space_cb() argument
200 *total += slot->size; in slot_space_cb()
251 if (srv->phase == BT_MESH_DFD_PHASE_IDLE || !srv->dfu.xfer.slot) { in status_rsp()
353 !srv->upload.slot) { in upload_status_rsp_with_progress()
367 net_buf_simple_add_mem(&rsp, srv->upload.slot->fwid, in upload_status_rsp_with_progress()
368 srv->upload.slot->fwid_len); in upload_status_rsp_with_progress()
382 progress = srv->cb->oob_progress_get(srv, srv->upload.slot); in upload_status_rsp()
405 int err = bt_mesh_dfu_slot_fwid_set(srv->upload.slot, fwid, fwid_len); in set_upload_fwid()
410 bt_mesh_dfu_slot_release(srv->upload.slot); in set_upload_fwid()
411 srv->upload.slot = NULL; in set_upload_fwid()
416 bt_mesh_dfu_slot_release(srv->upload.slot); in set_upload_fwid()
418 err = bt_mesh_dfu_slot_get(fwid, fwid_len, &srv->upload.slot); in set_upload_fwid()
422 srv->upload.slot = NULL; in set_upload_fwid()
471 if (!srv->upload.slot) { in handle_upload_start()
477 if (srv->upload.slot->fwid_len == fwid_len && in handle_upload_start()
478 !memcmp(srv->upload.slot->fwid, fwid, fwid_len) && in handle_upload_start()
479 srv->upload.slot->metadata_len == meta_len && in handle_upload_start()
480 !memcmp(srv->upload.slot->metadata, meta, meta_len) && in handle_upload_start()
501 if (srv->upload.slot) { in handle_upload_start()
502 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start()
508 srv->upload.slot = bt_mesh_dfu_slot_reserve(); in handle_upload_start()
510 if (!srv->upload.slot) { in handle_upload_start()
522 err = bt_mesh_dfu_slot_info_set(srv->upload.slot, size, meta, meta_len); in handle_upload_start()
534 err = srv->cb->recv(srv, srv->upload.slot, &srv->io); in handle_upload_start()
537 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start()
546 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start()
610 struct bt_mesh_dfu_slot *slot = bt_mesh_dfu_slot_reserve(); in handle_upload_start_oob() local
612 if (slot == NULL) { in handle_upload_start_oob()
620 if (srv->upload.slot) { in handle_upload_start_oob()
621 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start_oob()
625 srv->upload.slot = slot; in handle_upload_start_oob()
632 int status = srv->cb->start_oob_upload(srv, srv->upload.slot, srv->upload.oob.uri, in handle_upload_start_oob()
639 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start_oob()
658 srv->cb->cancel_oob_upload(srv, srv->upload.slot); in handle_upload_cancel()
693 struct bt_mesh_dfu_slot *slot; in handle_fw_get() local
701 idx = bt_mesh_dfu_slot_get(fwid, fwid_len, &slot); in handle_fw_get()
717 const struct bt_mesh_dfu_slot *slot; in handle_fw_get_by_index() local
722 slot = bt_mesh_dfu_slot_at(idx); in handle_fw_get_by_index()
723 if (slot) { in handle_fw_get_by_index()
724 fw_status_rsp(srv, ctx, BT_MESH_DFD_SUCCESS, idx, slot->fwid, in handle_fw_get_by_index()
725 slot->fwid_len); in handle_fw_get_by_index()
751 static enum bt_mesh_dfu_iter slot_del_cb(const struct bt_mesh_dfu_slot *slot, in slot_del_cb() argument
757 srv->cb->del(srv, slot); in slot_del_cb()
900 if (success && (bt_mesh_dfu_slot_commit(srv->upload.slot) == 0)) { in upload_end()
1041 xfer.slot = bt_mesh_dfu_slot_at(params->slot_idx); in bt_mesh_dfd_srv_start()
1042 if (!xfer.slot) { in bt_mesh_dfd_srv_start()
1072 err = srv->cb->send(srv, xfer.slot, &srv->io); in bt_mesh_dfd_srv_start()
1220 struct bt_mesh_dfu_slot *slot; in bt_mesh_dfd_srv_fw_delete() local
1229 idx = bt_mesh_dfu_slot_get(*fwid, *fwid_len, &slot); in bt_mesh_dfd_srv_fw_delete()
1234 err = slot_del(srv, slot); in bt_mesh_dfd_srv_fw_delete()
1259 const struct bt_mesh_dfu_slot *slot, int status, in bt_mesh_dfd_srv_oob_check_complete() argument
1264 if (slot != srv->upload.slot || !srv->upload.is_oob || in bt_mesh_dfd_srv_oob_check_complete()
1276 bt_mesh_dfu_slot_release(srv->upload.slot); in bt_mesh_dfd_srv_oob_check_complete()
1292 const struct bt_mesh_dfu_slot *slot, bool success, in bt_mesh_dfd_srv_oob_store_complete() argument
1298 srv->upload.slot != slot || !srv->upload.is_oob) { in bt_mesh_dfd_srv_oob_store_complete()
1306 err = bt_mesh_dfu_slot_info_set(srv->upload.slot, size, metadata, metadata_len); in bt_mesh_dfd_srv_oob_store_complete()
1311 err = bt_mesh_dfu_slot_commit(srv->upload.slot); in bt_mesh_dfd_srv_oob_store_complete()
1321 bt_mesh_dfu_slot_release(srv->upload.slot); in bt_mesh_dfd_srv_oob_store_complete()