Skip to content

Android Cannot Open device (hid_open) #178

Description

@DavEat

Hi,

I'm using .so libs of hidapi and libusb compile with linux for android
I have integrated those lib in a c++ project to make an interface to be able to call function in Java

(e.g. JNIEXPORT jint JNICALL Java_com_company_project_class_Enumerate(char* string, int length) //hid_enumerate
JNIEXPORT jint JNICALL Java_com_company_project_class_Open() //hid_open
(for now the vendorId and the productId are hard coded in the c++))

With hid_enumerate I have succeed to get some data from the devices such as the path or the vendorId
But if I try to use hid_open or hid_open_path it's always returning a nullptr hid_device*.

I should have set up my permission correctly (when I connect my hid device the phone ask me if I want to use the app I made with the usb device I just connect).

I also try to integrate it in Unity3d and I have the exact same behaviors.

Any help would be much appreciate since I'm completely block ATM.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidAndroid OS related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions