mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2025-10-29 18:02:20 +00:00
76 lines
2.4 KiB
C++
76 lines
2.4 KiB
C++
//
|
|
// Created by Stephane Bourque on 2021-05-07.
|
|
//
|
|
|
|
#include <aws/core/Aws.h>
|
|
#include <aws/s3/model/CreateBucketRequest.h>
|
|
#include <aws/s3/model/PutObjectRequest.h>
|
|
#include <aws/s3/model/AccessControlPolicy.h>
|
|
#include <aws/s3/model/PutBucketAclRequest.h>
|
|
#include <aws/s3/model/GetBucketAclRequest.h>
|
|
|
|
#include "Daemon.h"
|
|
#include "StorageService.h"
|
|
#include "ManifestCreator.h"
|
|
#include "NewConnectionHandler.h"
|
|
#include "LatestFirmwareCache.h"
|
|
#include "DeviceCache.h"
|
|
#include "FirmwareCache.h"
|
|
#include "AutoUpdater.h"
|
|
#include "NewCommandHandler.h"
|
|
|
|
#include "framework/UI_WebSocketClientServer.h"
|
|
|
|
namespace OpenWifi {
|
|
class Daemon *Daemon::instance_ = nullptr;
|
|
|
|
class Daemon *Daemon::instance() {
|
|
if (instance_ == nullptr) {
|
|
instance_ = new Daemon(vDAEMON_PROPERTIES_FILENAME,
|
|
vDAEMON_ROOT_ENV_VAR,
|
|
vDAEMON_CONFIG_ENV_VAR,
|
|
vDAEMON_APP_NAME,
|
|
vDAEMON_BUS_TIMER,
|
|
SubSystemVec{
|
|
StorageService(),
|
|
FirmwareCache(),
|
|
LatestFirmwareCache(),
|
|
DeviceCache(),
|
|
NewConnectionHandler(),
|
|
ManifestCreator(),
|
|
AutoUpdater(),
|
|
NewCommandHandler(),
|
|
UI_WebSocketClientServer()
|
|
});
|
|
}
|
|
return instance_;
|
|
}
|
|
|
|
void Daemon::PostInitialization([[maybe_unused]] Poco::Util::Application &self) {
|
|
}
|
|
|
|
void DaemonPostInitialization(Poco::Util::Application &self) {
|
|
Daemon()->PostInitialization(self);
|
|
}
|
|
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
SSL_library_init();
|
|
Aws::SDKOptions AwsOptions;
|
|
AwsOptions.memoryManagementOptions.memoryManager = nullptr;
|
|
AwsOptions.cryptoOptions.initAndCleanupOpenSSL = false;
|
|
AwsOptions.httpOptions.initAndCleanupCurl = true;
|
|
|
|
Aws::InitAPI(AwsOptions);
|
|
|
|
int ExitCode=0;
|
|
{
|
|
auto App = OpenWifi::Daemon::instance();
|
|
ExitCode = App->run(argc, argv);
|
|
}
|
|
|
|
ShutdownAPI(AwsOptions);
|
|
return ExitCode;
|
|
}
|