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

Method Open

src/SerialStream.cpp:71–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 }
70
71 void
72 SerialStream::Open(const std::string& fileName,
73 const std::ios_base::openmode& openMode)
74 try
75 {
76 // Create a new SerialStreamBuf if one does not exist.
77 if (mIOBuffer == nullptr)
78 {
79 mIOBuffer = std::make_unique<SerialStreamBuf>() ;
80 assert(mIOBuffer != nullptr) ; // NOLINT (cppcoreguidelines-pro-bounds-array-to-pointer-decay)
81 this->rdbuf(mIOBuffer.get()) ;
82 }
83
84 // Open the serial port.
85 mIOBuffer->Open(fileName, openMode) ;
86 }
87 catch (const std::exception&)
88 {
89 setstate(std::ios_base::failbit) ;
90 throw ;
91 }
92
93 void
94 SerialStream::Close()

Callers 1

SerialStreamMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected