C Sample....really exhausted !!

Discussions about RaZberry - Z-Wave board for Raspberry computer
gilpel
Posts: 14
Joined: 14 Jul 2013 14:30

C Sample....really exhausted !!

Post by gilpel »

I want on my Raspberry to perform local actions when a remote device change status (send SMS, email). According to my understanding, this can be done only with C API.
So, I spent few hours trying to compile the z-way-test C sample without any success !
I can't understand why the LIB directory into the Makefile is uncorrect while z-way-server install path is static. Same regarding availability of .a lib refrence which doesn't exist. I didn't success to find out the Makefile modifications in order to perform the compilation.
I also didn't find any documentation about C API (e.g. binding). I read on the forum that it should be available "soon" (more than 6 months ago) !!

I'm very disapointed by the lake of support and documentation. This is not acceptable §

I'm quite close to decide to resign and abandon Razberry !

If anyone could help me to progress and send some examples or doc....

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

Re: C Sample....really exhausted !!

Post by pofs »

I want on my Raspberry to perform local actions when a remote device change status (send SMS, email). According to my understanding, this can be done only with C API.
Why do you think so? JS automation API (inside z-way-server) allows you to do pretty much the same as C API, plus some extra HTTP/XML/JSON operations and shell script invocation. You may implement what you need either as a custom JS script (and add its invocation to main.js), or even as a widget in a new Home Automation UI. Also I believe there's already a widget for SMS/email notification present in current HA.

I believe there's no "z-way-test" sample inside RaZberry distro. Where did you get it from? Probably the makefile is just invalid.

Also take a look at http://yetanotherdeveloperblog.blogspot.be. The author did a great research about using z-way C library, and there are samples present.

EDIT: Oh, I've found z-way-test, and its makefile is just not intended for RaZberry environment. It should be something like this (but I haven't actually tested it):

Code: Select all

### Variables ###
TARGET = z-way-test

ZWAY_LIB = libzway
ZWAY_LIB_DIR = /opt/z-way-server/libs
ZWAY_INCLUDE_DIR = /opt/z-way-server/libzway-dev

OBJECTS = $(patsubst %.c,%.o,$(wildcard *.c))

INCLUDES = -I$(ZWAY_INCLUDE_DIR)
LIBDIR = -L$(ZWAY_LIB_DIR)
LIBS += -lzway -lxml2 -lpthread -lcrypto

### Targets ###

all: $(TARGET)

run:
	export LD_LIBRARY_PATH=$(ZWAY_LIB_DIR):$(LD_LIBRARY_PATH) && ./$(TARGET)

$(TARGET): $(OBJECTS)
	$(CC) $(LIBDIR) $(TARGET_LIBDIR) $(LDFLAGS) $(TARGET_ARCH) -o $@ $< $(LIBS)

%.o: %.c $(ZWAY_LIB_DIR)/$(ZWAY_LIB).so
	$(CC) $(INCLUDES) $(TARGET_INCLUDES) $(CFLAGS) $(TARGET_ARCH) -c $< -o $@

clean:
	rm -f *.o $(TARGET)
	
.PHONY: all clean $(TARGET) run
gilpel
Posts: 14
Joined: 14 Jul 2013 14:30

Re: C Sample....really exhausted !!

Post by gilpel »

Hello,
Thank you very much for your reply.
Why do you think so? JS automation API (inside z-way-server) allows you to do pretty much the same as C API, plus some extra HTTP/XML/JSON operations and shell script invocation.
I'm going to investigate and experiment this way. I had some favour with C API because I already have my own SMS lib written in C++). Anyway after some time spent on reading the DOC, I thinks it won't be easy without any clear samples. Start bad while automation DOC's section is refereing to a config.json tree structure which doesn't look to the one available on my PI....and I don't want to spend hours leading with retro-engineering because of a lake of documentation.
Cool ! Thanks
It should be something like this (but I haven't actually tested it):
My last cleaned Makefile looks like yours. anyway thanks.

I eventually succeeded to compil and link, after updating LD_LIBRARY_PATH and ...it's OK :-)

UPDATE: even if I succeeded to compile, I had to get back to v1.4.1-rc1 because with V1.5, worker thread stops after few seconds...amazing !! ...very disapointed by z-wave.me :-(

Thanks again
Regards
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: C Sample....really exhausted !!

Post by PoltoS »

What happens with your worker thread? Logs are apreciated.
gilpel
Posts: 14
Joined: 14 Jul 2013 14:30

Re: C Sample....really exhausted !!

Post by gilpel »

Hi,

I did new testing on a clean wheezy-raspbian version (3.10.37+ #669). Z-Way version is 1.5.0-rc1-1-ga232aeb.

It takes around 13sec to terminate itself:

pi@raspberrypi /opt/z-way-server/z-way-test $ ./z-way-test
[2014-04-26 09:43:47.358] SETDATA controller.data = Empty
[2014-04-26 09:43:47.362] SETDATA controller.data.nodeId = Empty
[2014-04-26 09:43:47.364] SETDATA controller.data.homeId = Empty
[2014-04-26 09:43:47.368] SETDATA controller.data.SUCNodeId = Empty
[2014-04-26 09:43:47.371] SETDATA controller.data.isPrimary = Empty
[2014-04-26 09:43:47.374] SETDATA controller.data.isInOthersNetwork = Empty
[2014-04-26 09:43:47.375] SETDATA controller.data.isRealPrimary = Empty
[2014-04-26 09:43:47.375] SETDATA controller.data.isSUC = Empty
[2014-04-26 09:43:47.376] SETDATA controller.data.SISPresent = Empty
[2014-04-26 09:43:47.378] SETDATA controller.data.libType = Empty
[2014-04-26 09:43:47.378] SETDATA controller.data.SDK = Empty
[2014-04-26 09:43:47.379] SETDATA controller.data.ZWlibMajor = Empty
[2014-04-26 09:43:47.380] SETDATA controller.data.ZWlibMinor = Empty
[2014-04-26 09:43:47.381] SETDATA controller.data.ZWVersion = Empty
[2014-04-26 09:43:47.382] SETDATA controller.data.ZWaveChip = Empty
[2014-04-26 09:43:47.383] SETDATA controller.data.APIVersion = Empty
[2014-04-26 09:43:47.383] SETDATA controller.data.manufacturerId = Empty
[2014-04-26 09:43:47.385] SETDATA controller.data.vendor = Empty
[2014-04-26 09:43:47.385] SETDATA controller.data.manufacturerProductType = Empty
[2014-04-26 09:43:47.386] SETDATA controller.data.manufacturerProductId = Empty
[2014-04-26 09:43:47.386] SETDATA controller.data.capabilities = Empty
[2014-04-26 09:43:47.386] SETDATA controller.data.controllerState = Empty
[2014-04-26 09:43:47.389] SETDATA controller.data.nonManagmentJobs = Empty
[2014-04-26 09:43:47.390] SETDATA controller.data.lastIncludedDevice = Empty
[2014-04-26 09:43:47.391] SETDATA controller.data.lastExcludedDevice = Empty
[2014-04-26 09:43:47.391] SETDATA controller.data.oldSerialAPIAckTimeout10ms = Empty
[2014-04-26 09:43:47.393] SETDATA controller.data.oldSerialAPIByteTimeout10ms = Empty
[2014-04-26 09:43:47.393] SETDATA controller.data.curSerialAPIAckTimeout10ms = Empty
[2014-04-26 09:43:47.394] SETDATA controller.data.curSerialAPIByteTimeout10ms = Empty
[2014-04-26 09:43:47.394] SETDATA controller.data.libVersionId = Empty
[2014-04-26 09:43:47.395] SETDATA controller.data.countJobs = Empty
[2014-04-26 09:43:47.397] SETDATA controller.data.memoryGetAddress = Empty
[2014-04-26 09:43:47.398] SETDATA controller.data.memoryGetData = Empty
[2014-04-26 09:43:47.400] SETDATA controller.data.functionClasses = Empty
[2014-04-26 09:43:47.401] SETDATA controller.data.functionClassesNames = Empty
[2014-04-26 09:43:47.401] SETDATA controller.data.softwareRevisionVersion = Empty
[2014-04-26 09:43:47.403] SETDATA controller.data.softwareRevisionId = Empty
[2014-04-26 09:43:47.404] SETDATA controller.data.softwareRevisionDate = Empty
[2014-04-26 09:43:47.404] SETDATA controller.data.nodeId = 0 (0x00000000)
[2014-04-26 09:43:47.406] SETDATA controller.data.homeId = 0 (0x00000000)
[2014-04-26 09:43:47.406] SETDATA controller.data.SUCNodeId = 0 (0x00000000)
[2014-04-26 09:43:47.407] SETDATA controller.data.isPrimary = False
[2014-04-26 09:43:47.409] SETDATA controller.data.isInOthersNetwork = False
[2014-04-26 09:43:47.410] SETDATA controller.data.isRealPrimary = False
[2014-04-26 09:43:47.411] SETDATA controller.data.isSUC = False
[2014-04-26 09:43:47.411] SETDATA controller.data.SISPresent = False
[2014-04-26 09:43:47.412] SETDATA controller.data.libType = 0 (0x00000000)
[2014-04-26 09:43:47.413] SETDATA controller.data.ZWlibMajor = 0 (0x00000000)
[2014-04-26 09:43:47.415] SETDATA controller.data.ZWlibMinor = 0 (0x00000000)
[2014-04-26 09:43:47.415] SETDATA controller.data.ZWVersion = 0 (0x00000000)
[2014-04-26 09:43:47.416] SETDATA controller.data.manufacturerId = 0 (0x00000000)
[2014-04-26 09:43:47.417] SETDATA controller.data.manufacturerProductType = 0 (0x00000000)
[2014-04-26 09:43:47.417] SETDATA controller.data.manufacturerProductId = 0 (0x00000000)
[2014-04-26 09:43:47.418] SETDATA controller.data.controllerState = 0 (0x00000000)
[2014-04-26 09:43:47.421] SETDATA controller.data.nonManagmentJobs = 0 (0x00000000)
[2014-04-26 09:43:47.421] SETDATA controller.data.oldSerialAPIAckTimeout10ms = 0 (0x00000000)
[2014-04-26 09:43:47.422] SETDATA controller.data.oldSerialAPIByteTimeout10ms = 0 (0x00000000)
[2014-04-26 09:43:47.423] SETDATA controller.data.curSerialAPIAckTimeout10ms = 0 (0x00000000)
[2014-04-26 09:43:47.424] SETDATA controller.data.curSerialAPIByteTimeout10ms = 0 (0x00000000)
[2014-04-26 09:43:47.424] SETDATA controller.data.libVersionId = 1 (0x00000001)
[2014-04-26 09:43:47.426] SETDATA controller.data.countJobs = False
[2014-04-26 09:43:47.427] SETDATA controller.data.softwareRevisionVersion = "v1.5.0-rc1-1-ga232aeb"
[2014-04-26 09:43:47.428] SETDATA controller.data.softwareRevisionId = "a232aebd0bd5f8f15345f8f1c95706a263a25f02"
[2014-04-26 09:43:47.429] SETDATA controller.data.softwareRevisionDate = "2014-02-13 03:13:44 +0400"
[2014-04-26 09:43:47.431] SETDATA controller.data.functionClasses = int[43]
[2014-04-26 09:43:47.432] [00] 2
[2014-04-26 09:43:47.434] [01] 3
[2014-04-26 09:43:47.435] [02] 4
[2014-04-26 09:43:47.435] [03] 5
[2014-04-26 09:43:47.435] [04] 6
[2014-04-26 09:43:47.436] [05] 7
[2014-04-26 09:43:47.437] [06] 8
[2014-04-26 09:43:47.437] [07] 18
[2014-04-26 09:43:47.437] [08] 19
[2014-04-26 09:43:47.438] [09] 21
[2014-04-26 09:43:47.440] [10] 22
[2014-04-26 09:43:47.441] [11] 32
[2014-04-26 09:43:47.441] [12] 33
[2014-04-26 09:43:47.442] [13] 34
[2014-04-26 09:43:47.442] [14] 35
[2014-04-26 09:43:47.444] [15] 36
[2014-04-26 09:43:47.445] [16] 65
[2014-04-26 09:43:47.445] [17] 66
[2014-04-26 09:43:47.447] [18] 70
[2014-04-26 09:43:47.447] [19] 71
[2014-04-26 09:43:47.447] [20] 72
[2014-04-26 09:43:47.448] [21] 73
[2014-04-26 09:43:47.448] [22] 74
[2014-04-26 09:43:47.449] [23] 75
[2014-04-26 09:43:47.451] [24] 76
[2014-04-26 09:43:47.451] [25] 77
[2014-04-26 09:43:47.452] [26] 80
[2014-04-26 09:43:47.454] [27] 81
[2014-04-26 09:43:47.454] [28] 82
[2014-04-26 09:43:47.454] [29] 83
[2014-04-26 09:43:47.455] [30] 84
[2014-04-26 09:43:47.455] [31] 85
[2014-04-26 09:43:47.456] [32] 86
[2014-04-26 09:43:47.457] [33] 87
[2014-04-26 09:43:47.457] [34] 96
[2014-04-26 09:43:47.458] [35] 97
[2014-04-26 09:43:47.459] [36] 98
[2014-04-26 09:43:47.461] [37] 99
[2014-04-26 09:43:47.462] [38] 128
[2014-04-26 09:43:47.462] [39] 210
[2014-04-26 09:43:47.463] [40] 211
[2014-04-26 09:43:47.463] [41] 242
[2014-04-26 09:43:47.464] [42] 243
[2014-04-26 09:43:47.465] SETDATA controller.data.functionClassesNames = string[43]
[2014-04-26 09:43:47.467] [00] "SerialAPIGetInitData"
[2014-04-26 09:43:47.467] [01] "SerialAPIApplicationNodeInformation"
[2014-04-26 09:43:47.467] [02] "ApplicationCommandHandler"
[2014-04-26 09:43:47.468] [03] "GetControllerCapabilities"
[2014-04-26 09:43:47.469] [04] "SerialAPISetTimeouts"
[2014-04-26 09:43:47.471] [05] "GetSerialAPICapabilities"
[2014-04-26 09:43:47.471] [06] "SerialAPISoftReset"
[2014-04-26 09:43:47.472] [07] "SendNodeInformation"
[2014-04-26 09:43:47.473] [08] "SendData"
[2014-04-26 09:43:47.473] [09] "GetVersion"
[2014-04-26 09:43:47.474] [10] "SendDataAbort"
[2014-04-26 09:43:47.476] [11] "GetHomeId"
[2014-04-26 09:43:47.476] [12] "MemoryGetByte"
[2014-04-26 09:43:47.476] [13] "MemoryPutByte"
[2014-04-26 09:43:47.477] [14] "MemoryGetBuffer"
[2014-04-26 09:43:47.478] [15] "MemoryPutBuffer"
[2014-04-26 09:43:47.478] [16] "GetNodeProtocolInformation"
[2014-04-26 09:43:47.478] [17] "SetDefault"
[2014-04-26 09:43:47.480] [18] "AssignReturnRoute"
[2014-04-26 09:43:47.481] [19] "DeleteReturnRoute"
[2014-04-26 09:43:47.481] [20] "RequestNodeNeighbourUpdate"
[2014-04-26 09:43:47.481] [21] "ApplicationNodeUpdate"
[2014-04-26 09:43:47.484] [22] "AddNodeToNetwork"
[2014-04-26 09:43:47.484] [23] "RemoveNodeFromNetwork"
[2014-04-26 09:43:47.484] [24] "CreateNewPrimary"
[2014-04-26 09:43:47.484] [25] "ControllerChange"
[2014-04-26 09:43:47.486] [26] "SetLearnMode"
[2014-04-26 09:43:47.486] [27] "AssignSUCReturnRoute"
[2014-04-26 09:43:47.486] [28] "EnableSUC"
[2014-04-26 09:43:47.487] [29] "RequestNetworkUpdate"
[2014-04-26 09:43:47.487] [30] "SetSUCNodeId"
[2014-04-26 09:43:47.488] [31] "DeleteSUCReturnRoute"
[2014-04-26 09:43:47.490] [32] "GetSUCNodeId"
[2014-04-26 09:43:47.490] [33] "SendSUCNodeId"
[2014-04-26 09:43:47.490] [34] "RequestNodeInformation"
[2014-04-26 09:43:47.490] [35] "RemoveFailedNode"
[2014-04-26 09:43:47.491] [36] "IsFailedNode"
[2014-04-26 09:43:47.493] [37] "ReplaceFailedNode"
[2014-04-26 09:43:47.493] [38] "GetRoutingTableLine"
[2014-04-26 09:43:47.494] [39] "WatchDogStart"
[2014-04-26 09:43:47.495] [40] "WatchDogStop"
[2014-04-26 09:43:47.496] [41] "ZMEFreqChange"
[2014-04-26 09:43:47.497] [42] "ZMERestore"
[2014-04-26 09:43:47.498] Opened device: /dev/ttyAMA0
[2014-04-26 09:43:47.500] Worker thread successfully created
[2014-04-26 09:43:47.505] Worker thread entry point
[2014-04-26 09:43:47.515] Adding job: Get controller info and supported function classes
[2014-04-26 09:43:47.520] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.535] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.535] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.544] SENT ACK
[2014-04-26 09:43:47.544] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.556] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.568] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.568] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.574] SENT ACK
[2014-04-26 09:43:47.575] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.587] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.597] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.598] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.604] SENT ACK
[2014-04-26 09:43:47.605] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.618] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.628] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.629] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.633] SENT ACK
[2014-04-26 09:43:47.635] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.646] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.657] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.658] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.663] SENT ACK
[2014-04-26 09:43:47.663] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.675] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.686] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.686] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.692] SENT ACK
[2014-04-26 09:43:47.694] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.706] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.716] Received SOF, while awaiting ACK
[2014-04-26 09:43:47.717] RECEIVED: ( 01 2B 01 07 04 02 01 47 00 02 00 03 FE 00 16 80 0C 00 00 00 E3 97 7D 80 07 00 00 80 00 00 00 00 00 00 00 00 00 00 02 00 00 80 07 00 7C )
[2014-04-26 09:43:47.724] SENT ACK
[2014-04-26 09:43:47.725] Received response, but there's no matching request (funcId = 0x07)
[2014-04-26 09:43:47.737] SENDING (cb 0x07): ( 01 03 00 07 FB )
[2014-04-26 09:43:47.748] RECEIVED ACK
[2014-04-26 09:44:06.627] Job 0x07 (Get controller info and supported function classes): No RESPONSE received before timeout
[2014-04-26 09:44:06.627] Job 0x07 (Get controller info and supported function classes) dropped: too many resends
[2014-04-26 09:44:06.627] Job 0x07 (Get controller info and supported function classes): fail
[2014-04-26 09:44:06.628] Get Serial API Capabilities returned zero.
[2014-04-26 09:44:06.628] Removing job: Get controller info and supported function classes
[2014-04-26 09:44:06.638] Worker thread exit point
[2014-04-26 09:44:06.638] Z-Way terminated
[2014-04-26 09:44:06.639] Worker thread successfully finished
[2014-04-26 09:44:06.639] Failed to negotiate with Z-Wave stick: Wrong packet from Z-Wave network or Discovery got bad data (stick communication failed) (-9)
pi@raspberrypi /opt/z-way-server/z-way-test $


