| 704 | } |
| 705 | |
| 706 | bool |
| 707 | SerialStream::GetDTR() |
| 708 | try |
| 709 | { |
| 710 | auto my_buffer = dynamic_cast<SerialStreamBuf *>(this->rdbuf()) ; |
| 711 | |
| 712 | // Make sure that we are dealing with a SerialStreamBuf before |
| 713 | // proceeding. This check also makes sure that we have a non-NULL |
| 714 | // buffer associated with this stream. |
| 715 | if (my_buffer != nullptr) |
| 716 | { |
| 717 | // Try to get the vTime duration in deciseconds. |
| 718 | return my_buffer->GetDTR() ; |
| 719 | } |
| 720 | // If the dynamic_cast above failed then we either have a NULL |
| 721 | // streambuf associated with this stream or we have a buffer of |
| 722 | // class other than SerialStreamBuf. In either case, we have a |
| 723 | // problem and we should stop all I/O using this stream. |
| 724 | setstate(badbit) ; |
| 725 | return false ; |
| 726 | } |
| 727 | catch (const std::exception&) |
| 728 | { |
| 729 | setstate(std::ios_base::failbit) ; |
| 730 | throw ; |
| 731 | } |
| 732 | |
| 733 | void |
| 734 | SerialStream::SetRTS(const bool rtsState) |
nothing calls this directly
no outgoing calls
no test coverage detected