start develop picloud

This commit is contained in:
2020-08-24 13:23:31 +03:00
parent f033119a8b
commit 3965e54e38
10 changed files with 67 additions and 277 deletions

View File

@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "piccloudclient.h"
#include "picloudclient.h"
PICloudClient::PICloudClient() {

View File

@@ -17,9 +17,34 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "piccloudserver.h"
#include "picloudserver.h"
#include "piethernet.h"
PICloudServer::PICloudServer() {
PICloudServer::PICloudServer(const PIString & path, PIIODevice::DeviceMode mode) : PIIODevice(path, mode) {
eth = new PIEthernet(PIEthernet::TCP_Client);
}
PICloudServer::~PICloudServer() {
}
bool PICloudServer::openDevice() {
piCout << "PICloudServer open device" << path();
bool op = eth->connect(path(), false);
if (op) {
CONNECTL(eth, disconnected, [this](bool){eth->connect(path());});
eth->startThreadedRead();
return true;
}
return false;
}
bool PICloudServer::closeDevice() {
eth->stopThreadedRead();
return eth->close();
}

View File

@@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "piccloudtcp.h"
#include "picloudtcp.h"
#include "picrypt.h"
const char hash_def_key[] = "_picrypt_";