Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » GPIO PinStatusListener(Adding PinStatusListener to a input type gpio throws unsupportedoperationexception)
GPIO PinStatusListener [message #1843351] Sat, 24 July 2021 13:59 Go to next message
Ravi Teja Lavu is currently offline Ravi Teja LavuFriend
Messages: 1
Registered: July 2021
Junior Member
I got the instance of pin by
KuraGPIOPin pin = gpioService.getPinByTerminal(address, direction, mode, trigger);
followed by the pin.open();
and here are the direction, mode and trigger options used -
KuraGPIODirection.INPUT, KuraGPIOMode.INPUT_PULL_UP, KuraGPIOTrigger.NONE

when I added PinStatusListener to this instance I get UnSupportedOperationException.
java.lang.UnsupportedOperationException: Cannot start notification
at com.oracle.dio.gpio.impl.GPIOPinImpl.setInputListener(GPIOPinImpl.java:186)
at org.eclipse.kura.linux.gpio.JdkDioPin.addPinStatusListener(JdkDioPin.java:127)
The documentation says that it is allowed for GPIO type input. I am able to read the value of the pin, so the pin instance is working fine. Did it work for anyone?
Re: GPIO PinStatusListener [message #1843418 is a reply to message #1843351] Wed, 28 July 2021 15:24 Go to previous message
Pierantonio Merlino is currently offline Pierantonio MerlinoFriend
Messages: 39
Registered: March 2016
Member
Hi,

the Kura GPIOService is based on the JdkDio library that interacts with the underlying OS. I could be possible that some GPIOs doesn't support listeners at OS level, so trying to register a listener causes an UnsupportedOperation exception.

Try to take a look at the GPIO example for further info about the code.
Moreover, I noticed that you set KuraGPIOTrigger.NONE, but in this way the listener will not be activated by an event on the pin.
Previous Topic:Cloud connection-Eclipse IoT Subscriber
Next Topic:OPCUA Connection Reconnect using Milo opcua code
Goto Forum:
  


Current Time: Fri Apr 26 22:14:13 GMT 2024

Powered by FUDForum. Page generated in 0.03271 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top