Lines Matching full:slot

93 static int slot_del(struct bt_mesh_dfd_srv *srv, const struct bt_mesh_dfu_slot *slot)  in slot_del()  argument
96 srv->cb->del(srv, slot); in slot_del()
99 return bt_mesh_dfu_slot_del(slot); in slot_del()
199 static enum bt_mesh_dfu_iter slot_space_cb(const struct bt_mesh_dfu_slot *slot, in slot_space_cb() argument
204 *total += slot->size; in slot_space_cb()
255 if (srv->phase == BT_MESH_DFD_PHASE_IDLE || !srv->dfu.xfer.slot) { in status_rsp()
357 !srv->upload.slot) { in upload_status_rsp_with_progress()
371 net_buf_simple_add_mem(&rsp, srv->upload.slot->fwid, in upload_status_rsp_with_progress()
372 srv->upload.slot->fwid_len); in upload_status_rsp_with_progress()
386 progress = srv->cb->oob_progress_get(srv, srv->upload.slot); in upload_status_rsp()
409 int err = bt_mesh_dfu_slot_fwid_set(srv->upload.slot, fwid, fwid_len); in set_upload_fwid()
414 bt_mesh_dfu_slot_release(srv->upload.slot); in set_upload_fwid()
415 srv->upload.slot = NULL; in set_upload_fwid()
420 bt_mesh_dfu_slot_release(srv->upload.slot); in set_upload_fwid()
422 err = bt_mesh_dfu_slot_get(fwid, fwid_len, &srv->upload.slot); in set_upload_fwid()
426 srv->upload.slot = NULL; in set_upload_fwid()
433 case -EINVAL: /* Slot in wrong state. */ in set_upload_fwid()
475 if (!srv->upload.slot) { in handle_upload_start()
476 LOG_WRN("Busy with no upload slot"); in handle_upload_start()
481 if (srv->upload.slot->fwid_len == fwid_len && in handle_upload_start()
482 !memcmp(srv->upload.slot->fwid, fwid, fwid_len) && in handle_upload_start()
483 srv->upload.slot->metadata_len == meta_len && in handle_upload_start()
484 !memcmp(srv->upload.slot->metadata, meta, meta_len) && in handle_upload_start()
502 /* This will be a no-op if the slot state isn't RESERVED, which is in handle_upload_start()
505 if (srv->upload.slot) { in handle_upload_start()
506 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start()
512 srv->upload.slot = bt_mesh_dfu_slot_reserve(); in handle_upload_start()
514 if (!srv->upload.slot) { in handle_upload_start()
515 LOG_WRN("No space for slot"); in handle_upload_start()
526 err = bt_mesh_dfu_slot_info_set(srv->upload.slot, size, meta, meta_len); in handle_upload_start()
538 err = srv->cb->recv(srv, srv->upload.slot, &srv->io); in handle_upload_start()
541 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start()
550 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start()
614 struct bt_mesh_dfu_slot *slot = bt_mesh_dfu_slot_reserve(); in handle_upload_start_oob() local
616 if (slot == NULL) { in handle_upload_start_oob()
621 /* This will be a no-op if the slot state isn't RESERVED, which is in handle_upload_start_oob()
624 if (srv->upload.slot) { in handle_upload_start_oob()
625 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start_oob()
629 srv->upload.slot = slot; in handle_upload_start_oob()
636 int status = srv->cb->start_oob_upload(srv, srv->upload.slot, srv->upload.oob.uri, in handle_upload_start_oob()
643 bt_mesh_dfu_slot_release(srv->upload.slot); in handle_upload_start_oob()
662 srv->cb->cancel_oob_upload(srv, srv->upload.slot); in handle_upload_cancel()
697 struct bt_mesh_dfu_slot *slot; in handle_fw_get() local
705 idx = bt_mesh_dfu_slot_get(fwid, fwid_len, &slot); in handle_fw_get()
721 const struct bt_mesh_dfu_slot *slot; in handle_fw_get_by_index() local
726 slot = bt_mesh_dfu_slot_at(idx); in handle_fw_get_by_index()
727 if (slot) { in handle_fw_get_by_index()
728 fw_status_rsp(srv, ctx, BT_MESH_DFD_SUCCESS, idx, slot->fwid, in handle_fw_get_by_index()
729 slot->fwid_len); in handle_fw_get_by_index()
755 static enum bt_mesh_dfu_iter slot_del_cb(const struct bt_mesh_dfu_slot *slot, in slot_del_cb() argument
761 srv->cb->del(srv, slot); in slot_del_cb()
904 if (success && (bt_mesh_dfu_slot_commit(srv->upload.slot) == 0)) { in upload_end()
909 /* Will delete slot when we start a new upload */ in upload_end()
1023 xfer.slot = bt_mesh_dfu_slot_at(params->slot_idx); in bt_mesh_dfd_srv_start()
1024 if (!xfer.slot) { in bt_mesh_dfd_srv_start()
1054 err = srv->cb->send(srv, xfer.slot, &srv->io); in bt_mesh_dfd_srv_start()
1078 LOG_DBG("Distribution Start: slot: %d, appidx: %d, tb: %d, addr: %04X, ttl: %d, apply: %d", in bt_mesh_dfd_srv_start()
1194 struct bt_mesh_dfu_slot *slot; in bt_mesh_dfd_srv_fw_delete() local
1203 idx = bt_mesh_dfu_slot_get(*fwid, *fwid_len, &slot); in bt_mesh_dfd_srv_fw_delete()
1208 err = slot_del(srv, slot); in bt_mesh_dfd_srv_fw_delete()
1233 const struct bt_mesh_dfu_slot *slot, int status, in bt_mesh_dfd_srv_oob_check_complete() argument
1238 if (slot != srv->upload.slot || !srv->upload.is_oob || in bt_mesh_dfd_srv_oob_check_complete()
1250 bt_mesh_dfu_slot_release(srv->upload.slot); in bt_mesh_dfd_srv_oob_check_complete()
1266 const struct bt_mesh_dfu_slot *slot, bool success, in bt_mesh_dfd_srv_oob_store_complete() argument
1272 srv->upload.slot != slot || !srv->upload.is_oob) { in bt_mesh_dfd_srv_oob_store_complete()
1280 err = bt_mesh_dfu_slot_info_set(srv->upload.slot, size, metadata, metadata_len); in bt_mesh_dfd_srv_oob_store_complete()
1285 err = bt_mesh_dfu_slot_commit(srv->upload.slot); in bt_mesh_dfd_srv_oob_store_complete()
1295 bt_mesh_dfu_slot_release(srv->upload.slot); in bt_mesh_dfd_srv_oob_store_complete()