Lines Matching full:update

20 	     "The Firmware Update Start message does not fit into the maximum incoming SDU size.");
25 "The Firmware Update Info Status message does not fit into the maximum outgoing SDU "
30 bt_mesh_model_data_store(srv->mod, false, NULL, &srv->update, in store_state()
31 sizeof(srv->update)); in store_state()
42 srv->update.idx >= srv->img_count) { in xfer_failed()
49 srv->cb->end(srv, &srv->imgs[srv->update.idx], false); in xfer_failed()
82 srv->update.phase = BT_MESH_DFU_PHASE_VERIFY_OK; in apply_rsp_sent()
89 if (!srv->cb->apply || srv->update.idx == UPDATE_IDX_NONE) { in apply_rsp_sent()
90 srv->update.phase = BT_MESH_DFU_PHASE_IDLE; in apply_rsp_sent()
98 err = srv->cb->apply(srv, &srv->imgs[srv->update.idx]); in apply_rsp_sent()
100 srv->update.phase = BT_MESH_DFU_PHASE_IDLE; in apply_rsp_sent()
115 srv->update.phase = BT_MESH_DFU_PHASE_VERIFY; in verify()
117 if (srv->update.idx >= srv->img_count) { in verify()
127 srv->cb->end(srv, &srv->imgs[srv->update.idx], true); in verify()
128 if (srv->update.phase == BT_MESH_DFU_PHASE_VERIFY) { in verify()
139 if (srv->update.phase == BT_MESH_DFU_PHASE_APPLYING) { in handle_info_get()
186 if (srv->update.phase != BT_MESH_DFU_PHASE_IDLE) { in handle_info_get()
187 ctx->send_ttl = srv->update.ttl; in handle_info_get()
214 if (srv->update.phase != BT_MESH_DFU_PHASE_IDLE) { in handle_metadata_check()
215 ctx->send_ttl = srv->update.ttl; in handle_metadata_check()
232 (srv->update.phase << 5))); in update_status_rsp()
234 if (srv->update.phase != BT_MESH_DFU_PHASE_IDLE) { in update_status_rsp()
235 net_buf_simple_add_u8(&buf, srv->update.ttl); in update_status_rsp()
236 net_buf_simple_add_u8(&buf, srv->update.effect); in update_status_rsp()
237 net_buf_simple_add_le16(&buf, srv->update.timeout_base); in update_status_rsp()
239 net_buf_simple_add_u8(&buf, srv->update.idx); in update_status_rsp()
241 ctx->send_ttl = srv->update.ttl; in update_status_rsp()
264 return (srv->update.idx != idx || srv->blob.state.xfer.id != *blob_id || in is_active_update()
265 srv->update.ttl != ttl || in is_active_update()
266 srv->update.timeout_base != timeout_base || in is_active_update()
267 srv->update.meta != meta_checksum); in is_active_update()
290 if ((!buf->len || meta_checksum == srv->update.meta) && in handle_start()
291 srv->update.phase == BT_MESH_DFU_PHASE_TRANSFER_ERR && in handle_start()
292 srv->update.ttl == ttl && in handle_start()
293 srv->update.timeout_base == timeout_base && in handle_start()
294 srv->update.idx == idx && in handle_start()
296 srv->update.phase = BT_MESH_DFU_PHASE_TRANSFER_ACTIVE; in handle_start()
310 srv->update.ttl = ttl; in handle_start()
314 LOG_WRN("Busy. Phase: %u", srv->update.phase); in handle_start()
320 (enum bt_mesh_dfu_effect *)&srv->update.effect); in handle_start()
326 srv->update.ttl = ttl; in handle_start()
327 srv->update.timeout_base = timeout_base; in handle_start()
328 srv->update.meta = meta_checksum; in handle_start()
334 * self-update. Skip the transfer phase and proceed to in handle_start()
335 * verifying update. in handle_start()
338 srv->update.idx = idx; in handle_start()
340 srv->update.phase = BT_MESH_DFU_PHASE_VERIFY; in handle_start()
368 srv->update.idx = idx; in handle_start()
369 srv->update.phase = BT_MESH_DFU_PHASE_TRANSFER_ACTIVE; in handle_start()
384 if (srv->update.idx == UPDATE_IDX_NONE) { in handle_cancel()
391 srv->update.phase = BT_MESH_DFU_PHASE_IDLE; in handle_cancel()
411 if (srv->update.phase == BT_MESH_DFU_PHASE_APPLYING) { in handle_apply()
416 if (srv->update.phase != BT_MESH_DFU_PHASE_VERIFY_OK) { in handle_apply()
417 LOG_WRN("Apply: Invalid phase %u", srv->update.phase); in handle_apply()
425 srv->update.phase = BT_MESH_DFU_PHASE_APPLYING; in handle_apply()
447 srv->update.idx = UPDATE_IDX_NONE; in dfu_srv_init()
479 if (len_rd < sizeof(srv->update)) { in dfu_srv_settings_set()
483 len = read_cb(cb_arg, &srv->update, sizeof(srv->update)); in dfu_srv_settings_set()
488 LOG_DBG("Recovered transfer (phase: %u, idx: %u)", srv->update.phase, in dfu_srv_settings_set()
489 srv->update.idx); in dfu_srv_settings_set()
490 if (srv->update.phase == BT_MESH_DFU_PHASE_TRANSFER_ACTIVE) { in dfu_srv_settings_set()
492 srv->update.phase = BT_MESH_DFU_PHASE_TRANSFER_ERR; in dfu_srv_settings_set()
493 } else if (srv->update.phase == BT_MESH_DFU_PHASE_VERIFY_OK) { in dfu_srv_settings_set()
495 srv->update.phase = BT_MESH_DFU_PHASE_VERIFY_FAIL; in dfu_srv_settings_set()
505 srv->update.phase = BT_MESH_DFU_PHASE_IDLE; in dfu_srv_reset()
519 srv->update.phase = BT_MESH_DFU_PHASE_TRANSFER_ERR; in blob_suspended()
531 srv->update.phase = BT_MESH_DFU_PHASE_TRANSFER_ERR; in blob_end()
547 srv->update.phase != BT_MESH_DFU_PHASE_TRANSFER_ERR || in blob_recover()
548 srv->update.idx >= srv->img_count) { in blob_recover()
552 return srv->cb->recover(srv, &srv->imgs[srv->update.idx], io); in blob_recover()
563 if (srv->update.phase != BT_MESH_DFU_PHASE_VERIFY) { in bt_mesh_dfu_srv_verified()
570 srv->update.phase = BT_MESH_DFU_PHASE_VERIFY_OK; in bt_mesh_dfu_srv_verified()
576 if (srv->update.phase != BT_MESH_DFU_PHASE_VERIFY) { in bt_mesh_dfu_srv_rejected()
583 srv->update.phase = BT_MESH_DFU_PHASE_VERIFY_FAIL; in bt_mesh_dfu_srv_rejected()
589 if (srv->update.phase == BT_MESH_DFU_PHASE_IDLE) { in bt_mesh_dfu_srv_cancel()
599 if (srv->update.phase != BT_MESH_DFU_PHASE_APPLYING) { in bt_mesh_dfu_srv_applied()
606 srv->update.phase = BT_MESH_DFU_PHASE_IDLE; in bt_mesh_dfu_srv_applied()
612 return srv->update.phase != BT_MESH_DFU_PHASE_IDLE && in bt_mesh_dfu_srv_is_busy()
613 srv->update.phase != BT_MESH_DFU_PHASE_TRANSFER_ERR && in bt_mesh_dfu_srv_is_busy()
614 srv->update.phase != BT_MESH_DFU_PHASE_VERIFY_FAIL; in bt_mesh_dfu_srv_is_busy()
623 if (srv->update.phase == BT_MESH_DFU_PHASE_TRANSFER_ACTIVE) { in bt_mesh_dfu_srv_progress()