Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » Usage of om2m middleware
Usage of om2m middleware [message #1702853] Sun, 26 July 2015 09:08 Go to next message
Eclipse UserFriend
Hello,

I completed the tutorial about creating a new om2m plugin in eclipse, with the creation of four class activator, mapper, controller and monitor.
Now , I want to know how to make requests to the platform using the XML file , and where do I do POST and GET requests using java?

Thank You
Re: Usage of om2m middleware [message #1703548 is a reply to message #1702853] Mon, 03 August 2015 01:14 Go to previous message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello Marco,

Let's suppose that you chose the ID "ipu-id" for your plugin. This ID should be returned as String in the method "public String getAPOCPath()" of the IPU Controller class. (In the developper tutorial we used "sample" as ID)

Then, you have to create an application resource (e.g. called MY_DEVICE) containing the IPU ID "ipu-id" as specific aPoCPath.
HTTP request example:
POST 127.0.0.1:8080/om2m/gscl/applications
<om2m:application xmlns:om2m="http://uri.etsi.org/m2m" appId="MY_DEVICE">
    <om2m:aPoCPaths>
         <om2m:aPoCPath>
            <om2m:path>ipu-id</om2m:path>
        </om2m:aPoCPath>
    </om2m:aPoCPaths>
</om2m:application>


Now, if you send an HTTP request to the GSCL to this URI "127.0.0.1:8080/om2m/gscl/applications/MY_DEVICE/ipu-id/...", it will be delegated to the IPU plugin with ID "ipu-id" and handled specifically by the IPU Controller class. So you can define your own URI by adding specific parameters and process them correctly in your controller class. Example:
127.0.0.1:8080/om2m/gscl/applications/MY_DEVICE/ipu-id/true/30/blablaba

Once your URIs are operational, you can create a nice DESCRIPTOR container sub-resource for the MY_DEVICE application with the appropriate obix description to let users know about the available operation (the specific URIs and methods).

The IPU lamps plugin already provided in the OM2M source code illustrates this mechanism. It shows a good example on how to integrated specific devices using the inter-working proxy mechanism.

Hope this can help,
Best regards,
Mahdi
Previous Topic:Porting OM2M hardware requirement
Next Topic:Web services in OM2M
Goto Forum:
  


Current Time: Fri Apr 26 15:28:44 GMT 2024

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

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

Back to the top