function ioctl_read(deviceHandle, type, request, value, index, length,
    callback) {
  chrome.usb.controlTransfer(deviceHandle, {
    requestType: type,
    recipient: 'device',
    direction: 'in',
    request: request,
    value: value,
    index: index,
    length: length
  }, function(info) {
    // If we fail really hard (device closed/etc), info will be undefined.
    // TODO(benvanik); file a bug on this.
    if (!info) {
      callback(1, null);
      return;
    }
    callback(
        info.resultCode,
        info.resultCode ? null : new Uint8Array(info.data));
  });
}
IOCTL-like method for reading from a device.
@param {!Object} deviceHandle Chrome device handle.
@param {string} type Request type.
@param {number} request Request number.
@param {number} value Value.
@param {number} index Index.
@param {number} length Expected response length.
@param {!function(number, Uint8Array)} callback Callback. Receives a result
    code (non-zero for error) and a data buffer.