Zebra Bioptic Color Camera SDK For Linux  1.0.0-17
All Classes Functions Variables Enumerations Enumerator
zebra_camera_manager.h
1 /*
2  * ©2019 Zebra Technologies Corp. and/or its affiliates.
3  */
4 #ifndef ZEBRA_DEVICE_MANAGER_H_
5 #define ZEBRA_DEVICE_MANAGER_H_
6 
7 #include <memory>
8 #include <string>
9 #include <future>
10 #include <mutex>
11 #include <vector>
12 #include <cstdint>
13 
14 #include <string>
15 #include <iostream>
16 #include <sstream>
17 
18 
19 #include "assets.h"
20 #include "firmware_download_event_args.h"
21 #include "device_manager_types.h"
22 #include "zebra_camera.h"
23 
24 namespace zebra {
25 namespace camera_sdk {
26 
27 class PlatformManagementAdapter;
28 class FirmwareUpdater;
29 
33 class FirmwareDownloadEventListener {
34 public:
35  virtual ~FirmwareDownloadEventListener() {}
36  virtual void EventReceived(FirmwareDownloadEventsArgs) = 0;
37 };
38 
39 
43 struct Version {
45  const uint16_t major;
46 
48  const uint16_t minor;
49 
51  const uint16_t patch;
52 
54  const uint16_t build;
55 };
56 
61 {
62 public:
67 
72 
77 
84  std::shared_ptr<ZebraCamera> CreateZebraCamera(zebra::DeviceInfo camera_info);
85 
92  std::shared_ptr<ZebraCamera> Reboot(std::shared_ptr<ZebraCamera> camera, uint16_t timeout = 20);
93 
99  void DownloadFirmware(std::shared_ptr<ZebraCamera> camera, std::string filepath);
100 
107  std::shared_ptr<ZebraCamera> InstallFirmware(std::shared_ptr<ZebraCamera> camera, uint16_t timeout = 20);
108 
112  void CancelFirmwareDownload(std::shared_ptr<ZebraCamera> camera);
113 
118  void AddFirmwareDownloadEventListener(FirmwareDownloadEventListener& firmware_download_event_listener);
119 
120  /*
121  * Remove the specified firmware download event listener.
122  * @param firmware_download_event_listener Reference to the listener object to remove.
123  */
124  void RemoveFirmwareDownloadEventListener(FirmwareDownloadEventListener& firmware_download_event_listener);
125 
131  std::string RetrieveConfiguration(std::shared_ptr<ZebraCamera> camera);
132 
138  void RetrieveConfigurationToFile(std::shared_ptr<ZebraCamera> camera, std::string configuration_file_path);
139 
146  void LoadConfiguration(std::shared_ptr<ZebraCamera> camera, std::string configuration, bool persist=true);
147 
154  void LoadConfigurationFromFile(std::shared_ptr<ZebraCamera> camera, std::string configuration_file_path, bool persist=true);
155 
156 private:
157  std::vector<std::reference_wrapper<FirmwareDownloadEventListener>> firmware_download_listeners_;
158  std::mutex firmware_download_listeners_mutex_;
159 
160  std::shared_ptr<PlatformManagementAdapter> platform_management_adapter_;
161 
162  std::vector<FirmwareUpdater*> firmware_updaters_;
163 
164 private:
165  void OnFirmwareDownloadEvent(const FirmwareDownloadEventsArgs& firmware_download_event);
166 
167  std::vector<FirmwareUpdater*>::iterator GetIterator(std::shared_ptr<ZebraCamera> camera);
168 };
169 
170 } /* namespace camera_sdk */
171 } /* namespace zebra */
172 
173 #endif /* ZEBRA_DEVICE_MANAGER_H_ */
zebra::camera_sdk::Version::major
const uint16_t major
Definition: zebra_camera_manager_client.h:21
zebra::camera_sdk::ZebraCameraManager::DownloadFirmware
void DownloadFirmware(std::shared_ptr< ZebraCamera > camera, std::string filepath)
zebra::camera_sdk::ZebraCameraManager::LoadConfiguration
void LoadConfiguration(std::shared_ptr< ZebraCamera > camera, std::string configuration, bool persist=true)
zebra::camera_sdk::Version::patch
const uint16_t patch
Definition: zebra_camera_manager_client.h:25
zebra::camera_sdk::Version
Definition: zebra_camera_manager_client.h:19
zebra::camera_sdk::FirmwareDownloadEventsArgs
Definition: firmware_download_event_args.h:17
Version
Definition: zebra_camera_manager_types.h:15
zebra::camera_sdk::ZebraCameraManager::GetVersion
Version GetVersion()
zebra::camera_sdk::Version::build
const uint16_t build
Definition: zebra_camera_manager_client.h:27
zebra::camera_sdk::ZebraCameraManager::RetrieveConfiguration
std::string RetrieveConfiguration(std::shared_ptr< ZebraCamera > camera)
zebra::camera_sdk::ZebraCameraManager::CreateZebraCamera
std::shared_ptr< ZebraCamera > CreateZebraCamera(zebra::DeviceInfo camera_info)
zebra::camera_sdk::ZebraCameraManager::InstallFirmware
std::shared_ptr< ZebraCamera > InstallFirmware(std::shared_ptr< ZebraCamera > camera, uint16_t timeout=20)
zebra::camera_sdk::ZebraCameraManager::LoadConfigurationFromFile
void LoadConfigurationFromFile(std::shared_ptr< ZebraCamera > camera, std::string configuration_file_path, bool persist=true)
zebra::camera_sdk::FirmwareDownloadEventListener
Definition: zebra_camera_manager_client.h:36
zebra::camera_sdk::ZebraCameraManager::RetrieveConfigurationToFile
void RetrieveConfigurationToFile(std::shared_ptr< ZebraCamera > camera, std::string configuration_file_path)
zebra::camera_sdk::ZebraCameraManager::~ZebraCameraManager
~ZebraCameraManager()
zebra::camera_sdk::ZebraCameraManager
Definition: zebra_camera_manager.h:61
zebra::camera_sdk::Version::minor
const uint16_t minor
Definition: zebra_camera_manager_client.h:23
zebra::camera_sdk::ZebraCameraManager::ZebraCameraManager
ZebraCameraManager()
zebra::camera_sdk::ZebraCameraManager::AddFirmwareDownloadEventListener
void AddFirmwareDownloadEventListener(FirmwareDownloadEventListener &firmware_download_event_listener)
zebra::camera_sdk::ZebraCameraManager::Reboot
std::shared_ptr< ZebraCamera > Reboot(std::shared_ptr< ZebraCamera > camera, uint16_t timeout=20)
zebra::DeviceInfo
Definition: device_manager_types.h:15
zebra::camera_sdk::ZebraCameraManager::CancelFirmwareDownload
void CancelFirmwareDownload(std::shared_ptr< ZebraCamera > camera)