Use of the retargeting concept in the oneM2M version [message #1730968] |
Sun, 01 May 2016 07:36 |
Klemen Petrovcic Messages: 34 Registered: November 2015 |
Member |
|
|
I would like to perform specific operations on a device using the retargeting concept. For the 0.8 platform version, an example was already provided here.
Could you possible also provide an example for the oneM2M version of the platform?
I have a device with an ip of 192.168.0.118:80 which toggles its state using the /toggle URI.
I tried using it by specifying the poa element while creating the device:
<om2m:ae xmlns:om2m="http://www.onem2m.org/xml/protocols">
<api>app-sensor</api>
<lbl>Type/sensor Category/temperature Location/home</lbl>
<rr>true</rr>
<poa>http://192.168.0.118:80</poa>
</om2m:ae>
And modified the uri od the specific operation in the DESCRIPTOR contentInstance:
<om2m:cin xmlns:om2m="http://www.onem2m.org/xml/protocols">
<cnf>message</cnf>
<con>
<obj>
<str name="type" val="Temperature_Sensor"/>
<str name="location" val="Home"/>
<str name="appId" val="MY_SENSOR"/>
<op name="Toggle" href="/in-cse/MY_SENSOR/toggle"
in="obix:Nil" out="obix:Nil" is="execute"/>
</obj>
</con>
</om2m:cin>
Upon clicking on the button in the web interface this returns an error. Could you, please, explain what I'm missing?
[Updated on: Thu, 05 May 2016 18:26] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Use of the retargeting concept in the oneM2M version [message #1732381 is a reply to message #1732325] |
Mon, 16 May 2016 16:57 |
Klemen Petrovcic Messages: 34 Registered: November 2015 |
Member |
|
|
I tried modifying the listening context on my device. No success.
I think the url http://192.168.0.118:80?op=true is an invalid url since it doesn't contains a context (at least a '/' char). A browser automatically inserts a slash before the "?" char to make the url look like this:
http://192.168.0.118/?op=true
I also checked this by making a small modification to the monitor.jar (source is in the attachment) and tried the following context values:
// private static String context = "?op=true"; // this wont work (throws an exception, illegal path)
// private static String context = "/?op=true"; // this wont work (allows the server to be created, wont accept requests)
private static String context = "/"; // works, can pass the query string 'op=true'
For the last context which worked ("/"), I tried creating the AE with poa parameter set to "127.0.0.1:1400/" and specifying the following URI in the descriptor: /in-cse/in-name/MY-SENSOR?op=true. Same error was returned.
[Updated on: Mon, 16 May 2016 17:26] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06216 seconds