regarding the log files:

z-way-server.log
failed to execute shell script on ZDDX save notification
failed to execute shell script on ZDDX save notification
failed to execute shell script on ZDDX save notification
failed to execute shell script on ZDDX save notification


Z-Way.log is full of events collected during installation but nothing (according to time) during z-way-test testing.

with Z-Way version 1.4.1-rc1 it runs correctly except for a part of the code.

In the do_work(ZWay zway) in main.c, there is a piece of code which call an API function which looks like:

basic_level_holder = zway_find_device_instance_cc_data(zway, 3, 0, 0x20, "mylevel");

I just change the device ID by replacing 8 by 3. basic_level_holder always return 0. I also tested with some others funtions like zway_find_device_data(zway, 3, "devices[3].instances[0].commandClasses[0x30].data[1].level.value") which also return 0, but again I dont have any reference (Doc).

Hope it will help.

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

Re: C Sample....really exhausted !!

Post by pofs »

Have you stopped the original z-way-server first?
Your program and the server obviously can't work together.
gilpel
Posts: 14
Joined: 14 Jul 2013 14:30

Re: C Sample....really exhausted !!

Post by gilpel »

Hello,

Thanks for your reply.

This wasn't so obvious for me as long as zway_init(&zway, ZSTR("/dev/ttyAMA0"),.... doesn't return any error (it normaly should if ttyAMA0 is already used/opened) and also because it runs with version 1.4.
Anyway I stopped the server and it runs without being terminated by itself.

