Thermal Camera SDK 10.1.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
DeviceInfo.h
Go to the documentation of this file.
1// Copyright (c) 2008-2025 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
215 OTC_SDK_API DeviceInfo clone() const noexcept;
216
218 bool operator==(const DeviceInfo& rhs) const noexcept;
220 bool operator!=(const DeviceInfo& rhs) const noexcept;
222 bool operator<(const DeviceInfo& rhs) const noexcept;
223
224
225private:
226 DeviceType _deviceType;
227 std::string _connectionInterface;
228 std::string _connectionInterfaceAddress;
229
230
231 MacAddress _deviceMacAddress;
232 IpAddress _deviceIpAddress;
233 IpAddress _targetIpAddress;
234 Port _targetPort;
235
236 unsigned long _serialNumber;
237 unsigned short _hardwareRevision;
238 unsigned short _firmwareRevision;
239 bool _busy;
240};
241
242
243// Inline implementations
244inline void DeviceInfo::setSerialNumber(unsigned long serialNumber) noexcept
245{
246 _serialNumber = serialNumber;
247}
248
249inline unsigned long DeviceInfo::getSerialNumber() const noexcept
250{
251 return _serialNumber;
252}
253
254inline const std::string& DeviceInfo::getConnectionInterface() const noexcept
255{
256 return _connectionInterface;
257}
258
259inline void DeviceInfo::setConnectionInterfaceAddress(const std::string& address) noexcept
260{
261 _connectionInterfaceAddress = address;
262}
263
264inline const std::string& DeviceInfo::getConnectionInterfaceAddress() const noexcept
265{
266 return _connectionInterfaceAddress;
267}
268
269inline void DeviceInfo::setIpAddress(const IpAddress& ipAddress) noexcept
270{
271 _deviceIpAddress = ipAddress;
272}
273
274inline const IpAddress& DeviceInfo::getIpAddress() const noexcept
275{
276 return _deviceIpAddress;
277}
278
279inline void DeviceInfo::setTargetIpAddress(const IpAddress& ipAddress) noexcept
280{
281 _targetIpAddress = ipAddress;
282}
283
284inline const IpAddress& DeviceInfo::getTargetIpAddress() const noexcept
285{
286 return _targetIpAddress;
287}
288
289inline void DeviceInfo::setPort(const Port& port) noexcept
290{
291 _targetPort = port;
292}
293
294inline const Port& DeviceInfo::getPort() const noexcept
295{
296 return _targetPort;
297}
298
300{
301 return _deviceType;
302}
303
304inline unsigned short DeviceInfo::getHardwareRevision() const noexcept
305{
306 return _hardwareRevision;
307}
308
309inline unsigned short DeviceInfo::getFirmwareRevision() const noexcept
310{
311 return _firmwareRevision;
312}
313
314inline void DeviceInfo::setBusy(bool busy) noexcept
315{
316 _busy = busy;
317}
318
319inline bool DeviceInfo::isBusy() const noexcept
320{
321 return _busy;
322}
323
324inline void DeviceInfo::setMacAddress(const MacAddress& macAddress) noexcept
325{
326 _deviceMacAddress = macAddress;
327}
328
329inline const MacAddress& DeviceInfo::getMacAddress() const noexcept
330{
331 return _deviceMacAddress;
332}
333
334inline DeviceInfo DeviceInfo::clone() const noexcept
335{
336 return DeviceInfo{*this};
337}
338
339inline bool DeviceInfo::operator==(const DeviceInfo& rhs) const noexcept
340{
341 return (_deviceType == rhs._deviceType &&
342 _connectionInterface == rhs._connectionInterface &&
343 _connectionInterfaceAddress == rhs._connectionInterfaceAddress &&
344 _deviceMacAddress == rhs._deviceMacAddress &&
345 _deviceIpAddress == rhs._deviceIpAddress &&
346 _targetIpAddress == rhs._targetIpAddress &&
347 _targetPort == rhs._targetPort &&
348 _serialNumber == rhs._serialNumber &&
349 _hardwareRevision == rhs._hardwareRevision &&
350 _firmwareRevision == rhs._firmwareRevision &&
351 _busy == rhs._busy);
352}
353
354inline bool DeviceInfo::operator!=(const DeviceInfo& rhs) const noexcept
355{
356 return !operator==(rhs);
357}
358
359inline bool DeviceInfo::operator<(const DeviceInfo& rhs) const noexcept
360{
361 return std::tie(_serialNumber, _connectionInterface) < std::tie(rhs._serialNumber, rhs._connectionInterface);
362}
363
364} // 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:314
OTC_SDK_API const IpAddress & getTargetIpAddress() const noexcept
Returns the IP address of the streaming target.
Definition DeviceInfo.h:284
OTC_SDK_API void setPort(const Port &port) noexcept
Sets the port.
Definition DeviceInfo.h:289
bool operator!=(const DeviceInfo &rhs) const noexcept
Unequals operator.
Definition DeviceInfo.h:354
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:264
OTC_SDK_API void setSerialNumber(unsigned long serialNumber) noexcept
Sets the serial number of the device.
Definition DeviceInfo.h:244
OTC_SDK_API void setIpAddress(const IpAddress &ipAddress) noexcept
Sets the IP address.
Definition DeviceInfo.h:269
OTC_SDK_API void setMacAddress(const MacAddress &mac) noexcept
Sets the MAC address.
Definition DeviceInfo.h:324
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:279
OTC_SDK_API const std::string & getConnectionInterface() const noexcept
Returns the connection interface of the device.
Definition DeviceInfo.h:254
OTC_SDK_API const MacAddress & getMacAddress() const noexcept
Returns the MAC address.
Definition DeviceInfo.h:329
OTC_SDK_API DeviceInfo clone() const noexcept
Returns a complete copy of this informatin.
Definition DeviceInfo.h:334
OTC_SDK_API const IpAddress & getIpAddress() const noexcept
Returns the IP address.
Definition DeviceInfo.h:274
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:319
bool operator==(const DeviceInfo &rhs) const noexcept
Equals operator.
Definition DeviceInfo.h:339
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:259
OTC_SDK_API unsigned long getSerialNumber() const noexcept
Returns the serial number of the device.
Definition DeviceInfo.h:249
OTC_SDK_API unsigned short getHardwareRevision() const noexcept
Returns the hardware revision.
Definition DeviceInfo.h:304
OTC_SDK_API const Port & getPort() const noexcept
Returns the port.
Definition DeviceInfo.h:294
OTC_SDK_API unsigned short getFirmwareRevision() const noexcept
Returns the firmware revision.
Definition DeviceInfo.h:309
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:359
OTC_SDK_API DeviceType getDeviceType() const noexcept
Return the device type.
Definition DeviceInfo.h:299
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 DeviceInfo.h:24
DeviceType
Represents the different types of Optris thermal cameras.
Definition DeviceType.h:24