I am working on android USB ACCESSORY functionality. Here, host is Ubuntu machine, and device is android device.
Test cases:
1. By running application
2. By loading kernel module in the host(Ubuntu).
Actual scenario: After sending the accessory_start request to device, it has to reset and re-enumerate in the accessory mode.
1. Running libusb implemented application after connecting android device(Google Nexus Phone)
[ 3723.900026] usb 1-4: new high speed USB device using ehci_hcd and address 7 <- Enumerated usb as ADB+MTP composite device
[ 3760.975180] usb 1-4: USB disconnect, address 7 <- After sending the start accessory request to android device, usb disconnects
[ 3761.330022] usb 1-4: new high speed USB device using ehci_hcd and address 8 <- Enumerated usb as ADB+ACCESSORY composite device
2. When USB host module is loaded(Device is Google Nexus Phone)
[ 4042.700025] usb 1-4: new high speed USB device using ehci_hcd and address 13
[ 4051.952959] module is loaded
[ 4051.952987] aoa_probe <- Enumerated usb as ADB+MTP composite device
[ 4051.957476] Switch to AOA Mode
[ 4051.957601] ret = 0
[ 4051.957611] aoa_probe <- Again enumerated usb as ADB+MTP composite device, supposed to enumerate as ADB+ACCESSORY and USB disconnect is missing?
[ 4051.958476] Switch to AOA Mode
[ 4051.958600] ret = 0
[ 4051.958621] usbcore: registered new interface driver usb_aoa
3. When USB host module is loaded(Device is Samsung Galaxy Phone)
[ 2508.292434] module is loaded
[ 2508.292467] usbcore: registered new interface driver usb_aoa
[ 2522.350026] usb 2-2: new high speed USB device using ehci_hcd and address 10
[ 2522.502141] aoa_probe <- Enumerated usb as ADB+MTP composite device
[ 2522.502956] Switch to AOA Mode
[ 2523.403087] ret = 0
[ 2523.403208] usb 2-2: USB disconnect, address 10
[ 2523.403254] aoa disconnect <- driver disconnect is called
[ 2523.680030] usb 2-2: new high speed USB device using ehci_hcd and address 11
[ 2523.832492] aoa_probe <- Enumerated usb as ADB+ACCESSORY composite device
Query:
1. In the second case, why the driver disconnect function is not called after sending accessory request to device?
2. Is there any function is there to reset the device and re-enumerate again?
Please help me to resolve this issue.