MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / open

Method open

Libraries/SerialPort/SerialPort.cpp:57–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55#endif
56
57SC::Result SC::SerialDescriptor::open(StringSpan path, const SerialOpenOptions& options)
58{
59 SC_TRY(detail::validateSerialSettings(options.settings));
60 FileDescriptor::Handle nativeHandle = FileDescriptor::Invalid;
61 SC_TRY(detail::openSerialHandle(path, options, nativeHandle));
62 SC_TRY(close());
63 SC_TRY(assign(nativeHandle));
64 const Result setRes = setSettings(options.settings);
65 if (not setRes)
66 {
67 (void)close();
68 }
69 return setRes;
70}
71
72SC::Result SC::SerialDescriptor::setSettings(const SerialSettings& settings)
73{

Callers

nothing calls this directly

Calls 3

validateSerialSettingsFunction · 0.85
closeFunction · 0.85
assignFunction · 0.50

Tested by

no test coverage detected