PICloud connect/disconnect

This commit is contained in:
2021-04-06 15:24:58 +03:00
parent fcd4e5aa71
commit be0db84147
15 changed files with 217 additions and 38 deletions

View File

@@ -20,11 +20,13 @@ PIString CloudServer::serverName() const {
void CloudServer::addClient(DispatcherClient * c) {
clients << c;
index_clients.insert(c->clientId(), c);
}
void CloudServer::removeClient(DispatcherClient * c) {
clients.removeOne(c);
index_clients.removeOne(c->clientId());
}
@@ -34,9 +36,11 @@ PIVector<DispatcherClient *> CloudServer::getClients() {
void CloudServer::printStatus() {
piCout << " " << "Clients for" << server->address() << ":";
piCout << " " << "Clients for" << server->address() << server_name << ":";
for (auto c: clients) {
piCout << " " << c->address();
piCout << " " << c->address() << c->clientId();
}
for (auto c: clients) c->sendData(PIByteArray::fromHex("000000"));
server->sendData(PIByteArray::fromHex("000000"));
}