Home | History | Annotate | Download | only in adb

Lines Matching full:handle

255         usb_handle* handle = CheckInterface((IOUSBInterfaceInterface**)iface,
257 if (handle == NULL) {
264 register_usb_transport(handle, (serial[0] ? serial : NULL), devpath, 1);
273 handle,
274 &handle->usbNotification);
285 usb_handle *handle = (usb_handle *)refCon;
288 if (!handle) {
289 DBG("ERR: NULL handle\n");
293 IOObjectRelease(handle->usbNotification);
294 usb_kick(handle);
303 usb_handle* handle = NULL;
338 handle = reinterpret_cast<usb_handle*>(calloc(1, sizeof(usb_handle)));
339 if (handle == nullptr) goto err_bad_adb_interface;
358 handle->bulkIn = endpoint;
361 handle->bulkOut = endpoint;
363 handle->zero_mask = maxPacketSize - 1;
370 handle->interface = interface;
371 return handle;
374 free(handle);
438 int usb_write(usb_handle *handle, const void *buf, int len)
445 if (!handle)
448 if (NULL == handle->interface) {
453 if (0 == handle->bulkOut) {
459 (*handle->interface)->WritePipe(
460 handle->interface, handle->bulkOut, (void *)buf, len);
462 if ((result == 0) && (handle->zero_mask)) {
464 if(!(len & handle->zero_mask)) {
466 (*handle->interface)->WritePipe(
467 handle->interface, handle->bulkOut, (void *)buf, 0);
478 int usb_read(usb_handle *handle, void *buf, int len)
487 if (!handle) {
491 if (NULL == handle->interface) {
496 if (0 == handle->bulkIn) {
501 result = (*handle->interface)->ReadPipe(handle->interface, handle
505 (*handle->interface)->ClearPipeStall(handle->interface, handle->bulkIn);
506 result = (*handle->interface)->ReadPipe(handle->interface, handle->bulkIn, buf, &numBytes);
518 int usb_close(usb_handle *handle)
523 void usb_kick(usb_handle *handle)
526 if (!handle)
529 if (handle->interface)
531 (*handle->interface)->USBInterfaceClose(handle->interface);
532 (*handle->interface)->Release(handle->interface);
533 handle->interface = 0;