mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-23 21:05:31 -07:00
Support both old and new version of BBL network plugin
This commit is contained in:
parent
440d44340d
commit
aef4dba512
7 changed files with 205 additions and 28 deletions
|
|
@ -2623,29 +2623,38 @@ bool MachineObject::is_camera_busy_off()
|
|||
return false;
|
||||
}
|
||||
|
||||
int MachineObject::publish_json(std::string json_str, int qos)
|
||||
int MachineObject::publish_json(std::string json_str, int qos, int flag)
|
||||
{
|
||||
int rtn = 0;
|
||||
if (is_lan_mode_printer()) {
|
||||
return local_publish_json(json_str, qos);
|
||||
rtn = local_publish_json(json_str, qos, flag);
|
||||
} else {
|
||||
return cloud_publish_json(json_str, qos);
|
||||
rtn = cloud_publish_json(json_str, qos, flag);
|
||||
}
|
||||
|
||||
if (rtn == 0) {
|
||||
BOOST_LOG_TRIVIAL(info) << "publish_json: " << json_str << " code: " << rtn;
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(error) << "publish_json: " << json_str << " code: " << rtn;
|
||||
}
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
int MachineObject::cloud_publish_json(std::string json_str, int qos)
|
||||
int MachineObject::cloud_publish_json(std::string json_str, int qos, int flag)
|
||||
{
|
||||
int result = -1;
|
||||
if (m_agent)
|
||||
result = m_agent->send_message(dev_id, json_str, qos);
|
||||
result = m_agent->send_message(dev_id, json_str, qos, flag);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int MachineObject::local_publish_json(std::string json_str, int qos)
|
||||
int MachineObject::local_publish_json(std::string json_str, int qos, int flag)
|
||||
{
|
||||
int result = -1;
|
||||
if (m_agent) {
|
||||
result = m_agent->send_message_to_printer(dev_id, json_str, qos);
|
||||
result = m_agent->send_message_to_printer(dev_id, json_str, qos, flag);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue