-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_callbacks.h
28 lines (24 loc) · 905 Bytes
/
data_callbacks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include <ZWayLib.h>
#include <ZData.h>
#include <stdbool.h>
#include "event_pump.h"
#define SENSOR_DATA_CHANGE_EVENT "SensorDataChangeEvent"
typedef struct sensor_event_data_t
{
uint8_t node_id;
uint8_t instance_id;
uint8_t command_id;
const char* device_name;
unsigned long last_update_time;
ZDataHolder data_holder;
bool callback_added;
event_pump_t* event_pump;
} sensor_event_data_t;
/*
This file holds callback(s) to handle data changes. Each data change is considered to be
scene event and an appropriate scene definition lookup is performed and, if found,
the scene is executed
*/
void data_change_event_callback(ZDataRootObject rootObject, ZWDataChangeType changeType, ZDataHolder data, void * arg);
void value_change_event_callback(ZDataRootObject rootObject, ZWDataChangeType changeType, ZDataHolder data, void * arg);