PIByteArray checksumPlain invert flag

fix PISerial setBreak
This commit is contained in:
Andrey
2021-09-16 16:18:20 +03:00
parent ece3fb1536
commit 19a8ca84e6
3 changed files with 21 additions and 11 deletions

View File

@@ -296,12 +296,22 @@ bool PISerial::setBreak(bool enabled) {
}
#ifdef WINDOWS
if (enabled) {
if (!SetCommBreak(PRIVATE->hCom)) return false;
if (!SetCommBreak(PRIVATE->hCom)) {
piCoutObj << "setBreak error: " << errorString();
return false;
} else {
return true;
}
} else {
if (!ClearCommBreak(PRIVATE->hCom)) return false;
if (!ClearCommBreak(PRIVATE->hCom)) {
piCoutObj << "setBreak error: " << errorString();
return false;
} else {
return true;
}
}
#else
if (::ioctl(descriptor, enabled ? TIOCSBRK : TIOCCBRK) < 0) {
if (ioctl(descriptor, enabled ? TIOCSBRK : TIOCCBRK) < 0) {
piCoutObj << "setBreak error: " << errorString();
return false;
} else {