Aktualizr
C++ SOTA Client
|
7 #include <boost/signals2.hpp>
9 #include "libaktualizr/config.h"
11 #include "libaktualizr/secondaryinterface.h"
71 std::future<void>
RunForever(
const Json::Value& custom_hwinfo = Json::nullValue);
104 std::future<void>
CampaignControl(
const std::string& campaign_id, campaign::Cmd cmd);
118 std::future<void>
SendDeviceData(
const Json::Value& custom_hwinfo = Json::nullValue);
145 std::future<result::Download>
Download(
const std::vector<Uptane::Target>& updates);
149 std::vector<Uptane::Target> installs;
151 using InstallationLog = std::vector<InstallationLogEntry>;
211 std::future<result::Install>
Install(
const std::vector<Uptane::Target>& updates);
242 std::future<bool>
SendManifest(
const Json::Value& custom = Json::nullValue);
301 void AddSecondary(
const std::shared_ptr<SecondaryInterface>& secondary);
324 using SigHandler = std::function<void(std::shared_ptr<event::BaseEvent>)>;
339 Aktualizr(
Config config, std::shared_ptr<INvStorage> storage_in,
const std::shared_ptr<HttpInterface>& http_in);
341 std::shared_ptr<SotaUptaneClient> uptane_client_;
346 std::condition_variable cv;
350 std::shared_ptr<INvStorage> storage_;
351 std::shared_ptr<event::Channel> sig_;
352 std::unique_ptr<api::CommandQueue> api_queue_;
355 #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.
std::ifstream OpenStoredTarget(const Uptane::Target &target)
Get target downloaded in Download call.
Aktualizr(const Config &config)
Aktualizr requires a configuration object.
void DeleteStoredTarget(const Uptane::Target &target)
Delete a stored target from storage.
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.
bool SetInstallationRawReport(const std::string &custom_raw_report)
SetInstallationRawReport allows setting a custom raw report field in the device installation result.
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 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.
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.
InstallationLog GetInstallationLog()
Get log of installations.
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.
result::Pause Pause()
Pause the library operations.