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"
69 std::future<void>
CampaignControl(
const std::string& campaign_id, campaign::Cmd cmd);
92 std::future<result::Download>
Download(
const std::vector<Uptane::Target>& updates);
102 std::vector<Uptane::Target> installs;
104 using InstallationLog = std::vector<InstallationLogEntry>;
105 InstallationLog GetInstallationLog();
138 std::future<result::Install>
Install(
const std::vector<Uptane::Target>& updates);
151 std::future<bool>
SendManifest(
const Json::Value& custom = Json::nullValue);
191 void AddSecondary(
const std::shared_ptr<Uptane::SecondaryInterface>& secondary);
209 using SigHandler = std::function<void(std::shared_ptr<event::BaseEvent>)>;
222 Aktualizr(
Config config, std::shared_ptr<INvStorage> storage_in, std::shared_ptr<HttpInterface> http_in);
224 std::shared_ptr<SotaUptaneClient> uptane_client_;
229 std::condition_variable cv;
233 std::shared_ptr<INvStorage> storage_;
234 std::shared_ptr<event::Channel> sig_;
238 #endif // AKTUALIZR_H_
result::Pause Resume()
Resume the library operations.
std::future< void > RunForever()
Asynchronously run aktualizr indefinitely until Shutdown is called.
std::future< result::Install > Install(const std::vector< Uptane::Target > &updates)
Install targets.
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< 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,...
std::future< void > SendDeviceData()
Send local device data to the server.
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.