migrate to async IO model

new PIIODevice::interrupt() virtual method
new PIWaitEvent private class
PIEthernet and PISerial basically tested on Windows and Linux
This commit is contained in:
2022-11-05 23:43:07 +03:00
parent e48d0ebaab
commit 8a5e72c723
15 changed files with 498 additions and 209 deletions

View File

@@ -45,10 +45,11 @@ PICloudClient::PICloudClient(const PIString & path, PIIODevice::DeviceMode mode)
PICloudClient::~PICloudClient() {
//piCoutObj << "~PICloudClient()";
softStopThreadedRead();
//softStopThreadedRead();
//eth.close();
//if (is_connected) disconnected();
close();
//close();
stopAndWait();
//piCoutObj << "~PICloudClient() closed";
internalDisconnect();
// stop(false);
@@ -69,6 +70,11 @@ void PICloudClient::setKeepConnection(bool on) {
}
void PICloudClient::interrupt() {
eth.interrupt();
}
bool PICloudClient::openDevice() {
//piCoutObj << "open";// << path();
bool op = eth.connect(PIEthernet::Address::resolve(path()), false);