Hello All, i'm in need of you guys helping me brainstorm in order to figure out this issue, I have an app i've made which uses the USB_HOST (HID) library, i'm communicating with a medical device, everything works fine except that while testing, one test requirement is to cycle power on the Android device, while having the usb unit plugged in.
The Android device reboots just fine, and the application gets launched automatically since the usb cable is plugged in and permission has already been granted.
The app also starts just fine and starts communicating with the medical device, the problem is that, it seems as if the operating system launches the app multiple times one after another, therefore confusing the communication between the android device and the medical device.
I also noticed that one of the timers is being fired up even before enabling it, this is not the first time i've noticed this behaviors with timers which is why i try to avoid them, but in this case i need to have a timer, in case there's a checksum error, i need to re-start the handshaking with the device from the beginning so i have a timer to wait for 5 seconds before re-starting communication again.
My Main problem right now is that the app re-starts multiple instances after the android device has been rebooted, I'm not sure why this is, but if anyone has any idea or has came up this same issue, i will really appreciate your help or thoughts on this. I've tried three different devices so far, and i get the same behavior. If I restart the android device without having medical device plugged in, and wait for the device to fully boot up, and then if i plug the usb device in, everything works just fine the way is supposed to, i'm not sure what the problem could be, maybe an operating system issue? I don't know, hopefully someone here has an answer.
Thanks all
Walter