picloud data send and receive, not tested
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user