|
|
|
|
|
Re: update installed package remotely [message #1711417 is a reply to message #1711316] |
Thu, 15 October 2015 19:33 |
David Woodard Messages: 420 Registered: July 2014 |
Senior Member |
|
|
Hi Paul,
We don't really have these documented anywhere, what kind of information are you looking for? If you are interested in how the messages are constructed, you can review the source code [1].
When you say 'request the "APPS" message', do you mean subscribe to the topic? If so, you should implement the CloudClientListener interface. There is a method, onControlMessageArrived, that should do this for you. Then your CloudClient object should call addCloudClientListener to add your implementation.
You are correct, lifecycle messages are not retained, but if this is your use case you may want to store these messages in a database anyway. These messages would not persist a broker restart for example. That said, if you want the life cycle message to be published and retained, you would need to customize Kura. It would be a small change, you would just need to change LIFECYCLE_RETAIN to true in the CloudServiceOptions file [2]. I will propose making this a configurable value in future releases.
[1] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core.cloud/src/main/java/org/eclipse/kura/core/cloud/CloudServiceImpl.java
[2] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core.cloud/src/main/java/org/eclipse/kura/core/cloud/CloudServiceOptions.java
Thanks,
--Dave
|
|
|
Re: update installed package remotely [message #1711545 is a reply to message #1711417] |
Sat, 17 October 2015 04:10 |
paul stanton Messages: 87 Registered: July 2009 |
Member |
|
|
Hi Dave,
I've reverse engineered usage of these topics - particularly 'BIRTH'. Yes, the source code seems to be the best available documentation unfortunately.
The problem is, the APPS message is called whenever an app is activated/deactivated, ie multiple times on shutdown. it is therefore often not an accurate list of installed apps, when it is published automatically.
the BIRTH message is always reliable, however could possibly only publish once if a device is never rebooted. Same goes for the APPS message, it may never change/publish after initial reboot.
The information these messages contain is vital however for our 'remote-controller' - os version, kura version, java version, apps, etc etc.
Therefore, is there a nice way to publish something to the kura device which may trigger the APPS message to be published? The only thing I can think of is to create a dummy DP and install/remove it using EXEC/INSTALL.
Another option, as you've pointed out which I will now investigate is configuring kura to publish the BIRTH/APPS messages with retain so that the 'remote-controller' can receive the latest for each kura device when it subscribes.
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04411 seconds