When the USB peripheral device is self-powered, it directs power to itself and sends the power to the tablet as well. The tablet is charging while hosting the peripheral device. The USB connection is still intact.
When the power is pulled, the USB peripheral device shuts off completely. What should happen is when the power is pulled, the tablet should detect this and start supplying power to the USB peripheral. This doesn't happen for some reason, until the tablet is rebooted. When the tablet reboots, it detects that there is a USB device plugged in, and starts supplying power.
When the USB peripheral is bus-powered, (meaning the tablet is currently supplying power to peripheral device and is currently hosting it), plugging in the power to the peripheral SHOULD start charging the tablet. This doesn't happen. Instead, the tablet continues to discharge.
So basically, I would like the tablet to supply power to the USB device when it detects that the power is gone. Alternatively, when the tablet detects power coming into its port, it should start charging.
Because I custom made the USB peripheral device, I am able to manually force the host to re-enumerate the device by pulling down the 1.5K pullup (hopefully you know which one I am talking about). Do you think this will work? In my application, I wouldn't have access to the OTG adapter and therefore I wouldn't be able to pull it out from the tablet. [That's what he said...]
How would I come to realize in my app that the power is lost and I need to re-initialize a new handle for the USB stream? Suppose I am able to do this, re-initializing the USB port will enable the tablet to start charging again?