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

Method GetVTime

src/SerialStream.cpp:650–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648 }
649
650 short
651 SerialStream::GetVTime()
652 try
653 {
654 auto my_buffer = dynamic_cast<SerialStreamBuf *>(this->rdbuf()) ;
655
656 // Make sure that we are dealing with a SerialStreamBuf before
657 // proceeding. This check also makes sure that we have a non-NULL
658 // buffer associated with this stream.
659 if (my_buffer != nullptr)
660 {
661 // Try to get the vTime duration in deciseconds.
662 return my_buffer->GetVTime() ;
663 }
664 // If the dynamic_cast above failed then we either have a NULL
665 // streambuf associated with this stream or we have a buffer of
666 // class other than SerialStreamBuf. In either case, we have a
667 // problem and we should stop all I/O using this stream.
668 setstate(badbit) ;
669 return -1;
670 }
671 catch (const std::exception&)
672 {
673 setstate(std::ios_base::failbit) ;
674 throw ;
675 }
676
677 void
678 SerialStream::SetDTR(const bool dtrState)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected