version 2.93 ready to master

remove PIString << operators
This commit is contained in:
2022-06-24 12:10:57 +03:00
parent b66272a68a
commit 1b04d7ecce
19 changed files with 119 additions and 183 deletions

View File

@@ -516,14 +516,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;
}
}
@@ -532,12 +532,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;
}
}
@@ -857,13 +857,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;
}