ZWay: notification on wake-up events

Z-Wave battery powered devices implement a periodic "wake-up" where it contacts the controller; for the door sensors I am using, I configured the wake-up to happen every 5 minutes.
Now, how to capture this in the ZWay library? It is again the same as for other events: register a callback on a certain "data holder". Here this data holder is found on:

  • device instance level;
  • command class: 132 (wake up);
  • path: "lastWakeup" (there is also another one "lastSleep", so far it is not clear to me which one is the best to use).
Here is a sample code registering a call-back for this event:


 zway_data_acquire_lock(aZWay);
 ZDataHolder dataHolder = zway_find_device_instance_cc_data(aZWay, mDeviceId, 0, COMMAND_CLASS_WAKE_UP, "lastWakeup");
 if (dataHolder != NULL) {
  zway_data_add_callback_ex(aZWay, dataHolder, &aliveCallback, TRUE, this);
 } else {
  cerr << "No data holder for deviceId=" << (int) mDeviceId << endl;
 }
 zway_data_release_lock(aZWay);

Comments

Popular posts from this blog

ZWay: getting the device list.

First steps with the ZWay library

Libcurl: perform a REST HTTP PUT