7 #include <boost/signals2.hpp> 9 #include "libaktualizr/config.h" 11 #include "primary/secondaryinterface.h" 12 #include "sotauptaneclient.h" 13 #include "storage/invstorage.h" 14 #include "utilities/apiqueue.h" 40 std::future<void>
RunForever(
const Json::Value& custom_hwinfo = Json::nullValue);
65 std::future<void>
CampaignControl(
const std::string& campaign_id, campaign::Cmd cmd);
73 std::future<void>
SendDeviceData(
const Json::Value& custom_hwinfo = Json::nullValue);
89 std::future<result::Download>
Download(
const std::vector<Uptane::Target>& updates);
99 std::vector<Uptane::Target> installs;
101 using InstallationLog = std::vector<InstallationLogEntry>;
102 InstallationLog GetInstallationLog();
135 std::future<result::Install>
Install(
const std::vector<Uptane::Target>& updates);
159 std::future<bool>
SendManifest(
const Json::Value& custom = Json::nullValue);
199 void AddSecondary(
const std::shared_ptr<SecondaryInterface>& secondary);
217 using SigHandler = std::function<void(std::shared_ptr<event::BaseEvent>)>;
232 Aktualizr(
Config config, std::shared_ptr<INvStorage> storage_in,
const std::shared_ptr<HttpInterface>& http_in);
234 std::shared_ptr<SotaUptaneClient> uptane_client_;
239 std::condition_variable cv;
243 std::shared_ptr<INvStorage> storage_;
244 std::shared_ptr<event::Channel> sig_;
248 #endif // AKTUALIZR_H_ void AddSecondary(const std::shared_ptr< 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.
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...
bool SetInstallationRawReport(const std::string &custom_raw_report)
SetInstallationRawReport allows setting a custom raw report field in the device installation result...
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::ifstream OpenStoredTarget(const Uptane::Target &target)
Get target downloaded in Download call.
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::future< void > CampaignControl(const std::string &campaign_id, campaign::Cmd cmd)
Act on campaign: accept, decline or postpone.
Get log of installations.