Exemple #1
0
static ssize_t
askUsbDevice (
  BrailleDisplay *brl, unsigned char request,
  void *buffer, size_t size
) {
  return gioAskResource(brl->gioEndpoint,
                        MT_USB_CONTROL_RECIPIENT, MT_USB_CONTROL_TYPE,
                        request, 0, 0, buffer, size);
}
Exemple #2
0
static int
askResource (
  uint8_t request, uint16_t value, uint16_t index,
  unsigned char *buffer, uint16_t size
) {
  ssize_t result = gioAskResource(gioEndpoint, UsbControlRecipient_Endpoint, UsbControlType_Vendor,
                                  request, value, index, buffer, size);
  int ok = result != -1;

  if (ok) {
    logInputPacket(buffer, result);
  }

  return ok;
}