#pragma once #include #include #include #include #include #include #include #include class async_usb_gadget; class device_option; class image_capture; class img_processor; class gb_json; class scanner_const_opts; class scanner_hw; class async_scanner : public refer { async_usb_gadget *usb_ = nullptr; device_option *cfg_mgr_ = nullptr; scanner_const_opts *const_opts_ = nullptr; scanner_hw *cis_ = nullptr; MUTEX locker_; uint32_t img_cnt_; uint32_t scan_id_; uint32_t scan_err_; volatile bool reply_start_; int last_err_ = 0; MUTEX fsender_; std::vector send_files_; dyn_mem_ptr handle_bulk_cmd(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); void init(void); dyn_mem_ptr handle_simple_roger(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_get_opt_value(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_get_opt_all(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_set_opt(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_file_receive(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_file_send(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_file_send_roger(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_scan_start(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_scan_stop(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); dyn_mem_ptr handle_process_cmd(LPPACK_BASE pack, uint32_t* used, packet_data_base_ptr* required); public: async_scanner(); protected: ~async_scanner(); public: uint32_t stop(void); int last_error(void); };