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

Method GetFlowControl

src/SerialStream.cpp:416–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414 }
415
416 FlowControl
417 SerialStream::GetFlowControl()
418 try
419 {
420 auto my_buffer = dynamic_cast<SerialStreamBuf *>(this->rdbuf()) ;
421
422 // Make sure that we are dealing with a SerialStreamBuf before
423 // proceeding. This check also makes sure that we have a non-NULL
424 // buffer associated with this stream.
425 if (my_buffer != nullptr)
426 {
427 // Try to get the flow control. If the corresponding function of the
428 // SerialStreamBuf class returns FLOW_CONTROL_INVALID, then we have a
429 // problem and the stream is no longer valid for I/O.
430 return my_buffer->GetFlowControl() ;
431 }
432 // If the dynamic_cast above failed then we either have a NULL
433 // streambuf associated with this stream or we have a buffer of
434 // class other than SerialStreamBuf. In either case, we have a
435 // problem and we should stop all I/O using this stream.
436 setstate(badbit) ;
437 return FlowControl::FLOW_CONTROL_INVALID;
438 }
439 catch (const std::exception&)
440 {
441 setstate(std::ios_base::failbit) ;
442 throw ;
443 }
444
445 void
446 SerialStream::SetParity(const Parity& parityType)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected