Android ccid development Note 1, androidccid

Source: Internet
Author: User

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}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.