ENH: add sec_link field to start_bind

Change-Id: Ia48592f096b14ea0fe4de20126287c6f885d73a5
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-03-16 10:26:32 +08:00 committed by Lane.Wei
parent e031708043
commit 1f1e5894bb
7 changed files with 21 additions and 14 deletions

View file

@ -32,10 +32,11 @@ wxString get_login_fail_reason(std::string fail_reason)
return _L("Unknown Failure");
}
BindJob::BindJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater, std::string dev_id, std::string dev_ip)
BindJob::BindJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater, std::string dev_id, std::string dev_ip, std::string sec_link)
: PlaterJob{std::move(pri), plater},
m_dev_id(dev_id),
m_dev_ip(dev_ip)
m_dev_ip(dev_ip),
m_sec_link(sec_link)
{
;
}
@ -79,7 +80,7 @@ void BindJob::process()
long offset = tz.GetOffset();
std::string timezone = get_timezone_utc_hm(offset);
int result = m_agent->bind(m_dev_ip, m_dev_id, timezone,
int result = m_agent->bind(m_dev_ip, m_dev_id, m_sec_link, timezone,
[this, &curr_percent, &msg](int stage, int code, std::string info) {
if (stage == BBL::BindJobStage::LoginStageConnect) {
curr_percent = 15;

View file

@ -16,13 +16,14 @@ class BindJob : public PlaterJob
std::function<void()> m_success_fun{nullptr};
std::string m_dev_id;
std::string m_dev_ip;
std::string m_sec_link;
bool m_job_finished{ false };
int m_print_job_completed_id = 0;
protected:
void on_exception(const std::exception_ptr &) override;
public:
BindJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater, std::string dev_id, std::string dev_ip);
BindJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater, std::string dev_id, std::string dev_ip, std::string sec_link);
int status_range() const override
{