Reputation: 690
I am trying to learn about Android open accessory, because I am a newbie to ARM programming. So I want to put everything up from bottom, use free open source tools and code.
The reference example NXP hostlite is small and clear. But I can not set accessory correctly in my devised code.
Description:
According to AOA protocol, after setting accessory mode, the device would re-enumerate itself.
So my question is: What should I do for re-enumeration?
Upvotes: 0
Views: 758
Reputation: 690
I found: during reenumeration, a port reset is absolutely needed. Otherwise, it won't work! There is no formal document to mention it. And a friend of mine who is familiar with USB told me a reset will bring the device to the same initial condition. But it's not in this application context. Now I can set to Android Accessory Mode successfully and connect with the NXP AOADemo apk.
Yeah! Next I will change the program on both device and host side. What I need is a little demo.
device descriptor before accessory mode:
00:12
01:01
02:00
03:02
04:00
05:00
06:00
07:40
08:D1
09:18
0A:E1
0B:4E
0C:28
0D:02
0E:01
0F:02
10:03
11:01
device descriptor after enter accessory mode:
00:12
01:01
02:00
03:02
04:00
05:00
06:00
07:40
08:D1
09:18
0A:00
0B:2D
0C:28
0D:02
0E:01
0F:02
10:03
11:01
VID 18D1, PID 2D00. I didn't turn on debug mode, so PID is 2D00, no problem. Not as what they said in another post.
======================================
Configuration descriptor:
-------Parse------------
09
02, configuration descriptor
20
00
01, 1 interface
01, 1 configuration
00
80
FA, Maximum current supply needed 500mA
09
04, interface descriptor
00
00
02, 2 endpoints
FF
FF
00
05
07
05, endpoint descriptor
81 in 1
02, bulk
40, maximum size 64 bytes
00
00
07
05, endpoint descriptor
02 out 2
02, bulk
40, maximum size 64 bytes
00
00
-------end of parse ------
Upvotes: 0