Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » IPU Lamp Sample Plugin(How could I modify state management ?)
IPU Lamp Sample Plugin [message #1705303] Thu, 13 August 2015 15:29 Go to next message
Ray Bag is currently offline Ray BagFriend
Messages: 4
Registered: July 2015
Junior Member
Hello,

I'm interesting about IPU LAMP sample plugin. Currently, when we switched on or off a lamp, it creates a new Content Instance resource in Data/contentInstances/ with the new state. I would like to update the Content instance resource instead of creating a new one.

Do you think that it simple to change the lamp state management ?

I've take a look in the controller class and i saw that the doUpdate method is not implemented, i tried to implement it but i don't understand how does it work. Did I have to act on /gscl/applications/LAMP_0/lamps/true resource or on gscl/applications/LAMP_0/containers/DATA/contentInstances/CI_xxxxxxxxx resource ?

Could you give me more explanations about the way to take for doing that ?

Thank you !

Bests.
Re: IPU Lamp Sample Plugin [message #1705502 is a reply to message #1705303] Mon, 17 August 2015 08:44 Go to previous message
Guillaume Garzone is currently offline Guillaume GarzoneFriend
Messages: 54
Registered: April 2015
Member
Hello,

Concerning the update of a ContentInstance resource, this operation is not planned by the SmartM2M specifications. The content instance shall be created, retrieved or deleted. This resource represents an instance of data at a precise moment. The normal behavior is to create a new content instance every time your state or whatever data changes. (This allows to keep an historic of the state changes for example.)

Also, if you want only one content instance at the same time in the container, what you can do is set the max number of content instances to 1 and the platform will automatically delete the old content instance and store the new one.
Finally, to retrieve this content instance, you can use the following uri « gscl/applications/LAMP_0/containers/DATA/contentInstances/latest »
to retrieve the latest content stored in the DATA container without knowing its id.

I hope this will help you understand this process.
Regards,
Guillaume
Previous Topic:Restful web services interaction with OM2M platform
Next Topic:Deploying plugin on a running GSCL/NSCL
Goto Forum:
  


Current Time: Fri Apr 26 00:11:06 GMT 2024

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

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

Back to the top