.. _program_listing_file__tmp_ws_src_ecl_core_ecl_streams_include_ecl_streams_serial_stream.hpp: Program Listing for File serial_stream.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_core/ecl_streams/include/ecl/streams/serial_stream.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef ECL_STREAMS_SERIAL_STREAM_HPP_ #define ECL_STREAMS_SERIAL_STREAM_HPP_ /***************************************************************************** ** Includes *****************************************************************************/ #include #include #include #include #include "text_stream.hpp" /***************************************************************************** ** Namespaces *****************************************************************************/ namespace ecl { /***************************************************************************** ** Interfaces [SerialStream] *****************************************************************************/ class ecl_streams_PUBLIC SerialStream : public TextStream { public: SerialStream() {}; SerialStream(const std::string& port_name, const BaudRate &baud_rate = BaudRate_115200, const DataBits &data_bits = DataBits_8, const StopBits &stop_bits = StopBits_1, const Parity &parity = NoParity) { ecl_try { this->device().open(port_name, baud_rate, data_bits, stop_bits, parity); if ( !this->device().open() ) { error = this->device().error(); } } ecl_catch(StandardException &e) { ecl_throw(StandardException(LOC,e)); } } virtual ~SerialStream() {}; }; } // namespace ecl #endif /* ECL_STREAMS_SERIAL_STREAM_HPP_ */