1
votes

I am working on Java EE application where I want to send/receive messages to and from mobile number.

For this purpose I have used GSM Modem/Dongle.In which I have inserted SIM card from which I will transfer my messages to and from other mobiles.

So, to establish connection with GSM Modem I have to find USB port number where my GSM modem is connected.

So my question is how to find port number where my GSM modem is connected.

1
I think you'll need to get all connected usb devices and then find device you're interested in (GSM modem in given question). Since there're not thousands of usb hubs this won't be too heavy work. Note: May be I am wrong and there's a way to get device directly.Leri
@PLB you know how to find all connected usb devices?Aniket
You could use jUSB. But I've never used it.Leri
i have tried much since you told me to use "jUSB" but i cant found port number, even i didn't got any solution to detect USB port using "jUSB".I have also searched on "JSR" ...so you know any other way..Aniket
@Aniket have you tried this one: jcp.org/en/jsr/detail?id=80user1725145

1 Answers

1
votes

Use ModemManager :

mmcli -L # list modems
mmcli -m <modem> # show modem

If you want to get the ports see here.