Delphi Android USB声明文件

自己转的比较全面的USB声明文件:

unit Androidapi.JNI.USB;

interface

uses
  AndroidAPI.JNIBridge,
  Androidapi.JNI.JavaTypes,
  Androidapi.JNI.os,
  androidapi.JNI.App;

type

  JUsbInterface = interface;
  JUsbEndPoint = interface;
  JUsbManager = interface;
  JUsbRequest = interface;

  JUsbInterfaceClass = interface(JObjectClass)
    [‘{C8CD6F55-CD21-417D-8234-C715E861D81F}‘]
    function _GetCREATOR : JParcelable_Creator; cdecl;                          //  A: $19
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function getEndpoint(&index : Integer) : JUsbEndpoint; cdecl;               // (I)Landroid/hardware/usb/UsbEndpoint; A: $1
    function getEndpointCount : Integer; cdecl;                                 // ()I A: $1
    function getId : Integer; cdecl;                                            // ()I A: $1
    function getInterfaceClass : Integer; cdecl;                                // ()I A: $1
    function getInterfaceProtocol : Integer; cdecl;                             // ()I A: $1
    function getInterfaceSubclass : Integer; cdecl;                             // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
    property CREATOR : JParcelable_Creator read _GetCREATOR;                    // Landroid/os/Parcelable$Creator; A: $19
  end;

  [JavaSignature(‘android/hardware/usb/UsbInterface‘)]
  JUsbInterface = interface(JObject)
    [‘{BD59133B-06ED-424A-9C3E-A3F7020DB784}‘]
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function getEndpoint(&index : Integer) : JUsbEndpoint; cdecl;               // (I)Landroid/hardware/usb/UsbEndpoint; A: $1
    function getEndpointCount : Integer; cdecl;                                 // ()I A: $1
    function getId : Integer; cdecl;                                            // ()I A: $1
    function getInterfaceClass : Integer; cdecl;                                // ()I A: $1
    function getInterfaceProtocol : Integer; cdecl;                             // ()I A: $1
    function getInterfaceSubclass : Integer; cdecl;                             // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
  end;

  TJUsbInterface = class(TJavaGenericImport<JUsbInterfaceClass, JUsbInterface>)
  end;

  JUsbAccessory = interface;

  JUsbAccessoryClass = interface(JObjectClass)
    [‘{98C18E63-827C-44F3-9CF6-9C82D7F1BBFE}‘]
    function _GetCREATOR : JParcelable_Creator; cdecl;                          //  A: $19
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function equals(obj : JObject) : boolean; cdecl;                            // (Ljava/lang/Object;)Z A: $1
    function getDescription : JString; cdecl;                                   // ()Ljava/lang/String; A: $1
    function getManufacturer : JString; cdecl;                                  // ()Ljava/lang/String; A: $1
    function getModel : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    function getSerial : JString; cdecl;                                        // ()Ljava/lang/String; A: $1
    function getUri : JString; cdecl;                                           // ()Ljava/lang/String; A: $1
    function getVersion : JString; cdecl;                                       // ()Ljava/lang/String; A: $1
    function hashCode : Integer; cdecl;                                         // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
    property CREATOR : JParcelable_Creator read _GetCREATOR;                    // Landroid/os/Parcelable$Creator; A: $19
  end;

  [JavaSignature(‘android/hardware/usb/UsbAccessory‘)]
  JUsbAccessory = interface(JObject)
    [‘{CA84BEB5-FADB-42DD-9120-4FCEA58EB211}‘]
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function equals(obj : JObject) : boolean; cdecl;                            // (Ljava/lang/Object;)Z A: $1
    function getDescription : JString; cdecl;                                   // ()Ljava/lang/String; A: $1
    function getManufacturer : JString; cdecl;                                  // ()Ljava/lang/String; A: $1
    function getModel : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    function getSerial : JString; cdecl;                                        // ()Ljava/lang/String; A: $1
    function getUri : JString; cdecl;                                           // ()Ljava/lang/String; A: $1
    function getVersion : JString; cdecl;                                       // ()Ljava/lang/String; A: $1
    function hashCode : Integer; cdecl;                                         // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
  end;

  TJUsbAccessory = class(TJavaGenericImport<JUsbAccessoryClass, JUsbAccessory>)
  end;
  JUsbDevice = interface;

  JUsbDeviceClass = interface(JObjectClass)
    [‘{322E87AC-CF09-4502-8FB0-CC1ADC520615}‘]
    function _GetCREATOR : JParcelable_Creator; cdecl;                          //  A: $19
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function equals(o : JObject) : boolean; cdecl;                              // (Ljava/lang/Object;)Z A: $1
    function getDeviceClass : Integer; cdecl;                                   // ()I A: $1
    function getDeviceId : Integer; cdecl; overload;                            // ()I A: $1
    function getDeviceId(&name : JString) : Integer; cdecl; overload;           // (Ljava/lang/String;)I A: $9
    function getDeviceName : JString; cdecl; overload;                          // ()Ljava/lang/String; A: $1
    function getDeviceName(id : Integer) : JString; cdecl; overload;            // (I)Ljava/lang/String; A: $9
    function getDeviceProtocol : Integer; cdecl;                                // ()I A: $1
    function getDeviceSubclass : Integer; cdecl;                                // ()I A: $1
    function getInterface(&index : Integer) : JUsbInterface; cdecl;             // (I)Landroid/hardware/usb/UsbInterface; A: $1
    function getInterfaceCount : Integer; cdecl;                                // ()I A: $1
    function getProductId : Integer; cdecl;                                     // ()I A: $1
    function getVendorId : Integer; cdecl;                                      // ()I A: $1
    function hashCode : Integer; cdecl;                                         // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
    property CREATOR : JParcelable_Creator read _GetCREATOR;                    // Landroid/os/Parcelable$Creator; A: $19
  end;

  [JavaSignature(‘android/hardware/usb/UsbDevice‘)]
  JUsbDevice = interface(JObject)
    [‘{894CF2BF-306D-49BA-9776-D89F60E90353}‘]
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function equals(o : JObject) : boolean; cdecl;                              // (Ljava/lang/Object;)Z A: $1
    function getDeviceClass : Integer; cdecl;                                   // ()I A: $1
    function getDeviceId : Integer; cdecl; overload;                            // ()I A: $1
    function getDeviceName : JString; cdecl; overload;                          // ()Ljava/lang/String; A: $1
    function getDeviceProtocol : Integer; cdecl;                                // ()I A: $1
    function getDeviceSubclass : Integer; cdecl;                                // ()I A: $1
    function getInterface(&index : Integer) : JUsbInterface; cdecl;             // (I)Landroid/hardware/usb/UsbInterface; A: $1
    function getInterfaceCount : Integer; cdecl;                                // ()I A: $1
    function getProductId : Integer; cdecl;                                     // ()I A: $1
    function getVendorId : Integer; cdecl;                                      // ()I A: $1
    function hashCode : Integer; cdecl;                                         // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
  end;

  TJUsbDevice = class(TJavaGenericImport<JUsbDeviceClass, JUsbDevice>)
  end;

  JUsbDeviceConnection = interface;

  JUsbDeviceConnectionClass = interface(JObjectClass)
    [‘{87714045-C806-4665-8115-A3E814566A46}‘]
    function bulkTransfer(endpoint : JUsbEndpoint; buffer : TJavaArray<Byte>; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (Landroid/hardware/usb/UsbEndpoint;[BII)I A: $1
    function bulkTransfer(endpoint : JUsbEndpoint; buffer : TJavaArray<Byte>; offset : Integer; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (Landroid/hardware/usb/UsbEndpoint;[BIII)I A: $1
    function claimInterface(intf : JUsbInterface; force : boolean) : boolean; cdecl;// (Landroid/hardware/usb/UsbInterface;Z)Z A: $1
    function controlTransfer(requestType : Integer; request : Integer; value : Integer; &index : Integer; buffer : TJavaArray<Byte>; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (IIII[BII)I A: $1
    function controlTransfer(requestType : Integer; request : Integer; value : Integer; &index : Integer; buffer : TJavaArray<Byte>; offset : Integer; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (IIII[BIII)I A: $1
    function getFileDescriptor : Integer; cdecl;                                // ()I A: $1
    function getRawDescriptors : TJavaArray<Byte>; cdecl;                       // ()[B A: $1
    function getSerial : JString; cdecl;                                        // ()Ljava/lang/String; A: $1
    function releaseInterface(intf : JUsbInterface) : boolean; cdecl;           // (Landroid/hardware/usb/UsbInterface;)Z A: $1
    function requestWait : JUsbRequest; cdecl;                                  // ()Landroid/hardware/usb/UsbRequest; A: $1
    procedure close ; cdecl;                                                    // ()V A: $1
  end;

  [JavaSignature(‘android/hardware/usb/UsbDeviceConnection‘)]
  JUsbDeviceConnection = interface(JObject)
    [‘{0946E9B4-626D-46F3-BE00-5C9B9EE7D545}‘]
    function bulkTransfer(endpoint : JUsbEndpoint; buffer : TJavaArray<Byte>; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (Landroid/hardware/usb/UsbEndpoint;[BII)I A: $1
    function bulkTransfer(endpoint : JUsbEndpoint; buffer : TJavaArray<Byte>; offset : Integer; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (Landroid/hardware/usb/UsbEndpoint;[BIII)I A: $1
    function claimInterface(intf : JUsbInterface; force : boolean) : boolean; cdecl;// (Landroid/hardware/usb/UsbInterface;Z)Z A: $1
    function controlTransfer(requestType : Integer; request : Integer; value : Integer; &index : Integer; buffer : TJavaArray<Byte>; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (IIII[BII)I A: $1
    function controlTransfer(requestType : Integer; request : Integer; value : Integer; &index : Integer; buffer : TJavaArray<Byte>; offset : Integer; length : Integer; timeout : Integer) : Integer; cdecl; overload;// (IIII[BIII)I A: $1
    function getFileDescriptor : Integer; cdecl;                                // ()I A: $1
    function getRawDescriptors : TJavaArray<Byte>; cdecl;                       // ()[B A: $1
    function getSerial : JString; cdecl;                                        // ()Ljava/lang/String; A: $1
    function releaseInterface(intf : JUsbInterface) : boolean; cdecl;           // (Landroid/hardware/usb/UsbInterface;)Z A: $1
    function requestWait : JUsbRequest; cdecl;                                  // ()Landroid/hardware/usb/UsbRequest; A: $1
    procedure close ; cdecl;                                                    // ()V A: $1
  end;

  TJUsbDeviceConnection = class(TJavaGenericImport<JUsbDeviceConnectionClass, JUsbDeviceConnection>)
  end;

  JUsbEndpointClass = interface(JObjectClass)
    [‘{42D2502A-B42F-4A3D-A8F5-719DD014F925}‘]
    function _GetCREATOR : JParcelable_Creator; cdecl;                          //  A: $19
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function getAddress : Integer; cdecl;                                       // ()I A: $1
    function getAttributes : Integer; cdecl;                                    // ()I A: $1
    function getDirection : Integer; cdecl;                                     // ()I A: $1
    function getEndpointNumber : Integer; cdecl;                                // ()I A: $1
    function getInterval : Integer; cdecl;                                      // ()I A: $1
    function getMaxPacketSize : Integer; cdecl;                                 // ()I A: $1
    function getType : Integer; cdecl;                                          // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
    property CREATOR : JParcelable_Creator read _GetCREATOR;                    // Landroid/os/Parcelable$Creator; A: $19
  end;

  [JavaSignature(‘android/hardware/usb/UsbEndpoint‘)]
  JUsbEndpoint = interface(JObject)
    [‘{3DA76151-8683-40C5-9D74-EC46C3EE6BE9}‘]
    function describeContents : Integer; cdecl;                                 // ()I A: $1
    function getAddress : Integer; cdecl;                                       // ()I A: $1
    function getAttributes : Integer; cdecl;                                    // ()I A: $1
    function getDirection : Integer; cdecl;                                     // ()I A: $1
    function getEndpointNumber : Integer; cdecl;                                // ()I A: $1
    function getInterval : Integer; cdecl;                                      // ()I A: $1
    function getMaxPacketSize : Integer; cdecl;                                 // ()I A: $1
    function getType : Integer; cdecl;                                          // ()I A: $1
    function toString : JString; cdecl;                                         // ()Ljava/lang/String; A: $1
    procedure writeToParcel(parcel : JParcel; flags : Integer) ; cdecl;         // (Landroid/os/Parcel;I)V A: $1
  end;

  TJUsbEndpoint = class(TJavaGenericImport<JUsbEndpointClass, JUsbEndpoint>)
  end;

  JUsbManagerClass = interface(JObjectClass)
    [‘{00663E01-CEEF-47D5-BF37-513629999939}‘]
    function _GetACTION_USB_ACCESSORY_ATTACHED : JString; cdecl;                //  A: $19
    function _GetACTION_USB_ACCESSORY_DETACHED : JString; cdecl;                //  A: $19
    function _GetACTION_USB_DEVICE_ATTACHED : JString; cdecl;                   //  A: $19
    function _GetACTION_USB_DEVICE_DETACHED : JString; cdecl;                   //  A: $19
    function _GetEXTRA_ACCESSORY : JString; cdecl;                              //  A: $19
    function _GetEXTRA_DEVICE : JString; cdecl;                                 //  A: $19
    function _GetEXTRA_PERMISSION_GRANTED : JString; cdecl;                     //  A: $19
    function getAccessoryList : TJavaArray<JUsbAccessory>; cdecl;               // ()[Landroid/hardware/usb/UsbAccessory; A: $1
    function getDeviceList : JHashMap; cdecl;                                   // ()Ljava/util/HashMap; A: $1
    function hasPermission(accessory : JUsbAccessory) : boolean; cdecl; overload;// (Landroid/hardware/usb/UsbAccessory;)Z A: $1
    function hasPermission(device : JUsbDevice) : boolean; cdecl; overload;     // (Landroid/hardware/usb/UsbDevice;)Z A: $1
    function openAccessory(accessory : JUsbAccessory) : JParcelFileDescriptor; cdecl;// (Landroid/hardware/usb/UsbAccessory;)Landroid/os/ParcelFileDescriptor; A: $1
    function openDevice(device : JUsbDevice) : JUsbDeviceConnection; cdecl;     // (Landroid/hardware/usb/UsbDevice;)Landroid/hardware/usb/UsbDeviceConnection; A: $1
    procedure requestPermission(accessory : JUsbAccessory; pi : JPendingIntent) ; cdecl; overload;// (Landroid/hardware/usb/UsbAccessory;Landroid/app/PendingIntent;)V A: $1
    procedure requestPermission(device : JUsbDevice; pi : JPendingIntent) ; cdecl; overload;// (Landroid/hardware/usb/UsbDevice;Landroid/app/PendingIntent;)V A: $1
    property ACTION_USB_ACCESSORY_ATTACHED : JString read _GetACTION_USB_ACCESSORY_ATTACHED;// Ljava/lang/String; A: $19
    property ACTION_USB_ACCESSORY_DETACHED : JString read _GetACTION_USB_ACCESSORY_DETACHED;// Ljava/lang/String; A: $19
    property ACTION_USB_DEVICE_ATTACHED : JString read _GetACTION_USB_DEVICE_ATTACHED;// Ljava/lang/String; A: $19
    property ACTION_USB_DEVICE_DETACHED : JString read _GetACTION_USB_DEVICE_DETACHED;// Ljava/lang/String; A: $19
    property EXTRA_ACCESSORY : JString read _GetEXTRA_ACCESSORY;                // Ljava/lang/String; A: $19
    property EXTRA_DEVICE : JString read _GetEXTRA_DEVICE;                      // Ljava/lang/String; A: $19
    property EXTRA_PERMISSION_GRANTED : JString read _GetEXTRA_PERMISSION_GRANTED;// Ljava/lang/String; A: $19
  end;

  [JavaSignature(‘android/hardware/usb/UsbManager‘)]
  JUsbManager = interface(JObject)
    [‘{B49F7F12-1E88-442D-88D6-E67E24A0A3FF}‘]
    function getAccessoryList : TJavaArray<JUsbAccessory>; cdecl;               // ()[Landroid/hardware/usb/UsbAccessory; A: $1
    function getDeviceList : JHashMap; cdecl;                                   // ()Ljava/util/HashMap; A: $1
    function hasPermission(accessory : JUsbAccessory) : boolean; cdecl; overload;// (Landroid/hardware/usb/UsbAccessory;)Z A: $1
    function hasPermission(device : JUsbDevice) : boolean; cdecl; overload;     // (Landroid/hardware/usb/UsbDevice;)Z A: $1
    function openAccessory(accessory : JUsbAccessory) : JParcelFileDescriptor; cdecl;// (Landroid/hardware/usb/UsbAccessory;)Landroid/os/ParcelFileDescriptor; A: $1
    function openDevice(device : JUsbDevice) : JUsbDeviceConnection; cdecl;     // (Landroid/hardware/usb/UsbDevice;)Landroid/hardware/usb/UsbDeviceConnection; A: $1
    procedure requestPermission(accessory : JUsbAccessory; pi : JPendingIntent) ; cdecl; overload;// (Landroid/hardware/usb/UsbAccessory;Landroid/app/PendingIntent;)V A: $1
    procedure requestPermission(device : JUsbDevice; pi : JPendingIntent) ; cdecl; overload;// (Landroid/hardware/usb/UsbDevice;Landroid/app/PendingIntent;)V A: $1
  end;

  TJUsbManager = class(TJavaGenericImport<JUsbManagerClass, JUsbManager>)
  end;

  JUsbRequestClass = interface(JObjectClass)
    [‘{DDD3609C-991D-44C3-A262-6EC3AE6CA978}‘]
    function cancel : boolean; cdecl;                                           // ()Z A: $1
    function getClientData : JObject; cdecl;                                    // ()Ljava/lang/Object; A: $1
    function getEndpoint : JUsbEndpoint; cdecl;                                 // ()Landroid/hardware/usb/UsbEndpoint; A: $1
    function init : JUsbRequest; cdecl;                                         // ()V A: $1
    function initialize(connection : JUsbDeviceConnection; endpoint : JUsbEndpoint) : boolean; cdecl;// (Landroid/hardware/usb/UsbDeviceConnection;Landroid/hardware/usb/UsbEndpoint;)Z A: $1
    function queue(buffer : JByteBuffer; length : Integer) : boolean; cdecl;    // (Ljava/nio/ByteBuffer;I)Z A: $1
    procedure close ; cdecl;                                                    // ()V A: $1
    procedure setClientData(data : JObject) ; cdecl;                            // (Ljava/lang/Object;)V A: $1
  end;

  [JavaSignature(‘android/hardware/usb/UsbRequest‘)]
  JUsbRequest = interface(JObject)
    [‘{3D42DD85-7C3D-464A-A717-89F25373F9A9}‘]
    function cancel : boolean; cdecl;                                           // ()Z A: $1
    function getClientData : JObject; cdecl;                                    // ()Ljava/lang/Object; A: $1
    function getEndpoint : JUsbEndpoint; cdecl;                                 // ()Landroid/hardware/usb/UsbEndpoint; A: $1
    function initialize(connection : JUsbDeviceConnection; endpoint : JUsbEndpoint) : boolean; cdecl;// (Landroid/hardware/usb/UsbDeviceConnection;Landroid/hardware/usb/UsbEndpoint;)Z A: $1
    function queue(buffer : JByteBuffer; length : Integer) : boolean; cdecl;    // (Ljava/nio/ByteBuffer;I)Z A: $1
    procedure close ; cdecl;                                                    // ()V A: $1
    procedure setClientData(data : JObject) ; cdecl;                            // (Ljava/lang/Object;)V A: $1
  end;

  TJUsbRequest = class(TJavaGenericImport<JUsbRequestClass, JUsbRequest>)
  end;

  JUsbConstants = interface;

  JUsbConstantsClass = interface(JObjectClass)
    [‘{82AD42D7-224A-4DA7-8AFF-E1208FE2DDD2}‘]
    function _GetUSB_CLASS_APP_SPEC : Integer; cdecl;                           //  A: $19
    function _GetUSB_CLASS_AUDIO : Integer; cdecl;                              //  A: $19
    function _GetUSB_CLASS_CDC_DATA : Integer; cdecl;                           //  A: $19
    function _GetUSB_CLASS_COMM : Integer; cdecl;                               //  A: $19
    function _GetUSB_CLASS_CONTENT_SEC : Integer; cdecl;                        //  A: $19
    function _GetUSB_CLASS_CSCID : Integer; cdecl;                              //  A: $19
    function _GetUSB_CLASS_HID : Integer; cdecl;                                //  A: $19
    function _GetUSB_CLASS_HUB : Integer; cdecl;                                //  A: $19
    function _GetUSB_CLASS_MASS_STORAGE : Integer; cdecl;                       //  A: $19
    function _GetUSB_CLASS_MISC : Integer; cdecl;                               //  A: $19
    function _GetUSB_CLASS_PER_INTERFACE : Integer; cdecl;                      //  A: $19
    function _GetUSB_CLASS_PHYSICA : Integer; cdecl;                            //  A: $19
    function _GetUSB_CLASS_PRINTER : Integer; cdecl;                            //  A: $19
    function _GetUSB_CLASS_STILL_IMAGE : Integer; cdecl;                        //  A: $19
    function _GetUSB_CLASS_VENDOR_SPEC : Integer; cdecl;                        //  A: $19
    function _GetUSB_CLASS_VIDEO : Integer; cdecl;                              //  A: $19
    function _GetUSB_CLASS_WIRELESS_CONTROLLER : Integer; cdecl;                //  A: $19
    function _GetUSB_DIR_IN : Integer; cdecl;                                   //  A: $19
    function _GetUSB_DIR_OUT : Integer; cdecl;                                  //  A: $19
    function _GetUSB_ENDPOINT_DIR_MASK : Integer; cdecl;                        //  A: $19
    function _GetUSB_ENDPOINT_NUMBER_MASK : Integer; cdecl;                     //  A: $19
    function _GetUSB_ENDPOINT_XFERTYPE_MASK : Integer; cdecl;                   //  A: $19
    function _GetUSB_ENDPOINT_XFER_BULK : Integer; cdecl;                       //  A: $19
    function _GetUSB_ENDPOINT_XFER_CONTROL : Integer; cdecl;                    //  A: $19
    function _GetUSB_ENDPOINT_XFER_INT : Integer; cdecl;                        //  A: $19
    function _GetUSB_ENDPOINT_XFER_ISOC : Integer; cdecl;                       //  A: $19
    function _GetUSB_INTERFACE_SUBCLASS_BOOT : Integer; cdecl;                  //  A: $19
    function _GetUSB_SUBCLASS_VENDOR_SPEC : Integer; cdecl;                     //  A: $19
    function _GetUSB_TYPE_CLASS : Integer; cdecl;                               //  A: $19
    function _GetUSB_TYPE_MASK : Integer; cdecl;                                //  A: $19
    function _GetUSB_TYPE_RESERVED : Integer; cdecl;                            //  A: $19
    function _GetUSB_TYPE_STANDARD : Integer; cdecl;                            //  A: $19
    function _GetUSB_TYPE_VENDOR : Integer; cdecl;                              //  A: $19
    function init : JUsbConstants; cdecl;                                       // ()V A: $1
    property USB_CLASS_APP_SPEC : Integer read _GetUSB_CLASS_APP_SPEC;          // I A: $19
    property USB_CLASS_AUDIO : Integer read _GetUSB_CLASS_AUDIO;                // I A: $19
    property USB_CLASS_CDC_DATA : Integer read _GetUSB_CLASS_CDC_DATA;          // I A: $19
    property USB_CLASS_COMM : Integer read _GetUSB_CLASS_COMM;                  // I A: $19
    property USB_CLASS_CONTENT_SEC : Integer read _GetUSB_CLASS_CONTENT_SEC;    // I A: $19
    property USB_CLASS_CSCID : Integer read _GetUSB_CLASS_CSCID;                // I A: $19
    property USB_CLASS_HID : Integer read _GetUSB_CLASS_HID;                    // I A: $19
    property USB_CLASS_HUB : Integer read _GetUSB_CLASS_HUB;                    // I A: $19
    property USB_CLASS_MASS_STORAGE : Integer read _GetUSB_CLASS_MASS_STORAGE;  // I A: $19
    property USB_CLASS_MISC : Integer read _GetUSB_CLASS_MISC;                  // I A: $19
    property USB_CLASS_PER_INTERFACE : Integer read _GetUSB_CLASS_PER_INTERFACE;// I A: $19
    property USB_CLASS_PHYSICA : Integer read _GetUSB_CLASS_PHYSICA;            // I A: $19
    property USB_CLASS_PRINTER : Integer read _GetUSB_CLASS_PRINTER;            // I A: $19
    property USB_CLASS_STILL_IMAGE : Integer read _GetUSB_CLASS_STILL_IMAGE;    // I A: $19
    property USB_CLASS_VENDOR_SPEC : Integer read _GetUSB_CLASS_VENDOR_SPEC;    // I A: $19
    property USB_CLASS_VIDEO : Integer read _GetUSB_CLASS_VIDEO;                // I A: $19
    property USB_CLASS_WIRELESS_CONTROLLER : Integer read _GetUSB_CLASS_WIRELESS_CONTROLLER;// I A: $19
    property USB_DIR_IN : Integer read _GetUSB_DIR_IN;                          // I A: $19
    property USB_DIR_OUT : Integer read _GetUSB_DIR_OUT;                        // I A: $19
    property USB_ENDPOINT_DIR_MASK : Integer read _GetUSB_ENDPOINT_DIR_MASK;    // I A: $19
    property USB_ENDPOINT_NUMBER_MASK : Integer read _GetUSB_ENDPOINT_NUMBER_MASK;// I A: $19
    property USB_ENDPOINT_XFERTYPE_MASK : Integer read _GetUSB_ENDPOINT_XFERTYPE_MASK;// I A: $19
    property USB_ENDPOINT_XFER_BULK : Integer read _GetUSB_ENDPOINT_XFER_BULK;  // I A: $19
    property USB_ENDPOINT_XFER_CONTROL : Integer read _GetUSB_ENDPOINT_XFER_CONTROL;// I A: $19
    property USB_ENDPOINT_XFER_INT : Integer read _GetUSB_ENDPOINT_XFER_INT;    // I A: $19
    property USB_ENDPOINT_XFER_ISOC : Integer read _GetUSB_ENDPOINT_XFER_ISOC;  // I A: $19
    property USB_INTERFACE_SUBCLASS_BOOT : Integer read _GetUSB_INTERFACE_SUBCLASS_BOOT;// I A: $19
    property USB_SUBCLASS_VENDOR_SPEC : Integer read _GetUSB_SUBCLASS_VENDOR_SPEC;// I A: $19
    property USB_TYPE_CLASS : Integer read _GetUSB_TYPE_CLASS;                  // I A: $19
    property USB_TYPE_MASK : Integer read _GetUSB_TYPE_MASK;                    // I A: $19
    property USB_TYPE_RESERVED : Integer read _GetUSB_TYPE_RESERVED;            // I A: $19
    property USB_TYPE_STANDARD : Integer read _GetUSB_TYPE_STANDARD;            // I A: $19
    property USB_TYPE_VENDOR : Integer read _GetUSB_TYPE_VENDOR;                // I A: $19
  end;

  [JavaSignature(‘android/hardware/usb/UsbConstants‘)]
  JUsbConstants = interface(JObject)
    [‘{0C48B886-B3F1-4161-8312-0E2D239EA601}‘]
  end;

  TJUsbConstants = class(TJavaGenericImport<JUsbConstantsClass, JUsbConstants>)
  end;

const
  TJUsbManagerACTION_USB_DEVICE_ATTACHED = ‘android.hardware.usb.action.USB_DEVICE_ATTACHED‘;
  TJUsbManagerACTION_USB_DEVICE_DETACHED = ‘android.hardware.usb.action.USB_DEVICE_DETACHED‘;
  TJUsbManagerACTION_USB_ACCESSORY_ATTACHED = ‘android.hardware.usb.action.USB_ACCESSORY_ATTACHED‘;
  TJUsbManagerACTION_USB_ACCESSORY_DETACHED = ‘android.hardware.usb.action.USB_ACCESSORY_DETACHED‘;
  TJUsbManagerEXTRA_DEVICE = ‘device‘;
  TJUsbManagerEXTRA_ACCESSORY = ‘accessory‘;
  TJUsbManagerEXTRA_PERMISSION_GRANTED = ‘permission‘;

const
  TJUsbConstantsUSB_ENDPOINT_DIR_MASK = 128;
  TJUsbConstantsUSB_DIR_OUT = 0;
  TJUsbConstantsUSB_DIR_IN = 128;
  TJUsbConstantsUSB_ENDPOINT_NUMBER_MASK = 15;
  TJUsbConstantsUSB_ENDPOINT_XFERTYPE_MASK = 3;
  TJUsbConstantsUSB_ENDPOINT_XFER_CONTROL = 0;
  TJUsbConstantsUSB_ENDPOINT_XFER_ISOC = 1;
  TJUsbConstantsUSB_ENDPOINT_XFER_BULK = 2;
  TJUsbConstantsUSB_ENDPOINT_XFER_INT = 3;
  TJUsbConstantsUSB_TYPE_MASK = 96;
  TJUsbConstantsUSB_TYPE_STANDARD = 0;
  TJUsbConstantsUSB_TYPE_CLASS = 32;
  TJUsbConstantsUSB_TYPE_VENDOR = 64;
  TJUsbConstantsUSB_TYPE_RESERVED = 96;
  TJUsbConstantsUSB_CLASS_PER_INTERFACE = 0;
  TJUsbConstantsUSB_CLASS_AUDIO = 1;
  TJUsbConstantsUSB_CLASS_COMM = 2;
  TJUsbConstantsUSB_CLASS_HID = 3;
  TJUsbConstantsUSB_CLASS_PHYSICA = 5;
  TJUsbConstantsUSB_CLASS_STILL_IMAGE = 6;
  TJUsbConstantsUSB_CLASS_PRINTER = 7;
  TJUsbConstantsUSB_CLASS_MASS_STORAGE = 8;
  TJUsbConstantsUSB_CLASS_HUB = 9;
  TJUsbConstantsUSB_CLASS_CDC_DATA = 10;
  TJUsbConstantsUSB_CLASS_CSCID = 11;
  TJUsbConstantsUSB_CLASS_CONTENT_SEC = 13;
  TJUsbConstantsUSB_CLASS_VIDEO = 14;
  TJUsbConstantsUSB_CLASS_WIRELESS_CONTROLLER = 224;
  TJUsbConstantsUSB_CLASS_MISC = 239;
  TJUsbConstantsUSB_CLASS_APP_SPEC = 254;
  TJUsbConstantsUSB_CLASS_VENDOR_SPEC = 255;
  TJUsbConstantsUSB_INTERFACE_SUBCLASS_BOOT = 1;
  TJUsbConstantsUSB_SUBCLASS_VENDOR_SPEC = 255;

implementation

end.
时间: 2024-10-04 02:47:10

Delphi Android USB声明文件的相关文章

翻译Android USB HOST API

翻译Android USB HOST API 源码地址:http://developer.android.com/guide/topics/connectivity/usb/host.html 译者注:翻译的好不好不是太重要,重点是在翻译的过程中会把每句话都看认真看一遍,或者说是抱着翻译的思想来完成一个读懂的目的. USB Host通信 当你的可供电Android设备处理USB host模式时,它担任着为USB总线供电,枚举连接的USB从设备等等一个主设备应用的工作.Android 3.1及以后

(转载)Android xml资源文件中@、@android:type、@*、?、@+引用写法含义以及区别

原帖地址:http://blog.csdn.net/zfrong/article/details/7332545 Android xml资源文件中@.@android:type.@*.?.@+引用写法含义以及区别 一[email protected]代表引用资源 1.引用自定义资源.格式:@[package:]type/name android:text="@string/hello" 2.引用系统资源.格式:@android:type/name android:textColor=&

Android xml资源文件中@、@android:type、@*、?、@+含义和区别

一[email protected]代表引用资源 1.引用自定义资源.格式:@[package:]type/name android:text="@string/hello" 2.引用系统资源.格式:@android:type/name android:textColor="@android:color/opaque_red" 注意:其实@android:type/name是@[package:]type/name 的一个子类 二[email protected]*

Android USB Host与HID通讯

前端时间捣鼓一个HID的硬件, 需要和android通信, 网上搜索了一圈,收获不小. 比较好的文章是:      Android USB Host与HID通讯 Android Service创建USB HOST通信 其中代码之处有些地方需要注意的, 特此注明一下: /** * USB HOST 连接 HID * @author IVAN * */ public class MainActivity extends Activity { private static final String T

Delphi引用C对象文件

C语言应用非常广泛,并在世界各地拥有大量的代码库.这些代码库与Delphi的可比性较小,因此如果我们无需转换为Delphi代码而可以直接使用这些库的部分代码就完美了.幸运的是,Delphi允许连接到C编译出来的对象文件.但这里有” unsatisfied externals”问题. C is a very widely used language, and this has made the worldwide code library for C huge. The code library

Android开发之深入理解Android Studio构建文件build.gradle配置

摘要: 每周一次,深入学习Android教程,TeachCourse今天带来的一篇关于Android Studio构建文件build.gradle的相关配置,重点学习几个方面的内容:1.applicationId和package属性值的关系,2.怎么配置安全的自定义签名,3.两种构建类型的区别,4.为什么要定制产品的偏好配置?,5.怎么才能加快DEX文件的生成速度,6.为什么要将一个apk拆分成多个?,7.关于引入依赖包你不知道的秘密.通过这篇文章的学习,你会对build.gradle文件有一个

[笨木头Unity3D]杂记003&#183;Unity在Android中读取文件

这周被一个问题给折腾了几个晚上,那就是在Android中读取文件,这本是一件很简单的事情,可想象总是美好的. 笨木头花心贡献,啥?花心?不,是用心. 转载请注明,原文地址:http://www.benmutou.com/archives/2094 文章来源:笨木头与游戏开发 1.在电脑上读取文件 首先要解决的当然是在电脑上读取文件了,这个并不难,网上一堆资料. 比如: public static string LoadFile(string filePath) { string url = Ap

Android AndroidManifest 清单文件以及权限详解

每个Android应用都需要一个名为AndroidManifest.xml的程序清单文件,这个清单文件名是固定的并且放在每个Android应用的根目录下.它定义了该应用对于Android系统来说一些非常重要的信息.Android系统需要这些信息才能正常运行该应用.Android程序清单文件主要具有下面作用: ·        它给应用程序Java包命名,这个包名作为应用程序唯一标识符. ·        它描述了应用程序中的每个程序组件-Activity,Service,Broadcast Re

Android init.rc文件浅析

本文主要来自$ANDROID_SOURCE/system/init/readme.txt的翻译. 1 简述 Android init.rc文件由系统第一个启动的init程序解析.此文件由语句组成,主要包括了四种类型的语句:Action,Commands,Services,Options.在init.rc文件里一条语句一般是占领一行.单词之间是通过空格符来相隔的.假设须要在单词内使用空格,那么得使用转义字符"\",假设在一行的末尾有一个反斜杠,那么是换行折叠符号,应该和下一行合并成一起来