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;
55 enum NetworkProtocol {
63 DeviceInfo(): ip(
""), protocol(PROTOCOL_TCP), fwVersion(
""), model(SCENESCAN),
78 DeviceInfo(
const char* ip, NetworkProtocol protocol,
const char* fwVersion,
79 DeviceModel model,
bool compatible)
80 : ip(ip), protocol(protocol), fwVersion(fwVersion), model(model),
81 compatible(compatible) {
87 DeviceInfo(
const char* ip, NetworkProtocol protocol,
const char* fwVersion,
88 DeviceModel model,
bool compatible,
const DeviceStatus& status)
89 : ip(ip), protocol(protocol), fwVersion(fwVersion), model(model),
90 compatible(compatible), status(status){
144 std::string ret = ip +
"; ";
146 case SCENESCAN_PRO: ret +=
"SceneScan Pro";
break;
147 case SCENESCAN: ret +=
"SceneScan";
break;
148 case SCARLET: ret +=
"Scarlet";
break;
149 default: ret +=
"Unknown";
break;
152 ret +=
"; " + fwVersion +
"; " + (compatible ?
"compatible" :
"incompatible");
160 return ip == other.ip && protocol == other.protocol && fwVersion == other.fwVersion
161 && model == other.model && compatible == other.compatible;
166 NetworkProtocol protocol;
167 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.