15 #ifndef VISIONTRANSFER_DEVICEINFO_H
16 #define VISIONTRANSFER_DEVICEINFO_H
20 namespace visiontransfer {
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;
56 enum NetworkProtocol {
64 DeviceInfo(): ip(
""), protocol(PROTOCOL_TCP), fwVersion(
""), model(SCENESCAN),
65 compatible(false), serialNumber(
"") {
79 DeviceInfo(
const char* ip, NetworkProtocol protocol,
const char* fwVersion,
80 DeviceModel model,
bool compatible,
const std::string& serialNumber)
81 : ip(ip), protocol(protocol), fwVersion(fwVersion), model(model),
82 compatible(compatible), serialNumber(serialNumber) {
88 DeviceInfo(
const char* ip, NetworkProtocol protocol,
const char* fwVersion,
89 DeviceModel model,
bool compatible,
const std::string& serialNumber,
const DeviceStatus& status)
90 : ip(ip), protocol(protocol), fwVersion(fwVersion), model(model),
91 compatible(compatible), serialNumber(serialNumber), status(status){
125 DeviceModel
getModel()
const {
return model;}
130 DeviceStatus
getStatus()
const {
return status; }
150 std::string ret = ip +
"; ";
152 case SCENESCAN_PRO: ret +=
"SceneScan Pro";
break;
153 case SCENESCAN: ret +=
"SceneScan";
break;
154 case SCARLET: ret +=
"Scarlet";
break;
155 case RUBY: ret +=
"Ruby";
break;
156 default: ret +=
"Unknown";
break;
159 ret +=
"; " + fwVersion +
"; " + (compatible ?
"compatible" :
"incompatible");
160 ret +=
"; " + serialNumber;
168 return ip == other.ip && protocol == other.protocol && fwVersion == other.fwVersion
169 && model == other.model && compatible == other.compatible && serialNumber == other.serialNumber;
174 NetworkProtocol protocol;
175 std::string fwVersion;
178 std::string serialNumber;