Guidelines for REST development or alternatives.

22 views
Skip to first unread message

Miguel Nunes

unread,
Nov 19, 2014, 5:25:14 AM11/19/14
to Jemma General
Hi all,

I have been able to compile Jemma 0.9 rc2 successfuly and also been able to send messages using REST.
Today I felt I had a problem.

I seem to have some problems understanding the modis operandis of the REST interface...
Is it true that when I use REST, I need to encode/decode ZCL packets on my own?
The only thing I need is to get timestamp+value of a cluster attribute.

What do you suggest me to focus on to achieve this?

Sorry for taking your time.

Thanks in advance.

--
Miguel Nunes
Software Developer

migan...@gmail.com


Ivan Grimaldi

unread,
Nov 19, 2014, 6:33:15 AM11/19/14
to Miguel Nunes, Jemma General

Dear Miguel,

you don't need to encode/decode zcl messages, REST APIs rely on top of OSGi Device Abstraction Layer which is not ZigBee-dependent.

To understand how to interact with REST APIs and how to set-up a test environment with fake devices you can take a look to this page:
https://github.com/ismb/it.ismb.pert.osgi.dal.web-apis/blob/master/README.md


If you want to know all Functions which are exposed by ZigBee devices in JEMMA you can take a look at this page:
https://github.com/ismb/jemma/wiki/JEMMA-DAL-APIs-functions

For instance, if you are looking for the InstantaneousDemand of a device exposing a SimpleMeteringServer cluster, you can send a post request to a function EnergyMeter

URL: http://localhost/api/functions/ZigBee:myFunction:EnergyMeter
POST BODY:{"operation":"getData"}


I hope this helps.


Best Regards.
Ivan



--
JEMMA - Java Energy ManageMent Application framework - http://jemma.energy-home.org
---
You received this message because you are subscribed to the Google Groups "JEMMA General Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jemma-genera...@googlegroups.com.
To post to this group, send email to jemma-...@googlegroups.com.
Visit this group at http://groups.google.com/group/jemma-general.
To view this discussion on the web visit https://groups.google.com/d/msgid/jemma-general/546C7008.1040706%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages