picloud next iteration
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
|
||||
|
||||
PICloudServer::PICloudServer(const PIString & path, PIIODevice::DeviceMode mode) : PIIODevice(path, mode), eth(PIEthernet::TCP_Client) {
|
||||
PIString name = "cloud_server_" + PIString::fromNumber(randomi()%1000);
|
||||
tcp.setRole(PICloud::TCP::Server);
|
||||
tcp.setServerName(name);
|
||||
setName(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +40,9 @@ bool PICloudServer::openDevice() {
|
||||
if (op) {
|
||||
CONNECTL(ð, disconnected, [this](bool){opened_ = false;});
|
||||
CONNECTU(ð, threadedReadEvent, this, readed);
|
||||
CONNECTL(ð, connected, [this](){tcp.sendStart(ð);});
|
||||
eth.startThreadedRead();
|
||||
sendStart();
|
||||
tcp.sendStart(ð);
|
||||
return true;
|
||||
}
|
||||
eth.close();
|
||||
@@ -60,12 +65,6 @@ int PICloudServer::writeDevice(const void * data, int max_size) {
|
||||
}
|
||||
|
||||
|
||||
void PICloudServer::sendStart() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
PICloudServer::Client::Client(PICloudServer * srv) : server(srv) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user