def _abort_bulk_in(self, btag):
    'Request that the device abort a pending Bulk-IN operation.'
    abort_timeout_ms = 5000
    data = self.usb_dev.ctrl_transfer(usb.util.build_request_type(usb.util.CTRL_IN, usb.util.CTRL_TYPE_CLASS, usb.util.CTRL_RECIPIENT_ENDPOINT), Request.initiate_abort_bulk_in, btag, self.usb_recv_ep.bEndpointAddress, 2, timeout=abort_timeout_ms)
    if (data[0] != UsbTmcStatus.success):
        return
    self.usb_recv_ep.read(self.RECV_CHUNK, abort_timeout_ms)
    for retry in range(100):
        data = self.usb_dev.ctrl_transfer(usb.util.build_request_type(usb.util.CTRL_IN, usb.util.CTRL_TYPE_CLASS, usb.util.CTRL_RECIPIENT_ENDPOINT), Request.check_abort_bulk_in_status, 0, self.usb_recv_ep.bEndpointAddress, 8, timeout=abort_timeout_ms)
        if (data[0] != UsbTmcStatus.pending):
            break
        time.sleep(0.05)
Request that the device abort a pending Bulk-IN operation.
def _abort_bulk_in(self, btag):
    
    abort_timeout_ms = 5000
    data = self.usb_dev.ctrl_transfer(usb.util.build_request_type(usb.util.CTRL_IN, usb.util.CTRL_TYPE_CLASS, usb.util.CTRL_RECIPIENT_ENDPOINT), Request.initiate_abort_bulk_in, btag, self.usb_recv_ep.bEndpointAddress, 2, timeout=abort_timeout_ms)
    if (data[0] != UsbTmcStatus.success):
        return
    self.usb_recv_ep.read(self.RECV_CHUNK, abort_timeout_ms)
    for retry in range(100):
        data = self.usb_dev.ctrl_transfer(usb.util.build_request_type(usb.util.CTRL_IN, usb.util.CTRL_TYPE_CLASS, usb.util.CTRL_RECIPIENT_ENDPOINT), Request.check_abort_bulk_in_status, 0, self.usb_recv_ep.bEndpointAddress, 8, timeout=abort_timeout_ms)
        if (data[0] != UsbTmcStatus.pending):
            break
        time.sleep(0.05)