Android Question USB Device disconnect detection

walterf25

Expert
Licensed User
Longtime User
Hello all, i was wondering if anyone who has experience with the USB library can help me with something.

I'm writing an app for a medical device, the device is a Pulse Rate Meter and it also measures Oxygen levels. It has a usb port which streams that information out, so far i have everything working fine, i can read the values just fine.
My question is the following:
Is there a way to detect when the usb cable has been disconnected from the medical device, I know i can detect when the usb cable has been disconnected from the android device using the Broadcast Receiver library, but is there a way to detect when the usb cable has been disconnected or re-connected to the medical device?

Please share your thoughts any help will be greatly appreciated.

Thanks,
Walter
 

saunwin

Active Member
Licensed User
Longtime User
I use felusbserial and the following line to determine disconnection

B4X:
If manager.GetDevices.Length = 0 Then
        Log("No connected usb devices.")
End If
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…