diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2014-11-27 00:30:25 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2014-11-27 00:30:25 +0300 |
commit | 11dd67ab34b8488aae761afe715a4838725306d8 (patch) | |
tree | 0e79b53755be2051698c3350c0c862741d7bb64b /xs/src/libslic3r/GCodeSender.hpp | |
parent | 43cbad8867593bc39c66199e910a94778c971ba0 (diff) |
Initial work for G-code sender and more intensive usage of Boost
Diffstat (limited to 'xs/src/libslic3r/GCodeSender.hpp')
-rw-r--r-- | xs/src/libslic3r/GCodeSender.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/xs/src/libslic3r/GCodeSender.hpp b/xs/src/libslic3r/GCodeSender.hpp new file mode 100644 index 000000000..c5a67fd51 --- /dev/null +++ b/xs/src/libslic3r/GCodeSender.hpp @@ -0,0 +1,33 @@ +#ifndef slic3r_GCodeSender_hpp_ +#define slic3r_GCodeSender_hpp_ +#ifdef BOOST_LIBS + +#include <myinit.h> +#include <string> +#include <vector> +#include <boost/asio.hpp> + +namespace Slic3r { + +namespace asio = boost::asio; + +class GCodeSender { + public: + GCodeSender(std::string devname, unsigned int baud_rate); + void send(const std::vector<std::string> &lines); + void send(const std::string &s); + + + private: + asio::io_service io; + asio::serial_port serial; + std::vector<std::string> lines; + + void send_line(const std::string &line); + void read_line(std::string* line); +}; + +} + +#endif +#endif |