Skip to content

Commit 63c8c49

Browse files
authored
Merge pull request #53 from Telecominfraproject/main
Updating release
2 parents d9427c3 + 29932f3 commit 63c8c49

25 files changed

Lines changed: 696 additions & 230 deletions

BUILDING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ from the master copy needed for cmake. Please use the version of this [Poco fix]
1616
Poco may take several minutes depending on the platform you are building on.
1717

1818
## Ubuntu
19-
These instructions have proven to work on Ubuntu 20.4.
19+
These instructions have proven to work on Ubuntu 23.04.
2020
```bash
21-
sudo apt install git cmake g++ libssl-dev libmariadb-dev
21+
sudo apt install git cmake g++ libssl-dev libmariadb-dev libmariadbclient-dev-compat
2222
sudo apt install libpq-dev libaprutil1-dev apache2-dev libboost-all-dev
23-
sudo apt install librdkafka-dev default-libmysqlclient-dev
24-
sudo apt install nlohmann-json-dev
23+
sudo apt install librdkafka-dev
24+
sudo apt install zlib1g-dev nlohmann-json3-dev ca-certificates libcurl4-openssl-dev
2525

2626
cd ~
27-
git clone https://github.com/AriliaWireless/poco --branch poco-tip-v1
27+
git clone https://github.com/AriliaWireless/poco --branch poco-tip-v2
2828
cd poco
2929
mkdir cmake-build
3030
cd cmake-build

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ include_directories(/usr/local/include /usr/local/opt/openssl/include src inclu
6363

6464
configure_file(src/ow_version.h.in ${PROJECT_SOURCE_DIR}/src/ow_version.h @ONLY)
6565

66-
add_definitions(-DPOCO_LOG_DEBUG="1")
66+
add_definitions(-DPOCO_LOG_DEBUG="1" -DBOOST_NO_CXX98_FUNCTION_BASE=1)
6767

6868
add_executable(owanalytics
6969
build

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2
1+
6

src/APStats.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ namespace OpenWifi {
112112
DI_.connected = true;
113113

114114
AnalyticsObjects::DeviceTimePoint DTP;
115-
poco_information(Logger(), fmt::format("{}: stats message.", DI_.serialNumber));
115+
poco_trace(Logger(), fmt::format("{}: stats message.", DI_.serialNumber));
116116

117117
// find radios first to get associations.
118118
try {
@@ -573,7 +573,7 @@ namespace OpenWifi {
573573
try {
574574
if (Connection->contains("ping")) {
575575
got_connection = true;
576-
poco_debug(Logger(), fmt::format("{}: ping message.", DI_.serialNumber));
576+
poco_trace(Logger(), fmt::format("{}: ping message.", DI_.serialNumber));
577577
DI_.connected = true;
578578
DI_.lastPing = Utils::Now();
579579
auto ping = (*Connection)["ping"];
@@ -589,13 +589,13 @@ namespace OpenWifi {
589589
}
590590
}
591591
} else if (Connection->contains("disconnection")) {
592-
poco_debug(Logger(), fmt::format("{}: disconnection message.", DI_.serialNumber));
592+
poco_trace(Logger(), fmt::format("{}: disconnection message.", DI_.serialNumber));
593593
auto Disconnection = (*Connection)["disconnection"];
594594
GetJSON("timestamp", Disconnection, DI_.lastDisconnection, (uint64_t)0);
595595
got_base = got_health = got_connection = false;
596596
DI_.connected = false;
597597
} else if (Connection->contains("capabilities")) {
598-
poco_debug(Logger(), fmt::format("{}: connection message.", DI_.serialNumber));
598+
poco_trace(Logger(), fmt::format("{}: connection message.", DI_.serialNumber));
599599
got_connection = true;
600600
DI_.connected = true;
601601
DI_.lastConnection = Utils::Now();
@@ -621,7 +621,7 @@ namespace OpenWifi {
621621
got_health = true;
622622
GetJSON("timestamp", *Health, DI_.lastHealth, (uint64_t)0);
623623
GetJSON("sanity", *Health, DI_.health, (uint64_t)0);
624-
poco_debug(Logger(), fmt::format("{}: health message.", DI_.serialNumber));
624+
poco_trace(Logger(), fmt::format("{}: health message.", DI_.serialNumber));
625625
} catch (...) {
626626
poco_information(Logger(),
627627
fmt::format("{}: error parsing health message.", DI_.serialNumber));

src/DeviceStatusReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace OpenWifi {
8080
void DeviceStatusReceiver::DeviceStatusReceived(const std::string &Key,
8181
const std::string &Payload) {
8282
std::lock_guard G(Mutex_);
83-
poco_debug(Logger(), fmt::format("Device({}): Connection/Ping message.", Key));
83+
poco_trace(Logger(), fmt::format("Device({}): Connection/Ping message.", Key));
8484
Queue_.enqueueNotification(new DeviceStatusMessage(Key, Payload));
8585
}
8686
} // namespace OpenWifi

src/HealthReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace OpenWifi {
7878

7979
void HealthReceiver::HealthReceived(const std::string &Key, const std::string &Payload) {
8080
std::lock_guard G(Mutex_);
81-
poco_debug(Logger(), fmt::format("Device({}): Health message.", Key));
81+
poco_trace(Logger(), fmt::format("Device({}): Health message.", Key));
8282
Queue_.enqueueNotification(new HealthMessage(Key, Payload));
8383
}
8484
} // namespace OpenWifi

src/StateReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace OpenWifi {
6161

6262
void StateReceiver::StateReceived(const std::string &Key, const std::string &Payload) {
6363
std::lock_guard G(Mutex_);
64-
poco_debug(Logger(), fmt::format("Device({}): State message.", Key));
64+
poco_trace(Logger(), fmt::format("Device({}): State message.", Key));
6565
Queue_.enqueueNotification(new StateMessage(Key, Payload));
6666
}
6767

src/VenueCoordinator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace OpenWifi {
6060
Utils::SetThreadName("venue-coord");
6161
Running_ = true;
6262
while (Running_) {
63-
Poco::Thread::trySleep(20000);
63+
Poco::Thread::trySleep(60000);
6464
if (!Running_)
6565
break;
6666

src/framework/ALBserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace OpenWifi {
2626
Response.set("Connection", "keep-alive");
2727
Response.setVersion(Poco::Net::HTTPMessage::HTTP_1_1);
2828
std::ostream &Answer = Response.send();
29-
Answer << "process Alive and kicking!";
29+
Answer << ALBHealthCheckServer()->CallbackText();
3030
} catch (...) {
3131
}
3232
}

src/framework/ALBserver.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ namespace OpenWifi {
3737
inline static std::atomic_uint64_t req_id_ = 1;
3838
};
3939

40+
typedef std::string ALBHealthMessageCallback();
41+
4042
class ALBHealthCheckServer : public SubSystemServer {
4143
public:
4244
ALBHealthCheckServer();
@@ -48,10 +50,22 @@ namespace OpenWifi {
4850

4951
int Start() override;
5052
void Stop() override;
53+
inline void RegisterExtendedHealthMessage(ALBHealthMessageCallback *F) {
54+
Callback_=F;
55+
};
56+
57+
inline std::string CallbackText() {
58+
if(Callback_== nullptr) {
59+
return "process Alive and kicking!";
60+
} else {
61+
return Callback_();
62+
}
63+
}
5164

5265
private:
5366
std::unique_ptr<Poco::Net::HTTPServer> Server_;
5467
std::unique_ptr<Poco::Net::ServerSocket> Socket_;
68+
ALBHealthMessageCallback *Callback_= nullptr;
5569
int Port_ = 0;
5670
mutable std::atomic_bool Running_ = false;
5771
};

0 commit comments

Comments
 (0)