Rev 1595 | Rev 1597 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1595 | Rev 1596 | ||
|---|---|---|---|
| Line 63... | Line 63... | ||
| 63 | } |
63 | } |
| 64 | 64 | ||
| 65 | Client::Disconnect(); |
65 | Client::Disconnect(); |
| 66 | } |
66 | } |
| 67 | 67 | ||
| 68 | void SerialClient::Send( |
68 | void SerialClient::Send(type::Byteset data) |
| 69 | { |
69 | { |
| 70 | if (this->serial_port_.is_open()) |
70 | if (this->serial_port_.is_open()) |
| 71 | { |
71 | { |
| 72 | this->serial_port_.write_some(boost::asio::buffer(data)); |
72 | this->serial_port_.write_some(boost::asio::buffer(data.Get(), data.GetMaxSize())); |
| 73 | } |
73 | } |
| 74 | else |
74 | else |
| 75 | { |
75 | { |
| 76 | this->Disconnect(); |
76 | this->Disconnect(); |
| 77 | } |
77 | } |
| Line 79... | Line 79... | ||
| 79 | 79 | ||
| 80 | void SerialClient::Read() |
80 | void SerialClient::Read() |
| 81 | { |
81 | { |
| 82 | Client::Read(); |
82 | Client::Read(); |
| 83 | 83 | ||
| 84 | this->serial_port_.async_read_some(boost::asio::buffer(this->buffer_), |
84 | this->serial_port_.async_read_some(boost::asio::buffer(this->buffer_.Get(), this->buffer_.GetMaxSize()), |
| 85 | boost::bind(&SerialClient::ReadHandler, |
85 | boost::bind(&SerialClient::ReadHandler, |
| 86 | this, |
86 | this, |
| 87 | boost::asio::placeholders::error, |
87 | boost::asio::placeholders::error, |
| 88 | boost::asio::placeholders::bytes_transferred)); |
88 | boost::asio::placeholders::bytes_transferred)); |
| 89 | } |
89 | } |