Aktualizr
C++ SOTA Client
|
7 #include <boost/signals2.hpp>
9 #include "config/config.h"
11 #include "sotauptaneclient.h"
12 #include "storage/invstorage.h"
13 #include "uptane/secondaryinterface.h"
14 #include "utilities/apiqueue.h"
45 std::future<void>
RunForever(
const Json::Value& custom_hwinfo = Json::nullValue);
70 std::future<void>
CampaignControl(
const std::string& campaign_id, campaign::Cmd cmd);
78 std::future<void>
SendDeviceData(
const Json::Value& custom_hwinfo = Json::nullValue);
94 std::future<result::Download>
Download(
const std::vector<Uptane::Target>& updates);
104 std::vector<Uptane::Target> installs;
106 using InstallationLog = std::vector<InstallationLogEntry>;
107 InstallationLog GetInstallationLog();
140 std::future<result::Install>
Install(
const std::vector<Uptane::Target>& updates);
153 std::future<bool>
SendManifest(
const Json::Value& custom = Json::nullValue);
193 void AddSecondary(
const std::shared_ptr<Uptane::SecondaryInterface>& secondary);
211 using SigHandler = std::function<void(std::shared_ptr<event::BaseEvent>)>;
224 Aktualizr(
Config config, std::shared_ptr<INvStorage> storage_in, std::shared_ptr<HttpInterface> http_in);
226 std::shared_ptr<SotaUptaneClient> uptane_client_;
231 std::condition_variable cv;
235 std::shared_ptr<INvStorage> storage_;
236 std::shared_ptr<event::Channel> sig_;
240 #endif // AKTUALIZR_H_
result::Pause Resume()
Resume the library operations.
std::future< result::Install > Install(const std::vector< Uptane::Target > &updates)
Install targets.
std::future< void > SendDeviceData(const Json::Value &custom_hwinfo=Json::nullValue)
Send local device data to the server.
Aktualizr(const Config &config)
Aktualizr requires a configuration object.
void DeleteStoredTarget(const Uptane::Target &target)
Delete a stored target from storage.
bool IsRegistered() const
Returns true if the device has been registered to the backend succesffully.
std::future< void > RunForever(const Json::Value &custom_hwinfo=Json::nullValue)
Asynchronously run aktualizr indefinitely until Shutdown is called.
std::future< bool > SendManifest(const Json::Value &custom=Json::nullValue)
Send installation report to the backend.
std::future< void > CampaignControl(const std::string &campaign_id, campaign::Cmd cmd)
Act on campaign: accept, decline or postpone.
void Shutdown()
Shuts down currently running RunForever() method.
void Initialize()
Initialize aktualizr.
std::future< result::UpdateCheck > CheckUpdates()
Fetch Uptane metadata and check for updates.
std::future< result::CampaignCheck > CampaignCheck()
Check for campaigns.
Configuration object for an aktualizr instance running on a Primary ECU.
This class provides the main APIs necessary for launching and controlling libaktualizr.
void Abort()
Aborts the currently running command, if it can be aborted, or waits for it to finish; then removes a...
std::vector< Uptane::Target > GetStoredTargets()
Get list of targets currently in storage.
Get log of installations.
boost::signals2::connection SetSignalHandler(const SigHandler &handler)
Provide a function to receive event notifications.
std::vector< SecondaryInfo > GetSecondaries() const
Returns a list of the registered Secondaries, along with some associated metadata.
std::unique_ptr< StorageTargetRHandle > OpenStoredTarget(const Uptane::Target &target)
Get target downloaded in Download call.
bool UptaneCycle()
Synchronously run an Uptane cycle: check for updates, download any new targets, install them,...
void SetSecondaryData(const Uptane::EcuSerial &ecu, const std::string &data)
Store some free-form data to be associated with a particular Secondary, to be retrieved later through...
std::future< result::Download > Download(const std::vector< Uptane::Target > &updates)
Download targets.
void AddSecondary(const std::shared_ptr< Uptane::SecondaryInterface > &secondary)
Add new Secondary to aktualizr.
result::Pause Pause()
Pause the library operations.