MCPcopy Create free account
hub / github.com/crayzeewulf/libserial / GetDSR

Method GetDSR

src/SerialStream.cpp:816–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814 }
815
816 bool
817 SerialStream::GetDSR()
818 try
819 {
820 auto my_buffer = dynamic_cast<SerialStreamBuf *>(this->rdbuf()) ;
821
822 // Make sure that we are dealing with a SerialStreamBuf before
823 // proceeding. This check also makes sure that we have a non-NULL
824 // buffer associated with this stream.
825 if (my_buffer != nullptr)
826 {
827 // Try to get the DSR line state.
828 return my_buffer->GetDSR() ;
829 }
830 // If the dynamic_cast above failed then we either have a NULL
831 // streambuf associated with this stream or we have a buffer of
832 // class other than SerialStreamBuf. In either case, we have a
833 // problem and we should stop all I/O using this stream.
834 setstate(badbit) ;
835 return false ;
836 }
837 catch (const std::exception&)
838 {
839 setstate(std::ios_base::failbit) ;
840 throw ;
841 }
842
843 int
844 SerialStream::GetFileDescriptor()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected