| 55 | #endif |
| 56 | |
| 57 | SC::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 | |
| 72 | SC::Result SC::SerialDescriptor::setSettings(const SerialSettings& settings) |
| 73 | { |
nothing calls this directly
no test coverage detected