Home | History | Annotate | Download | only in cts-usb-accessory

Lines Matching full:device

70 static void send_string(struct usb_device *device, int index, const char* string) {
71 int ret = usb_device_control_transfer(device, USB_DIR_OUT | USB_TYPE_VENDOR,
85 struct usb_device *device = usb_device_open(devname);
86 if (!device) {
91 vendorId = usb_device_get_vendor_id(device);
92 productId = usb_device_get_product_id(device);
101 printf("Found Android device in accessory mode (%x:%x)...\n",
103 sDevice = device;
105 usb_descriptor_iter_init(device, &iter);
126 if (usb_device_claim_interface(device, intf->bInterfaceNumber)) {
141 printf("Found possible Android device (%x:%x) "
145 ret = usb_device_control_transfer(device, USB_DIR_IN | USB_TYPE_VENDOR,
148 printf("Device supports protocol version %d\n", protocol);
152 send_string(device, ACCESSORY_STRING_MANUFACTURER, "Android CTS");
153 send_string(device, ACCESSORY_STRING_MODEL, "CTS USB Accessory");
154 send_string(device, ACCESSORY_STRING_DESCRIPTION, "CTS USB Accessory");
155 send_string(device, ACCESSORY_STRING_VERSION, "1.0");
156 send_string(device, ACCESSORY_STRING_URI,
158 send_string(device, ACCESSORY_STRING_SERIAL, "1234567890");
160 ret = usb_device_control_transfer(device, USB_DIR_OUT | USB_TYPE_VENDOR,
165 if (device != sDevice)
166 usb_device_close(device);