Thanks a lot for your help.

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

Re: C Sample....really exhausted !!

Post by pofs »

it normaly should if ttyAMA0 is already used/opened
Yes, this is kind of a known bug, and it is gonna be fixed in the future update.
gilpel
Posts: 14
Joined: 14 Jul 2013 14:30

Re: C Sample....really exhausted !!

Post by gilpel »

Hi,

I've performed more testing and have some questions.

While basic_level_holder = zway_find_device_instance_cc_data(zway, 7, 0, 0x30, "1.level"); succeeds to provide the callback call, it fails with basic_level_holder = zway_find_device_instance_cc_data(zway, 7, 0, 0x30, ""); as long as I'm expecting to retreive a JSON (or equivalent) array.

moreover, basic_level_holder = zway_find_device_instance_data(zway, 7, 0, "commandClasses.48.data.1.level"); returns a null holder.

I'm assuming that womething is wrong in my code, but I'm not able to figure out what exactly.

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

Re: C Sample....really exhausted !!

Post by pofs »

moreover,

Code: Select all

basic_level_holder = zway_find_device_instance_data(zway, 7, 0, "commandClasses.48.data.1.level"); 
returns a null holder.
This is an expected behavior, since you cannot reference command classes as a part of data tree. That's why there are three separate functions: for device data, instance data and CC data.
Making parser understand paths like above will over-complicate it for no particular profit.
it fails with

Code: Select all

basic_level_holder = zway_find_device_instance_cc_data(zway, 7, 0, 0x30, "");
Please provide some code. I'm not completely understanding what are you trying to do, and what exactly is not working.
Post Reply