C/C++ development, API layer

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
Pierre
Posts: 8
Joined: 23 Nov 2015 22:44

C/C++ development, API layer

Post by Pierre » 23 Nov 2015 23:10

I would like to start casual and maybe professional work on Z-Wave using the Razberry board with Z-Way.
JSON is mentioned everywhere and I like to know how the C access we get through the API interacts with Z-Way.
Is it socket or even JSON based (ober http) or what efficient methodes are used for accessing the board from Raspberry PI board?

I could not find access to the C header (In dont own a Raspberry PI to put the image on) and only ready the tiny manual on the website. Is the whole system poll based, or can I request some sort of callback if the Razberry receives any messages form Z-Wave devices?

Edit: my goal is to implement as much of the device management, logic and automation myself. Only thing I don't want to (and can't) worry about is the Z-Wave communication itself, since it requires some sort of Z-Wave licensing or other deal.

Thank you.

pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: C/C++ development, API layer

Post by pofs » 23 Nov 2015 23:35

You can just download and unpack Raspberry Pi distrib and manually unpack it to get header files.

The HTTP JSON API is naturally poll-based, but underlying server-side JS API (and C API as well) supports callbacks to get notified when something changes.

There's a nice set of posts about listening to events (and using C library in general) in this blog: http://yetanotherdeveloperblog.blogspot ... event.html. Good one to start with.

Pierre
Posts: 8
Joined: 23 Nov 2015 22:44

Re: C/C++ development, API layer

Post by Pierre » 23 Nov 2015 23:52

Thank you for the late night reply.

So you are saying the C API pretty much has direct access to the Razberry and does not use HTTP?
The reason I ask is ofc whatever I put on top of the API will be limited by how good the API is.

I did download the this: http://razberry.z-wave.me/z-way-server/razberry.img.zip
But using 7zip I was unable to find any headers in there, just a bunch of files in one folder and a few more images which I could not extract.

The link you gave is great, I will read through his posts.

Another tipic, are there any plans to provide a Razberry with a optional external antenna? I saw manye people mentioning the lack of the build in or how greatly (2-3x) the external one would improve the reception and transmission.

pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: C/C++ development, API layer

Post by pofs » 24 Nov 2015 03:35

Yes, C API doesn't use HTTP or JS in any way.
Contrary, JS engine uses C library under the hood.

I'm not sure what is inside img file (and too lazy to download and check it), but you can try http://razberry.z-wave.me/z-way-server/ ... v2.0.1.tgz. Headers are under libzway directory.

Don't know about external antenna, sorry.

Pierre
Posts: 8
Joined: 23 Nov 2015 22:44

Re: C/C++ development, API layer

Post by Pierre » 24 Nov 2015 10:47

Thank you pofs. Good to hear about the C API.
The link was also great, and I am looking forward to dive into it. I am happy you kept it as plain C as possible, this allows for some easy wrapping. Better than some overloaded C++ templated class constructs.

I am also happy to see you guys are still actively developing it (changelog), and I hope it will keep on going for the next years. :-)

I will now order the Razberry with a PI2 and some devices for testing.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: C/C++ development, API layer

Post by pz1 » 24 Nov 2015 10:55

pofs wrote:I'm not sure what is inside img file (and too lazy to download and check it)
It contains a complete bootable image based on Rasbian. It is the newer version of the 1.7.1 version that has been there as a easy baseline to start off. This newer version is a bit smaller than the 1.7.1. So I assume it has vbeen cleaned up a bit.

Post Reply