Start the sample plugin
- Go to the GSCL OSGi console and enter the following command to list all deployed plugins.
- Start the "org.eclipse.om2m.ipu.sample" plugin (id=24 in this example) by typing the following command:
osgi> start 24
- 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.
- 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.
- 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.
- Click on the "DESCRIPTOR" container, and then click on the "contentInstances" resource. You will find one contentInstance containing "LAMP_1" description.
- 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.
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.
- 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.
- 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.
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.
- Switch ON the two lamps, and then check lamps states on the java graphical interface.