-
Notifications
You must be signed in to change notification settings - Fork 506
/
device_access_fn.h
53 lines (44 loc) · 1.84 KB
/
device_access_fn.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright (c) 2021 dresden elektronik ingenieurtechnik gmbh.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
*/
#ifndef DEVICE_ACCESS_FN_H
#define DEVICE_ACCESS_FN_H
#include <QString>
#include <QVariant>
#include <vector>
class Resource;
class ResourceItem;
namespace deCONZ {
class ApsController;
class ApsDataConfirm;
class ApsDataRequest;
class ApsDataIndication;
class ZclFrame;
}
struct DA_ReadResult
{
bool isEnqueued = false;
bool ignoreResponseSequenceNumber = false;
quint8 apsReqId = 0;
quint8 sequenceNumber = 0;
quint16 clusterId = 0;
};
typedef bool (*ParseFunction_t)(Resource *r, ResourceItem *item, const deCONZ::ApsDataIndication &ind, const deCONZ::ZclFrame &zclFrame, const QVariant &parseParameters);
typedef DA_ReadResult (*ReadFunction_t)(const Resource *r, const ResourceItem *item, deCONZ::ApsController *apsCtrl, const QVariant &readParameters);
typedef bool (*WriteFunction_t)(const Resource *r, const ResourceItem *item, deCONZ::ApsController *apsCtrl, const QVariant &writeParameters);
// temporary expose parseTuyaData for check in tuya.cpp
bool parseTuyaData(Resource *r, ResourceItem *item, const deCONZ::ApsDataIndication &ind, const deCONZ::ZclFrame &zclFrame, const QVariant &parseParameters);
ParseFunction_t DA_GetParseFunction(const QVariant ¶ms);
ReadFunction_t DA_GetReadFunction(const QVariant ¶ms);
WriteFunction_t DA_GetWriteFunction(const QVariant ¶ms);
unsigned DA_ApsUnconfirmedRequests();
unsigned DA_ApsUnconfirmedRequestsForExtAddress(uint64_t extAddr);
void DA_ApsRequestEnqueued(const deCONZ::ApsDataRequest &req);
void DA_ApsRequestConfirmed(const deCONZ::ApsDataConfirm &conf);
#endif // DEVICE_ACCESS_FN_H