Android ccid development Note 1, androidccid
CCID: CCID (USB Chip/Smart Card Interface Devices-USB Chip Smart Card Interface Device) is a standard jointly developed by several international IT enterprises, it provides a smart card read/write device that can communicate with a host or other embedded hosts.
I have encountered several methods in development and I don't know what it means. After reading the api, I understand it.
Intf. getInterfaceClass ();
Intf. getInterfaceSubclass ();
Intf. getInterfaceProtocol ();
The return values of the preceding three methods are of the int type.
GetInterfaceClass (); indicates the device id of the smart card. For details, see the UsbConstants class.
GetInterfaceSubclass (); indicates to obtain the subclass code.
GetInterfaceProtocol (); The Protocol code for obtaining the CCID is 00 h.
The code snippet is as follows:
1/** 2 * find the device interface 3 */4 private void findInterface () {5 if (myUsbDevice! = Null) {6 Log. d (TAG, "interfaceCounts:" + myUsbDevice. getInterfaceCount (); 7 for (int I = 0; I <myUsbDevice. getInterfaceCount (); I ++) {8 USB interface intf = myusb device. getInterface (I); 9 Log. d (TAG, 10 "intf. getInterfaceClass () = "11 + intf. getInterfaceClass (); 12 Log. d (TAG, 13 "intf. getInterfaceSubclass () = "14 + intf. getInterfaceSubclass (); 15 Log. d (TAG, 16 "intf. getInterfaceProtocol () = "17 + intf. getInterfaceProtocol (); 18 if (intf. getInterfaceClass () == 319 & intf. getInterfaceSubclass () = 020 & intf. getInterfaceProtocol () = 0) {21 myInterface = intf; 22 Log. d (TAG, "find my device interface"); 23} 24 break; 25} 26} 27}