Go to the documentation of this file.
126 return (this->*currentFunction)(deviceId, portInfo, skipDeviceIdCheck);
129 JLDEBUGG(
"No functions defined for device. Defaulting to OneComPort" << deviceId);
144 (void)skipDeviceIdCheck;
157 JLDEBUGG(
"Redetecting device " << deviceId);
161 while (!found && count < 25)
166 JLDEBUGG(
"Attempt " << count <<
". Detected " << portInfoArray.size() <<
" devices.");
168 for (
uint32_t i = 0; i < portInfoArray.size(); i++)
170 portInfo = portInfoArray[i];
171 if ((skipDeviceIdCheck && !portInfo.empty()) || portInfo.deviceId() == deviceId)
173 portInfo = portInfoArray[i];
174 JLDEBUGG(
"Found device: " << portInfo);
179 XsTime::msleep(1000);
182 JLDEBUGG(
"Redetecting device " << deviceId <<
" . Result: " << found <<
" after " << count <<
" tries");
194 JLDEBUGG(
"Redetecting device " << deviceId);
198 while (!found && count < 20)
203 JLDEBUGG(
"Attempt " << count <<
". Detected " << portInfoArray.size() <<
" devices.");
205 for (
uint32_t i = 0; i < portInfoArray.size(); i++)
208 if ((skipDeviceIdCheck && !portInfoArray[i].empty()) || portInfoArray[i].deviceId() == deviceId)
210 XsTime::msleep(3000);
211 portInfo = portInfoArray[i];
218 JLDEBUGG(
"Redetecting device " << deviceId <<
" . Result: " << found <<
" after " << count <<
" tries");
230 JLDEBUGG(
"Redetecting device " << deviceId);
236 portList.push_back(portInfo.portName());
239 portLinesOptions.push_back((
int)portInfo.linesOptions());
241 while (!found && count < 20)
247 assert(detectedPorts.size() <= 1);
249 JLDEBUGG(
"Attempt " << count <<
".");
251 if (!detectedPorts.empty())
253 const XsPortInfo portInfoDetected = detectedPorts[0];
257 if ((skipDeviceIdCheck && !portInfoDetected.empty()) || portInfoDetected.deviceId() == deviceId)
260 portInfo.getVidPid(vid, pid);
261 portInfo = portInfoDetected;
262 portInfo.setVidPid(vid, pid);
270 JLDEBUGG(
"Redetecting device " << deviceId <<
" . Result: " << found <<
" after " << count <<
" tries");
285 (void)skipDeviceIdCheck;
virtual bool redetectScanPorts(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck)
Scan for devices until the requested device is found.
#define XS_DID_TYPEH_MT_X00
A list of XsString values.
std::map< XsDeviceId, FunctionPointer > m_detectFunctions
A map filled with detect functions.
DeviceRedetector(const XsPortInfo &portInfo)
Construct an Device Redetector object.
bool redetect(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck=false)
Base redetect function which calls the appropriate redetect based on deviceId.
Contains a descriptor for opening a communication port to an Xsens device.
struct XsDeviceId XsDeviceId
bool(DeviceRedetector::* FunctionPointer)(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck)
A typedef for a function pointer.
A list of XsPortInfo values.
#define XS_DID_TYPEH_MT_X0
virtual bool redetectEnumerateSerialPorts(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck)
Redectets and enumerates the serial ports for a given device.
Contains an Xsens device ID and provides operations for determining the type of device.
virtual bool redetectOneComPort(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck)
Redectes a device on one com port.
virtual bool redetectNoScan(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck)
virtual bool redetectEnumerateNetworkDevices(const XsDeviceId &deviceId, XsPortInfo &portInfo, bool skipDeviceIdCheck)
#define XS_DID_TYPEH_MT_3X0
#define XS_DID_TYPEH_MT_X_MPU
XBR_Invalid
Not a valid baud rate.