PICloud small patches
This commit is contained in:
@@ -42,6 +42,7 @@ PICloudClient::~PICloudClient() {
|
||||
eth.close();
|
||||
if (is_connected) {
|
||||
is_connected = false;
|
||||
disconnected();
|
||||
cond_buff.notifyOne();
|
||||
cond_connect.notifyOne();
|
||||
}
|
||||
@@ -86,6 +87,7 @@ bool PICloudClient::openDevice() {
|
||||
bool PICloudClient::closeDevice() {
|
||||
if (is_connected) {
|
||||
is_connected = false;
|
||||
disconnected();
|
||||
cond_buff.notifyOne();
|
||||
cond_connect.notifyOne();
|
||||
}
|
||||
@@ -122,6 +124,7 @@ void PICloudClient::_readed(PIByteArray & ba) {
|
||||
case PICloud::TCP::Connect:
|
||||
if (tcp.parseConnect(ba) == 1) {
|
||||
is_connected = true;
|
||||
connected();
|
||||
cond_connect.notifyOne();
|
||||
}
|
||||
break;
|
||||
@@ -129,6 +132,7 @@ void PICloudClient::_readed(PIByteArray & ba) {
|
||||
is_connected = false;
|
||||
eth.stop();
|
||||
eth.close();
|
||||
disconnected();
|
||||
break;
|
||||
case PICloud::TCP::Data:
|
||||
if (is_connected) {
|
||||
|
||||
Reference in New Issue
Block a user