start develop picloud
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "piccloudclient.h"
|
||||
#include "picloudclient.h"
|
||||
|
||||
|
||||
PICloudClient::PICloudClient() {
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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_";
|
||||
Reference in New Issue
Block a user