iScanEngineDevice.h
1 #pragma once
2 
3 #include <boost/system/error_code.hpp>
4 #include <boost/asio.hpp>
5 #include <boost/chrono.hpp>
6 #include <math.h>
7 #include <bits/basic_ios.h>
8 
9 namespace dpyImagerscanengine {
10 
12 enum class Actions
13 {
14  REBOOT = 0,
15 };
16 
18 enum class Illumination
19 {
20  ENABLE = 0,
21  DISABLE = 1,
22  BLINK = 2
23 };
24 
26 enum class Brightness
27 {
28  STANDARD = 0,
29  LOW = 1
30 };
31 
33 enum class ReadMode
34 {
35  DISABLE = 0,
36  AUTOTRIGGER = 1,
37  MANUAL = 2
38 };
39 
41 enum class Rotation
42 {
43  NONE = 0,
44  HORIZONTAL = 1,
45  VERTICAL = 2,
47 };
48 
50 enum class DetectionMode
51 {
52  WHITE_ILLUMINATION = 0,
53  NO_ILLUMINATION = 1,
54  GREEN_AIMING = 2
55 };
56 
58 enum class SensitivityMode
59 {
60  SENSITIVE = 0,
61  NORMAL = 1,
62  INSENSITIVE = 2,
63  AUTO = 3
64 
65 };
66 
69 {
77 };
78 
81 {
84 };
85 
86 }
87 
93 {
94 public:
100  virtual void scannerStatusChange(std::string scannerid, const dpyImagerscanengine::ScannerStatus& status) = 0;
101 
107  virtual void scannerNewCode(std::string scannerid, const std::string& scannedcode) = 0;
108 
113  {
114  }
115 };
116 
123 {
124 protected:
125  std::string m_scannerid;
126  std::vector<ScanEngineDeviceObserver*> mObserversList;
127 
128 public:
129  virtual ~IScanEngineDevice();
130 
135  const std::string& getScannerid() const
136  {
137  return m_scannerid;
138  }
139 
140  virtual boost::system::error_code getLastScannedCode(std::string& scanned_code) = 0;
141 
142  boost::system::error_code subscribe(ScanEngineDeviceObserver* observer);
143  boost::system::error_code unsubscribe(ScanEngineDeviceObserver* observer);
144 };
Abstract class which implements all the minimum necessary logic which all scanner must have...
Definition: iScanEngineDevice.h:122
Definition: iScanEngineDevice.h:92
ReadMode
Read Mode to be requested via client.
Definition: iScanEngineDevice.h:33
DetectionMode
Detection Mode to be requested via client.
Definition: iScanEngineDevice.h:50
Scanner error.
Definition: iScanEngineDevice.h:83
int rereadTimeout
Reread Timeout.
Definition: iScanEngineDevice.h:76
SensitivityMode
Sensitivity Mode to be requested via client.
Definition: iScanEngineDevice.h:58
virtual ~ScanEngineDeviceObserver()
Destructor.
Definition: iScanEngineDevice.h:112
Brightness
Brightness to be requested via client.
Definition: iScanEngineDevice.h:26
ReadMode readmode
Read Mode.
Definition: iScanEngineDevice.h:70
Brightness brightness
Brightness.
Definition: iScanEngineDevice.h:72
Illumination illumination
Illumination.
Definition: iScanEngineDevice.h:71
SensitivityMode senseMode
Sensitivity mode.
Definition: iScanEngineDevice.h:75
Rotation
Rotation Mode to be requested via client.
Definition: iScanEngineDevice.h:41
Illumination
Illumination to be requested via client.
Definition: iScanEngineDevice.h:18
Deepsy Imagerscanengine namespace that includes the different enums, structs or method signatures tha...
const std::string & getScannerid() const
Definition: iScanEngineDevice.h:135
DetectionMode detectMode
Detection mode.
Definition: iScanEngineDevice.h:74
Scanner OK.
Definition: iScanEngineDevice.h:82
ScannerStatus
Possible Scanner Status.
Definition: iScanEngineDevice.h:80
Actions
Actions to be requested via client.
Definition: iScanEngineDevice.h:12
Imager Scan Engine Info.
Definition: iScanEngineDevice.h:68
Rotation rotation
Rotation.
Definition: iScanEngineDevice.h:73