USB tree view and Port details

1,880 views
Skip to first unread message

Neha Prakash

unread,
Apr 28, 2021, 12:48:58 PM4/28/21
to android-platform
Hi, 

I am developing an app which uses Android USB Host API. In this app I need to find the port number, so that I can find that which device is connected to which port. I tried to find the details online but did not find any solution. Everywhere it is mentioned that Android hide the tree view of the USB and so it is not possible to get the connected port details. 

Can anyone please help me in getting solution for the above?

Thanks,

Qamar Abbas

unread,
Apr 30, 2021, 11:12:47 AM4/30/21
to android-...@googlegroups.com
Hi, you can find path like /dev/bus/usb/001/003

Best

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/36c1d74d-7e73-4369-b5df-3e142bb6f0aan%40googlegroups.com.

Neha Prakash

unread,
May 3, 2021, 10:23:53 AM5/3/21
to android-...@googlegroups.com
Hi Qamar,

Thanks for your reply. I have already tried this. This path is not helpful for me, as the paths that I am getting are not persistent across USB disconnects.
Basically, this path is not a unique ID for any port. I need a unique identifier for the port to use it.

Regards,
Neha Prakash 


You received this message because you are subscribed to a topic in the Google Groups "android-platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-platform/1cvZbo39hk4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-platfo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/CAEounHiKdEgaOxkXkK_QbyFW%2B8bDZQS_aq-iFVYVMevTJGpXDg%40mail.gmail.com.

Christian Gagneraud

unread,
May 10, 2021, 10:41:54 AM5/10/21
to android-...@googlegroups.com
On Tue, 4 May 2021 at 02:23, Neha Prakash <neha....@gmail.com> wrote:
>
> Hi Qamar,
>
> Thanks for your reply. I have already tried this. This path is not helpful for me, as the paths that I am getting are not persistent across USB disconnects.
> Basically, this path is not a unique ID for any port. I need a unique identifier for the port to use it.

/sys/bus/usb/devices should give you consistent IDs for any internal
physical USB port which hw/driver is not buggy.

What is your application/needs? Are you doing factory validation?

Chris

Neha Prakash

unread,
May 11, 2021, 10:01:52 AM5/11/21
to android-platform
Hi Chris,

I want a unique ID(or port number) of each port of the USB hub that should not change across disconnects. There is some feature in my app that needs the id of the port for saving/mapping data.
/sys/bus/usb/devices does not give the consistent IDs, it keeps on changing over disconnection.

Thanks,
Neha.

Reply all
Reply to author
Forward
0 new messages