mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-12 04:27:38 +00:00
Falashforge 5M network support (#4546)
* build action changes * Adding flashforge 5M series network support * Update CMakeLists.txt * Update Flashforge.cpp * reverting files for pull request --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <boost/system/system_error.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/streambuf.hpp>
|
||||
#include "SerialMessage.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
namespace Utils {
|
||||
@@ -45,7 +46,7 @@ public:
|
||||
m_port_name = port_name;
|
||||
}
|
||||
|
||||
bool enqueue_cmd(const std::string& cmd) {
|
||||
bool enqueue_cmd(const SerialMessage& cmd) {
|
||||
// TODO: Add multithread protection to queue
|
||||
m_cmd_queue.push_back(cmd);
|
||||
return true;
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
private:
|
||||
void handle_connect(const boost::system::error_code& ec);
|
||||
void handle_read(const boost::system::error_code& ec, std::size_t bytes_transferred);
|
||||
void handle_write(const boost::system::error_code& ec, std::size_t bytes_transferred);
|
||||
void handle_write(const boost::system::error_code& ec, std::size_t bytes_transferred, SerialMessageType messageType);
|
||||
|
||||
void transmit_next_command();
|
||||
void wait_next_line();
|
||||
@@ -74,7 +75,7 @@ private:
|
||||
std::chrono::steady_clock::duration m_write_timeout;
|
||||
std::chrono::steady_clock::duration m_read_timeout;
|
||||
|
||||
std::deque<std::string> m_cmd_queue;
|
||||
std::deque<SerialMessage> m_cmd_queue;
|
||||
|
||||
boost::asio::io_context m_io_context;
|
||||
tcp::resolver m_resolver;
|
||||
|
||||
Reference in New Issue
Block a user