Thermal Camera SDK 11.3.0
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
DeviceInfo.h
Go to the documentation of this file.
1// Copyright (c) 2008-2026 Optris GmbH & Co. KG
2
10
11#pragma once
12
13#include <string>
14#include <tuple>
15
16#include "otcsdk/Api.h"
21
22
23namespace optris
24{
25
33{
34public:
37
38
44 OTC_SDK_API static DeviceType determineDeviceType(unsigned short hardwareRevision, unsigned short firmwareRevision) noexcept;
45
46
52 OTC_SDK_API void setSerialNumber(unsigned long serialNumber) noexcept;
53
59 OTC_SDK_API unsigned long getSerialNumber() const noexcept;
60
68 OTC_SDK_API void setConnectionInterface(const std::string& connectionInterface) noexcept;
69
77 OTC_SDK_API const std::string& getConnectionInterface() const noexcept;
78
86 OTC_SDK_API void setConnectionInterfaceAddress(const std::string& address) noexcept;
87
95 OTC_SDK_API const std::string& getConnectionInterfaceAddress() const noexcept;
96
104 OTC_SDK_API void setIpAddress(const IpAddress& ipAddress) noexcept;
105
113 OTC_SDK_API const IpAddress& getIpAddress() const noexcept;
114
122 OTC_SDK_API void setTargetIpAddress(const IpAddress& ipAddress) noexcept;
123
131 OTC_SDK_API const IpAddress& getTargetIpAddress() const noexcept;
132
140 OTC_SDK_API void setPort(const Port& port) noexcept;
141
149 OTC_SDK_API const Port& getPort() const noexcept;
150
156 OTC_SDK_API DeviceType getDeviceType() const noexcept;
157
164 OTC_SDK_API void setRevisions(unsigned short hardware, unsigned short firmware) noexcept;
165
171 OTC_SDK_API unsigned short getHardwareRevision() const noexcept;
172
178 OTC_SDK_API unsigned short getFirmwareRevision() const noexcept;
179
185 OTC_SDK_API void setBusy(bool busy) noexcept;
186
194 OTC_SDK_API bool isBusy() const noexcept;
195
201 OTC_SDK_API void setMacAddress(const MacAddress& mac) noexcept;
202
208 OTC_SDK_API const MacAddress& getMacAddress() const noexcept;
209
210
212 bool operator==(const DeviceInfo& rhs) const noexcept;
214 bool operator!=(const DeviceInfo& rhs) const noexcept;
216 bool operator<(const DeviceInfo& rhs) const noexcept;
217
218
219private:
220 DeviceType _deviceType;
221 std::string _connectionInterface;
222 std::string _connectionInterfaceAddress;
223
224
225 MacAddress _deviceMacAddress;
226 IpAddress _deviceIpAddress;
227 IpAddress _targetIpAddress;
228 Port _targetPort;
229
230 unsigned long _serialNumber;
231 unsigned short _hardwareRevision;
232 unsigned short _firmwareRevision;
233 bool _busy;
234};
235
236
237// Inline implementations
238inline void DeviceInfo::setSerialNumber(unsigned long serialNumber) noexcept
239{
240 _serialNumber = serialNumber;
241}
242
243inline unsigned long DeviceInfo::getSerialNumber() const noexcept
244{
245 return _serialNumber;
246}
247
248inline const std::string& DeviceInfo::getConnectionInterface() const noexcept
249{
250 return _connectionInterface;
251}
252
253inline void DeviceInfo::setConnectionInterfaceAddress(const std::string& address) noexcept
254{
255 _connectionInterfaceAddress = address;
256}
257
258inline const std::string& DeviceInfo::getConnectionInterfaceAddress() const noexcept
259{
260 return _connectionInterfaceAddress;
261}
262
263inline void DeviceInfo::setIpAddress(const IpAddress& ipAddress) noexcept
264{
265 _deviceIpAddress = ipAddress;
266}
267
268inline const IpAddress& DeviceInfo::getIpAddress() const noexcept
269{
270 return _deviceIpAddress;
271}
272
273inline void DeviceInfo::setTargetIpAddress(const IpAddress& ipAddress) noexcept
274{
275 _targetIpAddress = ipAddress;
276}
277
278inline const IpAddress& DeviceInfo::getTargetIpAddress() const noexcept
279{
280 return _targetIpAddress;
281}
282
283inline void DeviceInfo::setPort(const Port& port) noexcept
284{
285 _targetPort = port;
286}
287
288inline const Port& DeviceInfo::getPort() const noexcept
289{
290 return _targetPort;
291}
292
294{
295 return _deviceType;
296}
297
298inline unsigned short DeviceInfo::getHardwareRevision() const noexcept
299{
300 return _hardwareRevision;
301}
302
303inline unsigned short DeviceInfo::getFirmwareRevision() const noexcept
304{
305 return _firmwareRevision;
306}
307
308inline void DeviceInfo::setBusy(bool busy) noexcept
309{
310 _busy = busy;
311}
312
313inline bool DeviceInfo::isBusy() const noexcept
314{
315 return _busy;
316}
317
318inline void DeviceInfo::setMacAddress(const MacAddress& macAddress) noexcept
319{
320 _deviceMacAddress = macAddress;
321}
322
323inline const MacAddress& DeviceInfo::getMacAddress() const noexcept
324{
325 return _deviceMacAddress;
326}
327
328inline bool DeviceInfo::operator==(const DeviceInfo& rhs) const noexcept
329{
330 return (_deviceType == rhs._deviceType &&
331 _connectionInterface == rhs._connectionInterface &&
332 _connectionInterfaceAddress == rhs._connectionInterfaceAddress &&
333 _deviceMacAddress == rhs._deviceMacAddress &&
334 _deviceIpAddress == rhs._deviceIpAddress &&
335 _targetIpAddress == rhs._targetIpAddress &&
336 _targetPort == rhs._targetPort &&
337 _serialNumber == rhs._serialNumber &&
338 _hardwareRevision == rhs._hardwareRevision &&
339 _firmwareRevision == rhs._firmwareRevision &&
340 _busy == rhs._busy);
341}
342
343inline bool DeviceInfo::operator!=(const DeviceInfo& rhs) const noexcept
344{
345 return !operator==(rhs);
346}
347
348inline bool DeviceInfo::operator<(const DeviceInfo& rhs) const noexcept
349{
350 return std::tie(_serialNumber, _connectionInterface) < std::tie(rhs._serialNumber, rhs._connectionInterface);
351}
352
353} // 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 a MAC address.
Contains a class representing an network port.
OTC_SDK_API void setBusy(bool busy) noexcept
Sets the device busy state.
Definition DeviceInfo.h:308
OTC_SDK_API const IpAddress & getTargetIpAddress() const noexcept
Returns the IP address of the streaming target.
Definition DeviceInfo.h:278
OTC_SDK_API void setPort(const Port &port) noexcept
Sets the port.
Definition DeviceInfo.h:283
bool operator!=(const DeviceInfo &rhs) const noexcept
Unequals operator.
Definition DeviceInfo.h:343
OTC_SDK_API const std::string & getConnectionInterfaceAddress() const noexcept
Returns the address of the local connection interface through which the camera is connected.
Definition DeviceInfo.h:258
OTC_SDK_API void setSerialNumber(unsigned long serialNumber) noexcept
Sets the serial number of the device.
Definition DeviceInfo.h:238
OTC_SDK_API void setIpAddress(const IpAddress &ipAddress) noexcept
Sets the IP address.
Definition DeviceInfo.h:263
OTC_SDK_API void setMacAddress(const MacAddress &mac) noexcept
Sets the MAC address.
Definition DeviceInfo.h:318
OTC_SDK_API void setRevisions(unsigned short hardware, unsigned short firmware) noexcept
Sets the hardware and firmware revisions.
OTC_SDK_API void setTargetIpAddress(const IpAddress &ipAddress) noexcept
Sets the IP address of the streaming target.
Definition DeviceInfo.h:273
OTC_SDK_API const std::string & getConnectionInterface() const noexcept
Returns the connection interface of the device.
Definition DeviceInfo.h:248
OTC_SDK_API const MacAddress & getMacAddress() const noexcept
Returns the MAC address.
Definition DeviceInfo.h:323
OTC_SDK_API const IpAddress & getIpAddress() const noexcept
Returns the IP address.
Definition DeviceInfo.h:268
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 bool isBusy() const noexcept
Returns whether the device is busy.
Definition DeviceInfo.h:313
bool operator==(const DeviceInfo &rhs) const noexcept
Equals operator.
Definition DeviceInfo.h:328
OTC_SDK_API void setConnectionInterfaceAddress(const std::string &address) noexcept
Sets the address of the local connection interface through which the camera is connected.
Definition DeviceInfo.h:253
OTC_SDK_API unsigned long getSerialNumber() const noexcept
Returns the serial number of the device.
Definition DeviceInfo.h:243
OTC_SDK_API unsigned short getHardwareRevision() const noexcept
Returns the hardware revision.
Definition DeviceInfo.h:298
OTC_SDK_API const Port & getPort() const noexcept
Returns the port.
Definition DeviceInfo.h:288
OTC_SDK_API unsigned short getFirmwareRevision() const noexcept
Returns the firmware revision.
Definition DeviceInfo.h:303
OTC_SDK_API void setConnectionInterface(const std::string &connectionInterface) noexcept
Sets the connection interface of the device.
bool operator<(const DeviceInfo &rhs) const noexcept
Less than operator.
Definition DeviceInfo.h:348
OTC_SDK_API DeviceType getDeviceType() const noexcept
Return the device type.
Definition DeviceInfo.h:293
Encapsulates an IP v4 address.
Definition IpAddress.h:33
Encapsulates a media access control address (MAC address).
Definition MacAddress.h:34
Encapsulates a network port number.
Definition Port.h:34
Main SDK namespace.
Definition AlarmChannel.h:21
DeviceType
Represents the different types of Optris thermal cameras.
Definition DeviceType.h:24