Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OM2M/Web Interface"

(Start the lamps sample IPU)
(Start the lamps sample IPU)
Line 1: Line 1:
 
__TOC__
 
__TOC__
  
== Start the lamps sample IPU ==
+
== Start the sample plugin ==
 
* Go to the GSCL OSGi console and enter the following command to list all deployed plugins.  
 
* Go to the GSCL OSGi console and enter the following command to list all deployed plugins.  
 
<pre>
 
<pre>

Revision as of 14:19, 20 April 2014

Start the sample plugin

  • Go to the GSCL OSGi console and enter the following command to list all deployed plugins.
 osgi> ss
  • Start the "org.eclipse.om2m.ipu.sample" plugin (id=26) by typing the following command:
 osgi> start 26
OSGi consolem: Start the lamps sample IPU
  • The interworking proxy creates all required resources to enable to monitor and control lamps remotely and in a standardized way.
  • After starting, you will see a java graphical interface displaying two lamps and three switches. You can use this interface to switch ON/OFF the two lamps separately or simultaneously.
GUI: Lamps sample

Application resources

  • Open the NSCL web interface, and move to the GSCL resource tree. Click on the "applications" resource to list all registered applications. You will find the following resources:
    • "LAMP_0": an application resource enables to handle lamp 0.
    • "LAMP_1": an application resource enables to handle lamp 1.
    • "LAMP_ALL": is an application resource enables to handle simultaneously lamp 0 and lamp 1.
Web interface: The "applications" resource

Container resources

  • Click on the "LAMP_0" application resource, and then click on the "containers" resource. You will find two containers:
    • "DESCRIPTOR" stores the lamp description.
    • "DATA" stores the lamp data.
Web interface: The "constainers" resource

ContentInstances resources

  • Click on the "DESCRIPTOR" container, and then click on the "contentInstances" resource. You will find one contentInstance containing "LAMP_1" description.
Web interface: The "contetnInstances" resource
  • Click on the contentInstance (CI974727193 in this example)
    • Click on the "getState" button to read the latest lamp state value stored in the GSCL database.
    • Click on the "getState(Direct)" button to read the lamp state directly from the lamp.
    • Click on the "switchON" to switch on the lamp.
    • Click on the "switchOFF" to switch off the lamp.
    • Click on the "toggle" button to toggle the lamp.
Web interface: The LAMP_1 description resource

Remote control lamps

  • Try to switch ON "LAMP_0" via the NSCL web interface, and then check the lamp state value on the java graphical interface.
  • Try to switch OFF "LAMP_0" via the java graphical interface, and the check the lamp state value using the NSCL web interface.
GUI: Lamp1 switched ON

Group resources

  • To understand how the group broadcast works, open the "groups" resource on the "gscl" base resource. Two groups are automatically created by the interworking proxy.
    • "ON_ALL" group handles requests to switch ON all lamps.
    • "OFF_ALL" group handles requests to switch OFF all lamps.
Web interface: The "groups" resource
  • Click on the "ON_ALL" group resource. You can notice that the "members" attribute is automatically set by the interworking proxy with "LAMP_0" and "LAMP_1" switch ON request URIs.
Web interface: The ON_ALL "group" resource

Remote control group of lamps

  • If you send a request to the "membersContent" resource, the GSCL will broadcast it to all the group members.
  • You can try to switch ON/OFF simultaneously "LAMP_0" and "LAMP_1" using the "LAMP_ALL" application resource.
Web interface: The LAMP_ALL description resource
  • Switch ON the two lamps, and then check lamps states on the java graphical interface.
GUI: All lamps are switched ON

Back to the top