picloud data send and receive, not tested

This commit is contained in:
2021-04-07 17:19:58 +03:00
parent fd2e0b2eed
commit 21e00e7176
5 changed files with 25 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ void PICloudClient::setKeepConnection(bool on) {
bool PICloudClient::openDevice() {
PIString p = path();
piCout << "PICloudClient open device" << p;
// piCout << "PICloudClient open device" << p;
bool op = eth.connect(p, false);
if (op) {
mutex_buff.lock();
@@ -97,7 +97,7 @@ bool PICloudClient::closeDevice() {
int PICloudClient::readDevice(void * read_to, int max_size) {
piCoutObj << "readDevice";
// piCoutObj << "readDevice";
if (!is_connected) return -1;
mutex_buff.lock();
cond_buff.wait(mutex_buff, [this](){return !buff.isEmpty();});
@@ -110,7 +110,7 @@ int PICloudClient::readDevice(void * read_to, int max_size) {
int PICloudClient::writeDevice(const void * data, int size) {
piCoutObj << "writeDevice";
// piCoutObj << "writeDevice";
return tcp.sendData(PIByteArray(data, size));
}