- Timestamp:
- 08/31/11 15:13:49 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/ConnectionUSB.cc
r11851 r11921 18 18 using ba::serial_port_base; 19 19 20 //#define DEBUG_TX20 #define DEBUG_TX 21 21 22 22 // -------- Abbreviations for starting async tasks --------- … … 30 30 } 31 31 32 void ConnectionUSB::AsyncRead(const ba::mutable_buffers_1 buffers, int type )32 void ConnectionUSB::AsyncRead(const ba::mutable_buffers_1 buffers, int type, int counter) 33 33 { 34 34 ba::async_read(*this, buffers, 35 35 boost::bind(&ConnectionUSB::HandleReceivedData, this, 36 dummy::error, dummy::bytes_transferred, type ));36 dummy::error, dummy::bytes_transferred, type, counter)); 37 37 } 38 38 … … 77 77 Error("Cancel async requests on "+URL()+": "+ec.message()); 78 78 79 close(ec); 80 if (!ec) 81 Error("Closing "+URL()+": "+ec.message()); 79 if (IsConnected()) 80 { 81 close(ec); 82 if (!ec) 83 Error("Closing "+URL()+": "+ec.message()); 84 } 82 85 83 86 // Reset the connection status -
trunk/FACT++/src/ConnectionUSB.h
r11471 r11921 46 46 // -------- Abbreviations for starting async tasks --------- 47 47 48 void AsyncRead(const boost::asio::mutable_buffers_1 buffers, int type=0 );48 void AsyncRead(const boost::asio::mutable_buffers_1 buffers, int type=0, int counter=0); 49 49 void AsyncWrite(const boost::asio::const_buffers_1 &buffers); 50 50 void AsyncWait(boost::asio::deadline_timer &timer, int millisec, … … 95 95 // ------------------------ others -------------------------- 96 96 97 virtual void HandleReceivedData(const boost::system::error_code&, size_t, int = 0 ) { }97 virtual void HandleReceivedData(const boost::system::error_code&, size_t, int = 0, int = 0) { } 98 98 virtual void HandleTransmittedData(size_t) { } 99 99 virtual void HandleReadTimeout(const boost::system::error_code&) { }
Note:
See TracChangeset
for help on using the changeset viewer.