Lines Matching refs:xfer

118 	cli->xfer.state = STATE_APPLIED;  in dfu_applied()
130 cli->xfer.flags |= FLAG_FAILED; in dfu_failed()
190 cli->xfer.blob.block_size_log = caps->max_block_size_log; in blob_caps()
191 cli->xfer.blob.chunk_size = caps->max_chunk_size; in blob_caps()
198 if (!(cli->xfer.blob.mode & BT_MESH_BLOB_XFER_MODE_ALL)) { in blob_caps()
199 cli->xfer.blob.mode = in blob_caps()
203 cli->xfer.blob.mode = in blob_caps()
205 cli->xfer.blob.mode : caps->modes; in blob_caps()
208 err = bt_mesh_blob_cli_send(b, b->inputs, &cli->xfer.blob, cli->xfer.io); in blob_caps()
223 if ((cli->xfer.state == STATE_CONFIRM || cli->xfer.state == STATE_APPLY) && in blob_lost_target()
241 cli->xfer.state = STATE_SUSPENDED; in blob_suspended()
249 const struct bt_mesh_blob_xfer *xfer, bool success) in blob_end() argument
260 if (cli->xfer.state == STATE_CANCEL) { in blob_end()
267 if (cli->xfer.state != STATE_TRANSFER) { in blob_end()
268 LOG_ERR("Blob failed in invalid state %u", cli->xfer.state); in blob_end()
368 net_buf_simple_add_le64(&buf, cli->xfer.blob.id); in send_update_start()
370 net_buf_simple_add_mem(&buf, cli->xfer.slot->metadata, in send_update_start()
371 cli->xfer.slot->metadata_len); in send_update_start()
443 cli->xfer.state = STATE_TRANSFER; in initiate()
500 if (cli->xfer.flags & FLAG_RESUME) { in transfer()
501 cli->xfer.flags ^= FLAG_RESUME; in transfer()
507 } else if (cli->xfer.flags & FLAG_SKIP_CAPS_GET) { in transfer()
508 cli->xfer.flags ^= FLAG_SKIP_CAPS_GET; in transfer()
509 err = bt_mesh_blob_cli_send(b, b->inputs, &cli->xfer.blob, cli->xfer.io); in transfer()
532 cli->xfer.state = STATE_VERIFIED; in refreshed()
546 cli->xfer.state = STATE_REFRESH; in refresh()
567 cli->xfer.state = STATE_APPLY; in apply()
593 if ((img->fwid_len != cli->xfer.slot->fwid_len) || in target_img_cb()
594 memcmp(cli->xfer.slot->fwid, img->fwid, img->fwid_len)) { in target_img_cb()
664 cli->xfer.state = STATE_IDLE; in confirmed()
665 cli->xfer.flags = FLAG_COMPLETED; in confirmed()
694 cli->xfer.flags |= FLAG_CANCELLED; in cancelled()
749 LOG_DBG("%u phase: %u, cur state: %u", status, phase, cli->xfer.state); in handle_status()
753 if (cli->xfer.state == STATE_APPLY && phase == BT_MESH_DFU_PHASE_IDLE && in handle_status()
771 if (net_buf_simple_pull_le64(buf) != cli->xfer.blob.id) { in handle_status()
785 if (cli->xfer.state == STATE_REFRESH) { in handle_status()
794 } else if (cli->xfer.state == STATE_APPLY) { in handle_status()
805 } else if (cli->xfer.state == STATE_CONFIRM) { in handle_status()
819 } else if (cli->xfer.state == STATE_CANCEL) { in handle_status()
918 bt_hex(cli->xfer.slot->fwid, cli->xfer.slot->fwid_len)); in handle_info_status()
997 cli->xfer.state = STATE_IDLE; in dfu_cli_reset()
998 cli->xfer.flags = 0; in dfu_cli_reset()
1013 const struct bt_mesh_dfu_cli_xfer *xfer) in bt_mesh_dfu_cli_send() argument
1021 cli->xfer.blob.mode = xfer->mode; in bt_mesh_dfu_cli_send()
1022 cli->xfer.blob.size = xfer->slot->size; in bt_mesh_dfu_cli_send()
1024 if (xfer->blob_id == 0) { in bt_mesh_dfu_cli_send()
1025 int err = bt_rand(&cli->xfer.blob.id, sizeof(cli->xfer.blob.id)); in bt_mesh_dfu_cli_send()
1031 cli->xfer.blob.id = xfer->blob_id; in bt_mesh_dfu_cli_send()
1034 cli->xfer.io = io; in bt_mesh_dfu_cli_send()
1036 cli->xfer.slot = xfer->slot; in bt_mesh_dfu_cli_send()
1037 cli->xfer.flags = 0U; in bt_mesh_dfu_cli_send()
1039 if (xfer->blob_params) { in bt_mesh_dfu_cli_send()
1040 cli->xfer.flags |= FLAG_SKIP_CAPS_GET; in bt_mesh_dfu_cli_send()
1041 cli->xfer.blob.block_size_log = xfer->blob_params->block_size_log; in bt_mesh_dfu_cli_send()
1042 cli->xfer.blob.chunk_size = xfer->blob_params->chunk_size; in bt_mesh_dfu_cli_send()
1061 cli->xfer.state = STATE_SUSPENDED; in bt_mesh_dfu_cli_suspend()
1071 if (cli->xfer.state != STATE_SUSPENDED) { in bt_mesh_dfu_cli_resume()
1075 cli->xfer.flags = FLAG_RESUME; in bt_mesh_dfu_cli_resume()
1112 if (cli->xfer.state == STATE_IDLE) { in bt_mesh_dfu_cli_cancel()
1116 cli->xfer.state = STATE_CANCEL; in bt_mesh_dfu_cli_cancel()
1124 if (cli->xfer.state != STATE_VERIFIED) { in bt_mesh_dfu_cli_apply()
1135 if (cli->xfer.state != STATE_APPLIED) { in bt_mesh_dfu_cli_confirm()
1139 cli->xfer.state = STATE_CONFIRM; in bt_mesh_dfu_cli_confirm()
1147 if (cli->xfer.state == STATE_TRANSFER) { in bt_mesh_dfu_cli_progress()
1151 if (cli->xfer.state == STATE_IDLE) { in bt_mesh_dfu_cli_progress()
1152 if (cli->xfer.flags & FLAG_COMPLETED) { in bt_mesh_dfu_cli_progress()
1163 return (cli->xfer.state == STATE_TRANSFER || in bt_mesh_dfu_cli_is_busy()
1164 cli->xfer.state == STATE_REFRESH || in bt_mesh_dfu_cli_is_busy()
1165 cli->xfer.state == STATE_APPLY || in bt_mesh_dfu_cli_is_busy()
1166 cli->xfer.state == STATE_CONFIRM) && in bt_mesh_dfu_cli_is_busy()
1167 !(cli->xfer.flags & FLAG_FAILED); in bt_mesh_dfu_cli_is_busy()