c++ and api

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
skohrt
Posts: 3
Joined: 24 Feb 2016 10:41

c++ and api

Post by skohrt »

Hello,
I am an absolutely newbee in the razberry business.
After reading a lot in the manuals, faq, forum, I can access my door sensor (battery) and my binary switch (wired) via the following browser commands:

http://IP:8083/ZWaveAPI/Run/devices[2]. ... Classes[48]

which leads to:

{"name":"SensorBinary","data":{"invalidateTime":1456220566,"updateTime":1456220567,"type":"empty","value":null,"supported":{"invalidateTime":1456220566,"updateTime":1456220567,"type":"bool","value":true},"version":{"invalidateTime":1456220764,"updateTime":1456220765,"type":"int","value":1},"security":{"invalidateTime":1456220566,"updateTime":1456220567,"type":"bool","value":false},"interviewDone":{"invalidateTime":1456220566,"updateTime":1456220766,"type":"bool","value":true},"interviewCounter":{"invalidateTime":1456220566,"updateTime":1456220766,"type":"int","value":9},"typemask":{"invalidateTime":1456220566,"updateTime":1456220766,"type":"int","value":2},"1":{"invalidateTime":1456220765,"updateTime":1456298977,"type":"empty","value":null,"sensorTypeString":{"invalidateTime":1456220765,"updateTime":1456220766,"type":"string","value":"General purpose"},"level":{"invalidateTime":1456301400,"updateTime":1456298977,"type":"bool","value":false}}},"id":48}

and

http://IP:8083/ZWaveAPI/Run/devices[4]. ... 32].Set(x)

x=0 or x=255 to toggle to switch.

Now, I want to go one step further. I successfully installed NetBeans on my Raspberry and I added
  • /opt/z-way-server/libzway
for the include-files needed.

To start with, I want to write a really small and tiny c++ application, which gets the level-updateTime and the level-value of the door sensor, each time the application runs. Or an application, that sends the on/off command to the binary switch, each time the application runs.

What I need is the very very basic construction in c++ to access the sensors in both directions. It should lead me to do my first "Hello World!" in the huge world of c-api.

I went through the code samples, especially the different libzway include files, but they are way to complex for now.

Thank you for an idea, how to start.

Best reagards,
skohrt
Post Reply