diff options
| -rw-r--r-- | main.c | 18 | ||||
| -rw-r--r-- | usbmuxd.h | 2 |
2 files changed, 10 insertions, 10 deletions
| @@ -464,7 +464,7 @@ static void *usbmuxd_client_init_thread(void *arg) | |||
| 464 | { | 464 | { |
| 465 | struct client_data *cdata; | 465 | struct client_data *cdata; |
| 466 | struct usbmuxd_scan_request *s_req = NULL; | 466 | struct usbmuxd_scan_request *s_req = NULL; |
| 467 | struct usbmuxd_device_info_request dev_info_req; | 467 | struct usbmuxd_device_info_record dev_info_rec; |
| 468 | struct usbmuxd_connect_request *c_req = NULL; | 468 | struct usbmuxd_connect_request *c_req = NULL; |
| 469 | 469 | ||
| 470 | struct usb_bus *bus; | 470 | struct usb_bus *bus; |
| @@ -534,28 +534,28 @@ static void *usbmuxd_client_init_thread(void *arg) | |||
| 534 | found++; | 534 | found++; |
| 535 | 535 | ||
| 536 | // construct packet | 536 | // construct packet |
| 537 | memset(&dev_info_req, 0, sizeof(dev_info_req)); | 537 | memset(&dev_info_rec, 0, sizeof(dev_info_rec)); |
| 538 | dev_info_req.header.length = sizeof(dev_info_req); | 538 | dev_info_rec.header.length = sizeof(dev_info_rec); |
| 539 | dev_info_req.header.type = USBMUXD_DEVICE_INFO; | 539 | dev_info_rec.header.type = USBMUXD_DEVICE_INFO; |
| 540 | dev_info_req.device_info.device_id = dev->devnum; | 540 | dev_info_rec.device_info.device_id = dev->devnum; |
| 541 | dev_info_req.device_info.product_id = dev->descriptor.idProduct; | 541 | dev_info_rec.device_info.product_id = dev->descriptor.idProduct; |
| 542 | if (dev->descriptor.iSerialNumber) { | 542 | if (dev->descriptor.iSerialNumber) { |
| 543 | usb_dev_handle *udev; | 543 | usb_dev_handle *udev; |
| 544 | //pthread_mutex_lock(&usbmux_mutex); | 544 | //pthread_mutex_lock(&usbmux_mutex); |
| 545 | udev = usb_open(dev); | 545 | udev = usb_open(dev); |
| 546 | if (udev) { | 546 | if (udev) { |
| 547 | usb_get_string_simple(udev, dev->descriptor.iSerialNumber, dev_info_req.device_info.serial_number, sizeof(dev_info_req.device_info.serial_number)+1); | 547 | usb_get_string_simple(udev, dev->descriptor.iSerialNumber, dev_info_rec.device_info.serial_number, sizeof(dev_info_rec.device_info.serial_number)+1); |
| 548 | usb_close(udev); | 548 | usb_close(udev); |
| 549 | } | 549 | } |
| 550 | //pthread_mutex_unlock(&usbmux_mutex); | 550 | //pthread_mutex_unlock(&usbmux_mutex); |
| 551 | } | 551 | } |
| 552 | 552 | ||
| 553 | #ifdef DEBUG | 553 | #ifdef DEBUG |
| 554 | if (verbose >= 4) print_buffer(stderr, (char*)&dev_info_req, sizeof(dev_info_req)); | 554 | if (verbose >= 4) print_buffer(stderr, (char*)&dev_info_rec, sizeof(dev_info_rec)); |
| 555 | #endif | 555 | #endif |
| 556 | 556 | ||
| 557 | // send it | 557 | // send it |
| 558 | if (send_buf(cdata->socket, &dev_info_req, sizeof(dev_info_req)) <= 0) { | 558 | if (send_buf(cdata->socket, &dev_info_rec, sizeof(dev_info_rec)) <= 0) { |
| 559 | if (verbose >= 3) fprintf(stderr, "%s: Error: Could not send device info: %s\n", __func__, strerror(errno)); | 559 | if (verbose >= 3) fprintf(stderr, "%s: Error: Could not send device info: %s\n", __func__, strerror(errno)); |
| 560 | found--; | 560 | found--; |
| 561 | } | 561 | } |
| @@ -30,7 +30,7 @@ struct am_device_info { | |||
| 30 | char serial_number[40]; | 30 | char serial_number[40]; |
| 31 | } __attribute__((__packed__)); | 31 | } __attribute__((__packed__)); |
| 32 | 32 | ||
| 33 | struct usbmuxd_device_info_request { | 33 | struct usbmuxd_device_info_record { |
| 34 | struct usbmuxd_header header; | 34 | struct usbmuxd_header header; |
| 35 | struct am_device_info device_info; | 35 | struct am_device_info device_info; |
| 36 | char padding[222]; | 36 | char padding[222]; |
