Make 02.08.01.52 the default network plugin and match its ABI

The newer plugin adds four PrintParams fields (task_timelapse_use_internal,
extruder_cali_manual_mode, svc_context, slicer_uid) and an extra dev_model
argument to bind. Both cross the by-value C ABI boundary, so match the struct
layout and thread dev_model through the bind chain, else start_print and bind
corrupt the stack on the newer plugin. Keep 02.03.00.62 selectable as a fallback.
This commit is contained in:
SoftFever
2026-07-16 00:17:01 +08:00
parent e5106a23b6
commit bf4fb64c8a
14 changed files with 25 additions and 17 deletions

View File

@@ -813,7 +813,7 @@ PingCodeBindDialog::~PingCodeBindDialog() {
m_simplebook->SetSelection(0);
auto m_bind_job = std::make_unique<BindJob>(
m_machine_info->get_dev_id(), m_machine_info->get_dev_ip(), m_machine_info->bind_sec_link, m_machine_info->bind_ssdp_version);
m_machine_info->get_dev_id(), m_machine_info->get_dev_ip(), m_machine_info->get_show_printer_type(), m_machine_info->bind_sec_link, m_machine_info->bind_ssdp_version);
if (m_machine_info && (m_machine_info->get_printer_series() == PrinterSeries::SERIES_X1)) {
m_bind_job->set_improved(false);

View File

@@ -18,10 +18,11 @@ static auto waiting_auth_str = _u8L("Logging in");
static auto login_failed_str = _u8L("Login failed");
BindJob::BindJob(std::string dev_id, std::string dev_ip, std::string sec_link, std::string ssdp_version)
BindJob::BindJob(std::string dev_id, std::string dev_ip, std::string dev_model, std::string sec_link, std::string ssdp_version)
:
m_dev_id(dev_id),
m_dev_ip(dev_ip),
m_dev_model(dev_model),
m_sec_link(sec_link),
m_ssdp_version(ssdp_version)
{
@@ -60,7 +61,7 @@ void BindJob::process(Ctl &ctl)
std::string timezone = get_timezone_utc_hm(offset);
m_agent->track_update_property("ssdp_version", m_ssdp_version, "string");
int result = m_agent->bind(m_dev_ip, m_dev_id, m_sec_link, timezone, m_improved,
int result = m_agent->bind(m_dev_ip, m_dev_id, m_dev_model, m_sec_link, timezone, m_improved,
[this, &ctl, &curr_percent, &msg, &result_code, &result_info](int stage, int code, std::string info) {
result_code = code;

View File

@@ -16,6 +16,7 @@ class BindJob : public Job
std::function<void()> m_success_fun{nullptr};
std::string m_dev_id;
std::string m_dev_ip;
std::string m_dev_model;
std::string m_sec_link;
std::string m_ssdp_version;
bool m_job_finished{ false };
@@ -23,7 +24,7 @@ class BindJob : public Job
bool m_improved{false};
public:
BindJob(std::string dev_id, std::string dev_ip, std::string sec_link, std::string ssdp_version);
BindJob(std::string dev_id, std::string dev_ip, std::string dev_model, std::string sec_link, std::string ssdp_version);
int status_range() const
{