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,
const 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_
void AddSecondary(const std::shared_ptr< Uptane::SecondaryInterface > &secondary)
Add new Secondary to aktualizr.
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.
bool UptaneCycle()
Synchronously run an Uptane cycle: check for updates, download any new targets, install them...
result::Pause Resume()
Resume the library operations.
std::vector< SecondaryInfo > GetSecondaries() const
Returns a list of the registered Secondaries, along with some associated metadata.
bool IsRegistered() const
Returns true if the device has been registered to the backend succesffully.
Aktualizr(const Config &config)
Aktualizr requires a configuration object.
Configuration object for an aktualizr instance running on a Primary ECU.
std::future< void > RunForever(const Json::Value &custom_hwinfo=Json::nullValue)
Asynchronously run aktualizr indefinitely until Shutdown is called.
void DeleteStoredTarget(const Uptane::Target &target)
Delete a stored target from storage.
void Shutdown()
Shuts down currently running RunForever() method.
std::future< result::Download > Download(const std::vector< Uptane::Target > &updates)
Download targets.
std::future< result::UpdateCheck > CheckUpdates()
Fetch Uptane metadata and check for updates.
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...
result::Pause Pause()
Pause the library operations.
std::future< result::Install > Install(const std::vector< Uptane::Target > &updates)
Install targets.
std::future< result::CampaignCheck > CampaignCheck()
Check for campaigns.
std::future< void > SendDeviceData(const Json::Value &custom_hwinfo=Json::nullValue)
Send local device data to the server.
boost::signals2::connection SetSignalHandler(const SigHandler &handler)
Provide a function to receive event notifications.
std::future< bool > SendManifest(const Json::Value &custom=Json::nullValue)
Send installation report to the backend.
This class provides the main APIs necessary for launching and controlling libaktualizr.
void Initialize()
Initialize aktualizr.
std::unique_ptr< StorageTargetRHandle > OpenStoredTarget(const Uptane::Target &target)
Get target downloaded in Download call.
std::future< void > CampaignControl(const std::string &campaign_id, campaign::Cmd cmd)
Act on campaign: accept, decline or postpone.
Get log of installations.