Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-12945
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Sep 23, 2023
1 parent c5737de commit 1948c50
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/AutoDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,43 +71,35 @@ namespace OpenWifi {
auto Msg = dynamic_cast<DiscoveryMessage *>(Note.get());
if (Msg != nullptr) {
try {
DBGLINE
Poco::JSON::Parser Parser;
auto Object = Parser.parse(Msg->Payload()).extract<Poco::JSON::Object::Ptr>();
DBGLINE

std::cout << Msg->Payload() << std::endl;
if (Object->has(uCentralProtocol::PAYLOAD)) {
DBGLINE
auto PayloadObj = Object->getObject(uCentralProtocol::PAYLOAD);
std::string ConnectedIP, SerialNumber, Compatible, Firmware, Locale ;
if (PayloadObj->has(uCentralProtocol::PING)) {
auto PingObj = PayloadObj->getObject("ping");
ProcessPing(PingObj, Firmware, SerialNumber, Compatible, ConnectedIP, Locale);
} else if(PayloadObj->has("capabilities")) {
ProcessConnect(PayloadObj, Firmware, SerialNumber, Compatible, ConnectedIP, Locale);
} else {
std::cout << Msg->Payload() << std::endl;
}

if (!SerialNumber.empty()) {
DBGLINE
StorageService()->InventoryDB().CreateFromConnection(
SerialNumber, ConnectedIP, Compatible, Locale);
}
}
} catch (const Poco::Exception &E) {
DBGLINE
std::cout << "EX:" << Msg->Payload() << std::endl;
Logger().log(E);
DBGLINE
} catch (...) {
DBGLINE
}
} else {
DBGLINE
}
DBGLINE
Note = Queue_.waitDequeueNotification();
DBGLINE
}
}

Expand Down

0 comments on commit 1948c50

Please sign in to comment.