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

Method GetDTR

src/SerialStream.cpp:706–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected