Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
DeviceInfo.h
Go to the documentation of this file.
1// Copyright (c) 2025 Optris GmbH Co. KG
2
10
11#pragma once
12
13#include <string>
14#include <ostream>
15
16#include "otcsdk/Api.h"
20
21
22namespace optris
23{
24
32{
33public:
36
37
43 OTC_SDK_API static DeviceType determineDeviceType(unsigned short hardwareRevision, unsigned short firmwareRevision) noexcept;
44
45
51 OTC_SDK_API void setSerialNumber(unsigned long serialNumber) noexcept;
52
58 OTC_SDK_API unsigned long getSerialNumber() const noexcept;
59
67 OTC_SDK_API void setConnectionInterface(const std::string& connectionInterface) noexcept;
68
76 OTC_SDK_API const std::string& getConnectionInterface() const noexcept;
77
85 OTC_SDK_API void setIpAddress(const IpAddress& ipAddress) noexcept;
86
94 OTC_SDK_API const IpAddress& getIpAddress() const noexcept;
95
103 OTC_SDK_API void setPort(const Port& port) noexcept;
104
112 OTC_SDK_API const Port& getPort() const noexcept;
113
119 OTC_SDK_API DeviceType getDeviceType() const noexcept;
120
127 OTC_SDK_API void setRevisions(unsigned short hardware, unsigned short firmware) noexcept;
128
134 OTC_SDK_API unsigned short getHardwareRevision() const noexcept;
135
141 OTC_SDK_API unsigned short getFirmwareRevision() const noexcept;
142
143
149 OTC_SDK_API DeviceInfo clone() const noexcept;
150
151
153 OTC_SDK_API bool operator==(const DeviceInfo& rhs) const noexcept;
155 OTC_SDK_API bool operator!=(const DeviceInfo& rhs) const noexcept;
157 OTC_SDK_API bool operator<(const DeviceInfo& rhs) const noexcept;
158
159
160private:
161 unsigned long _serialNumber;
162
163 std::string _connectionInterface;
164
165 IpAddress _ipAddress;
166 Port _port;
167
168 DeviceType _deviceType;
169
170 unsigned short _hardwareRevision;
171 unsigned short _firmwareRevision;
172};
173
174
175// Inline implementations
176inline void DeviceInfo::setSerialNumber(unsigned long serialNumber) noexcept
177{
178 _serialNumber = serialNumber;
179}
180
181inline unsigned long DeviceInfo::getSerialNumber() const noexcept
182{
183 return _serialNumber;
184}
185
186inline void DeviceInfo::setConnectionInterface(const std::string& connectionInterface) noexcept
187{
188 _connectionInterface = connectionInterface;
189}
190
191inline const std::string& DeviceInfo::getConnectionInterface() const noexcept
192{
193 return _connectionInterface;
194}
195
196inline void DeviceInfo::setIpAddress(const IpAddress& ipAddress) noexcept
197{
198 _ipAddress = ipAddress;
199}
200
201inline const IpAddress& DeviceInfo::getIpAddress() const noexcept
202{
203 return _ipAddress;
204}
205
206inline void DeviceInfo::setPort(const Port& port) noexcept
207{
208 _port = port;
209}
210
211inline const Port& DeviceInfo::getPort() const noexcept
212{
213 return _port;
214}
215
217{
218 return _deviceType;
219}
220
221inline unsigned short DeviceInfo::getHardwareRevision() const noexcept
222{
223 return _hardwareRevision;
224}
225
226inline unsigned short DeviceInfo::getFirmwareRevision() const noexcept
227{
228 return _firmwareRevision;
229}
230
231inline DeviceInfo DeviceInfo::clone() const noexcept
232{
233 return DeviceInfo{*this};
234}
235
236inline bool DeviceInfo::operator==(const DeviceInfo& rhs) const noexcept
237{
238 return _serialNumber == rhs._serialNumber;
239}
240
241inline bool DeviceInfo::operator!=(const DeviceInfo& rhs) const noexcept
242{
243 return _serialNumber != rhs._serialNumber;
244}
245
246inline bool DeviceInfo::operator<(const DeviceInfo& rhs) const noexcept
247{
248 return _serialNumber < rhs._serialNumber;
249}
250
251} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Contains an enum representing the different types of Optris thermal cameras.
Contains a class holding IP v4 address.
Contains a class representing an network port.
OTC_SDK_API void setPort(const Port &port) noexcept
Sets the port.
Definition DeviceInfo.h:206
OTC_SDK_API bool operator!=(const DeviceInfo &rhs) const noexcept
Unequals operator.
Definition DeviceInfo.h:241
OTC_SDK_API void setSerialNumber(unsigned long serialNumber) noexcept
Sets the serial number of the device.
Definition DeviceInfo.h:176
OTC_SDK_API void setIpAddress(const IpAddress &ipAddress) noexcept
Sets the IP address.
Definition DeviceInfo.h:196
OTC_SDK_API void setRevisions(unsigned short hardware, unsigned short firmware) noexcept
Sets the hardware and firmware revisions.
OTC_SDK_API const std::string & getConnectionInterface() const noexcept
Returns the connection interface of the device.
Definition DeviceInfo.h:191
OTC_SDK_API DeviceInfo clone() const noexcept
Returns a complete copy of this informatin.
Definition DeviceInfo.h:231
OTC_SDK_API const IpAddress & getIpAddress() const noexcept
Returns the IP address.
Definition DeviceInfo.h:201
static OTC_SDK_API DeviceType determineDeviceType(unsigned short hardwareRevision, unsigned short firmwareRevision) noexcept
Determines the device type based on the provided hardware and firmware revisions.
OTC_SDK_API DeviceInfo() noexcept
Constructor.
OTC_SDK_API void setConnectionInterface(const std::string &connectionInterface) noexcept
Sets the connection interface of the device.
Definition DeviceInfo.h:186
OTC_SDK_API bool operator==(const DeviceInfo &rhs) const noexcept
Equals operator.
Definition DeviceInfo.h:236
OTC_SDK_API unsigned long getSerialNumber() const noexcept
Returns the serial number of the device.
Definition DeviceInfo.h:181
OTC_SDK_API unsigned short getHardwareRevision() const noexcept
Returns the hardware revision.
Definition DeviceInfo.h:221
OTC_SDK_API const Port & getPort() const noexcept
Returns the port.
Definition DeviceInfo.h:211
OTC_SDK_API unsigned short getFirmwareRevision() const noexcept
Returns the firmware revision.
Definition DeviceInfo.h:226
OTC_SDK_API bool operator<(const DeviceInfo &rhs) const noexcept
Less than operator.
Definition DeviceInfo.h:246
OTC_SDK_API DeviceType getDeviceType() const noexcept
Return the device type.
Definition DeviceInfo.h:216
Encapsulates an IP v4 address.
Definition IpAddress.h:33
Encapsulates a network port number.
Definition Port.h:34
Main SDK namespace.
Definition DeviceInfo.h:23
DeviceType
Represents the different types of Optris thermal cameras.
Definition DeviceType.h:24