static int __TYCompareFirmwareVersion(TY_DEVICE_BASE_INFO info, int major, int minor) { if (info.firmwareVersion.major < major) { return(-1); } if ((info.firmwareVersion.major == major) && (info.firmwareVersion.minor < minor)) { return(-1); } if ((info.firmwareVersion.major == major) && (info.firmwareVersion.minor == minor)) { return(0); } return(1); }
static int __TYDetectOldVer21ColorCam(IntPtr handle) { TY_DEVICE_BASE_INFO info = new TY_DEVICE_BASE_INFO(); int ret = SDK.TYGetDeviceInfo(handle, info); if (ret < 0) { return(-1); //ERROR } if (info.iface.type == SDK.TY_INTERFACE_USB) { return(1); } ret = __TYCompareFirmwareVersion(info, 2, 2); if (((info.iface.type == SDK.TY_INTERFACE_ETHERNET) || (info.iface.type == SDK.TY_INTERFACE_RAW)) && (ret < 0)) { return(1); } return(0); }