Hi Mikko,
I am performing connect-disconnect load operations on smart meter using an Android app via the serial interface.
When I connect the cable to the mobile phone, it prompts for permission to access the port. After granting permission, the latest port does not update in the GXSerial port list. Currently, we have to restart the mobile application to see the latest port.
After granting permission, all latest ports should update in the list without restarting the mobile app.
Can you please suggest how I can achieve this using Gurux.Serial.Android?
Thank you.
Hi, Are you listening…
Hi,
Are you listening onPortAdded event? That is called when a new port is added.
BR,
Mikko
Hello @Kurumi, I am facing…
Hello @Kurumi,
I am facing specific issue with detecting device at runtime. I am using GXSerial class for getting available ports and this class is also responsible for creating broadcast receiver for device attached, device detached and permission intent events.
Now in GXSerial Class, we are registering a broadcast receiver (GXUsbReciever). The problem lies here. When the UsbManager.ACTION_USB_DEVICE_ATTACHED action is called the receiver will call addPort since there is no permission for this device. It will generate an intent for getting permission. Once permission is granted by the user, action ("gurux.serial") given in the intent will be received in the broadcast receiver. This broadcast receiver will have an intent where we will parse the device from the intent. Where device is null and even if device permission is granted and addPort is called. Nothing will be changed since device is null.
Please check the image attached.
Hi, This is fixed. Get the…
Hi,
This is fixed. Get the latest version.
BR,
Mikko