Connecting to USB Serial Device
Posted: Tue Feb 20, 2024 9:44 am
I'm porting an existing tool to the switch and the last piece of the puzzle is communicating with a device attached to the USB port. The existing implementation supports either libserial or libusb, both of which seem to be incompatible with the switch.
I think I should be able to rewrite the communication lib using usbhs, but I can't even get the switch to discover the device at all.
My current minimal code looks like this:
When running this on hardware, no device is detected. I've tried multiple devices with no difference in outcome
Am I approaching this the right way, or is there a better way to talk to USB devices?
I think I should be able to rewrite the communication lib using usbhs, but I can't even get the switch to discover the device at all.
My current minimal code looks like this:
Code: Select all
memset(interfaces, 0, sizeof(interfaces));
memset(&filter, 0, sizeof(filter));
filter.Flags = 0
rc = usbHsQueryAllInterfaces(&filter,interfaces,sizeof(interfaces),&total_entries);
if (R_FAILED(rc)) printf("querying interfaces: 0x%x\n", rc);
if (R_SUCCEEDED(rc)) printf("queried interfaces. Found %d\n",total_entries);
Am I approaching this the right way, or is there a better way to talk to USB devices?