Only consider the port to be open if a serial number can be read within 500 milliseconds.
This commit is contained in:
parent
e316c71a83
commit
97ae66e231
@ -86,8 +86,11 @@ void Widget::halt()
|
|||||||
*/
|
*/
|
||||||
void Widget::open()
|
void Widget::open()
|
||||||
{
|
{
|
||||||
|
if (getSerialNumber(500)) // check for valid call/response from device
|
||||||
|
{
|
||||||
std::scoped_lock lock(mtx_metadata_);
|
std::scoped_lock lock(mtx_metadata_);
|
||||||
usb_mode_ = USBhost;
|
usb_mode_ = USBhost; // note connected state
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user