USB를 통해 통신해야하는 장치가 있습니다.Usb4java 대체 설정
활성 구성이 1 개이며 인터페이스가 1 개입니다.
더 많은 대체 설정 (IDLE, PROF1, PROF2)이 인터페이스에 있습니다. 기본적으로 IDLE은 활성화되어 있습니다.
제 질문은, 어떻게 PROF2 설정을 활성화시킬 수 있습니까?
bNumConfigurations: 0x01
bNumInterfaces: 0x01
[IDLE]
bInterfaceNumber: 0x00
bAlternateSetting: 0x00
[PROF1]
bInterfaceNumber: 0x00
bAlternateSetting: 0x01
[PROF2]
bInterfaceNumber: 0x00
bAlternateSetting: 0x02
코드 ...
UsbConfiguration config = (UsbConfiguration) device.getActiveUsbConfiguration();
UsbInterface iface = config.getUsbInterface((byte)0x00);
UsbInterface alt = iface.getSetting((byte)0x02); // <= Setting is not active.
UsbEndpoint endpoint = alt.getUsbEndpoint((byte)0x83);
UsbPipe pipe = endpoint.getUsbPipe();
pipe.open(); // <= Pipe is not active.
사용중인 라이브러리를 알려 주시면 쉽게 알 수 있습니다. – Andy
http://usb4java.org/ – robert