Lines Matching refs:req

42 enum req {  enum
137 static int req_setup(struct bt_mesh_dfu_cli *cli, enum req type, uint16_t addr, in req_setup()
140 if (cli->req.type != REQ_NONE) { in req_setup()
144 cli->req.addr = addr; in req_setup()
145 cli->req.params = params; in req_setup()
146 cli->req.type = type; in req_setup()
155 err = k_sem_take(&cli->req.sem, timeout); in req_wait()
156 cli->req.type = REQ_NONE; in req_wait()
253 cli->req.img_cb = NULL; in blob_end()
343 cli->req.img_cnt = 0xff; in send_info_get()
345 info_get(cli, &ctx, 0, cli->req.img_cnt, &send_cb); in send_info_get()
623 cli->req.img_cb = target_img_cb; in confirm()
624 cli->req.ttl = cli->blob.inputs->ttl; in confirm()
635 cli->req.img_cb = NULL; in confirmed()
715 if (cli->req.type == REQ_STATUS && cli->req.addr == ctx->addr) { in handle_status()
716 if (cli->req.params) { in handle_status()
717 struct bt_mesh_dfu_target_status *rsp = cli->req.params; in handle_status()
737 k_sem_give(&cli->req.sem); in handle_status()
836 if (!cli->req.img_cb || in handle_info_status()
837 (cli->req.type == REQ_IMG && cli->req.addr != ctx->addr)) { in handle_info_status()
843 if (img_cnt < cli->req.img_cnt) { in handle_info_status()
844 cli->req.img_cnt = img_cnt; in handle_info_status()
855 while (buf->len && cli->req.img_cb && idx < cli->req.img_cnt) { in handle_info_status()
888 it = cli->req.img_cb(cli, ctx, idx, img_cnt, &img, in handle_info_status()
889 cli->req.params); in handle_info_status()
891 if (cli->req.type == REQ_IMG) { in handle_info_status()
892 k_sem_give(&cli->req.sem); in handle_info_status()
901 if (idx < cli->req.img_cnt) { in handle_info_status()
902 LOG_DBG("Fetching more images (%u/%u)", idx, cli->req.img_cnt); in handle_info_status()
903 ctx->send_ttl = cli->req.ttl; in handle_info_status()
904 info_get(cli, ctx, idx, cli->req.img_cnt - idx, in handle_info_status()
905 (cli->req.type == REQ_IMG) ? NULL : &send_cb); in handle_info_status()
909 if (cli->req.type == REQ_IMG) { in handle_info_status()
910 k_sem_give(&cli->req.sem); in handle_info_status()
931 struct bt_mesh_dfu_metadata_status *rsp = cli->req.params; in handle_metadata_status()
937 if (cli->req.type != REQ_METADATA || ctx->addr != cli->req.addr || in handle_metadata_status()
941 if (cli->req.type != REQ_METADATA) { in handle_metadata_status()
942 LOG_WRN("Expected %u", cli->req.type); in handle_metadata_status()
944 LOG_WRN("Expected 0x%04x img %u", cli->req.addr, idx); in handle_metadata_status()
952 k_sem_give(&cli->req.sem); in handle_metadata_status()
984 k_sem_init(&cli->req.sem, 0, 1); in dfu_cli_init()
993 cli->req.type = REQ_NONE; in dfu_cli_reset()
994 cli->req.addr = BT_MESH_ADDR_UNASSIGNED; in dfu_cli_reset()
995 cli->req.img_cnt = 0; in dfu_cli_reset()
996 cli->req.img_cb = NULL; in dfu_cli_reset()
1105 cli->req.type = REQ_NONE; in bt_mesh_dfu_cli_cancel()
1177 if (cli->req.img_cb) { in bt_mesh_dfu_cli_imgs_get()
1186 cli->req.img_cb = cb; in bt_mesh_dfu_cli_imgs_get()
1187 cli->req.params = cb_data; in bt_mesh_dfu_cli_imgs_get()
1188 cli->req.ttl = ctx->send_ttl; in bt_mesh_dfu_cli_imgs_get()
1189 cli->req.img_cnt = max_count; in bt_mesh_dfu_cli_imgs_get()
1191 err = info_get(cli, ctx, 0, cli->req.img_cnt, NULL); in bt_mesh_dfu_cli_imgs_get()
1193 cli->req.img_cb = NULL; in bt_mesh_dfu_cli_imgs_get()
1194 cli->req.type = REQ_NONE; in bt_mesh_dfu_cli_imgs_get()
1200 cli->req.img_cb = NULL; in bt_mesh_dfu_cli_imgs_get()
1232 cli->req.type = REQ_NONE; in bt_mesh_dfu_cli_metadata_check()
1255 cli->req.type = REQ_NONE; in bt_mesh_dfu_cli_status_get()