Merge remote-tracking branch 'remotes/origin/stream_interface'

PIBinaryLog
This commit is contained in:
Бычков Андрей
2022-07-22 15:22:33 +03:00
92 changed files with 1807 additions and 1791 deletions

View File

@@ -521,14 +521,14 @@ PIString PISerial::readString(int size, double timeout_ms) {
while (tm_.elapsed_m() < timeout_ms) {
ret = readDevice(td, 1024);
if (ret <= 0) piMinSleep();
else str << PIString((char*)td, ret);
else str += PIString((char*)td, ret);
}
} else {
while (all < size && tm_.elapsed_m() < timeout_ms) {
ret = readDevice(td, size - all);
if (ret <= 0) piMinSleep();
else {
str << PIString((char*)td, ret);
str += PIString((char*)td, ret);
all += ret;
}
}
@@ -537,12 +537,12 @@ PIString PISerial::readString(int size, double timeout_ms) {
} else {
bool br = setOption(BlockingRead, true);
all = readDevice(td, 1);
str << PIString((char*)td, all);
str += PIString((char*)td, all);
while (all < size) {
ret = readDevice(td, size - all);
if (ret <= 0) piMinSleep();
else {
str << PIString((char*)td, ret);
str += PIString((char*)td, ret);
all += ret;
}
}
@@ -862,13 +862,13 @@ bool PISerial::configureDevice(const void * e_main, const void * e_parent) {
PIString PISerial::constructFullPathDevice() const {
PIString ret;
ret << path() << ":" << int(inSpeed()) << ":" << dataBitsCount();
ret += path() + ":" + PIString::fromNumber(int(inSpeed())) + ":" + PIString::fromNumber(dataBitsCount());
if (parameters()[ParityControl]) {
if (parameters()[ParityOdd]) ret << ":O";
else ret << ":E";
} else ret << ":N";
if (parameters()[TwoStopBits]) ret << ":2";
else ret << ":1";
if (parameters()[ParityOdd]) ret += ":O";
else ret += ":E";
} else ret += ":N";
if (parameters()[TwoStopBits]) ret += ":2";
else ret += ":1";
return ret;
}