15 #ifndef VISIONTRANSFER_DEVICEINFO_H 16 #define VISIONTRANSFER_DEVICEINFO_H 29 : lastFps(0.0), jumboSize(0), currentCaptureSource(
""), validStatus(
false) { }
30 DeviceStatus(
double lastFps,
unsigned int jumboSize,
const std::string& currentCaptureSource)
31 : lastFps(lastFps), jumboSize(jumboSize), currentCaptureSource(currentCaptureSource), validStatus(
true) { }
32 bool isValid()
const {
return validStatus; }
33 double getLastFps()
const {
return lastFps; }
34 unsigned int getJumboMtu()
const {
return jumboSize; }
35 unsigned int getJumboFramesEnabled()
const {
return jumboSize > 0; }
36 std::string getCurrentCaptureSource()
const {
return currentCaptureSource; }
39 unsigned int jumboSize;
40 std::string currentCaptureSource;
54 enum NetworkProtocol {
62 DeviceInfo(): ip(
""), protocol(PROTOCOL_TCP), fwVersion(
""), model(SCENESCAN),
77 DeviceInfo(
const char* ip, NetworkProtocol protocol,
const char* fwVersion,
78 DeviceModel model,
bool compatible)
79 : ip(ip), protocol(protocol), fwVersion(fwVersion), model(model),
80 compatible(compatible) {
86 DeviceInfo(
const char* ip, NetworkProtocol protocol,
const char* fwVersion,
87 DeviceModel model,
bool compatible,
const DeviceStatus& status)
88 : ip(ip), protocol(protocol), fwVersion(fwVersion), model(model),
89 compatible(compatible), status(status){
142 return ip +
"; SceneScan" + (model == SCENESCAN_PRO ?
" Pro" :
"")
143 +
"; " + fwVersion +
"; " + (compatible ?
"compatible" :
"incompatible");
150 return ip == other.ip && protocol == other.protocol && fwVersion == other.fwVersion
151 && model == other.model && compatible == other.compatible;
156 NetworkProtocol protocol;
157 std::string fwVersion;
DeviceModel getModel() const
Gets the model identifier of the discovered device.
std::string getIpAddress() const
Gets the IP address of the device.
DeviceInfo(const char *ip, NetworkProtocol protocol, const char *fwVersion, DeviceModel model, bool compatible)
Constructs an object by initializing all members with data from the given parameters.
std::string toString() const
Converts this object to a printable string.
std::string getFirmwareVersion() const
Gets the firmware version of the device.
DeviceStatus getStatus() const
Return the status / health as reported by the device.
DeviceInfo(const char *ip, NetworkProtocol protocol, const char *fwVersion, DeviceModel model, bool compatible, const DeviceStatus &status)
Construct DeviceInfo with pre-initialized DeviceStatus field, for received health reports...
Aggregates information about a discovered device.
bool isCompatible() const
Returns true if the device is compatible with this API version.
Representation of the current device status / health. Useful for addressing issues with peripherals o...
DeviceInfo()
Constructs an empty object with default information.
NetworkProtocol getNetworkProtocol() const
Gets the network protocol of the device.