*bump* Thanks to geekboy's nagging and BrandonW's and Jonimus's prodding during HCWP, I was able to make great strides with both the client and the on-calculator USB code. The only problem that appears to be remaining happens when I unplug and replug the cable in the middle of a program. My debug pixels show that the code is correctly detecting the cable's absence and later presence, but the OS code doesn't seem to bother re-initializing things. On BrandonW's suggestion, I tried variations on _KillUSBDevice, _RecycleUSB, and _InitUSB, with varying success. In one particularly "amusing" case, I got it to work exactly every even hotplug attempt (0th, 2nd, 4th, ...).
Edit: Note to self: Not only does letting the OS interrupt run on every Cn2.2 interrupt cycle not help, you also get random RAM clears. And the client still can't reconnect all the time. So something else is getting messed up. What the heck state do I need to fix?
Quote:
[04:26] <+KermM> My results vary from sporadic reconnection to RAM clears.
[04:26] <@saxjax> (C) [AHelper] eww
[04:26] <+KermM> it seems _KillUSBDevice and _InitUSBDevice in particular are only for host mode
[04:26] <@saxjax> (C) [AHelper] something bad must be going on
[04:26] <+KermM> I can't figure out a port or bcall that just says "screw it, forget everything about the USB state"
[04:27] <+KermM> "Start over from scratch, Mr. USB IP"