1

What would be analog to hid_get_feature_report in Android USB Library?

I need to get relays state from usb relays device on Android.

I found example on C (for Linux/Windows): https://github.com/darrylb123/usbrelay/blob/master/libusbrelay.c

static int get_board_features(relay_board *board, hid_device *handle)
{
   unsigned char buf[9];
   //Get the features of the device
   buf[0] = 0x01;
   int ret = hid_get_feature_report(handle, buf, sizeof(buf));
   if (ret == -1)
   {
      perror("hid_get_feature_report\n");
   }

   //Set the serial number (0x0 for termination)
   memset(board->serial, 0x0, sizeof(board->serial));
   memcpy(board->serial, buf, Serial_Length);

   //Byte 7 in the response contains the target_state of the relays
   board->state = buf[7];

   return ret;
}

On Android it returns only one end point Log.i(TAG, "endpointCount ${usbInterface.endpointCount}

user924
  • 8,146
  • 7
  • 57
  • 139

0 Answers0