aqhome: Added node db.

This commit is contained in:
Martin Preuss
2023-02-22 21:25:10 +01:00
parent b2138af652
commit 4b3c7a0fa0
9 changed files with 383 additions and 30 deletions

35
aqhome/nodes/nodedb.h Normal file
View File

@@ -0,0 +1,35 @@
/****************************************************************************
* This file is part of the project AqHome.
* AqHome (c) by 2023 Martin Preuss, all rights reserved.
*
* The license for this file can be found in the file COPYING which you
* should have received along with this file.
****************************************************************************/
#ifndef AQH_NODEDB_H
#define AQH_NODEDB_H
#include <aqhome/api.h>
#include <aqhome/nodes/nodeinfo.h>
#include <inttypes.h>
typedef struct AQH_NODE_DB AQH_NODE_DB;
AQHOME_API AQH_NODE_DB *AQH_NodeDb_new();
AQHOME_API void AQH_NodeDb_free(AQH_NODE_DB *ndb);
AQHOME_API AQH_NODE_INFO_LIST *AQH_NodeDb_GetAllNodeInfos(AQH_NODE_DB *ndb);
AQHOME_API int AQH_NodeDb_AddNodeInfo(AQH_NODE_DB *ndb, AQH_NODE_INFO *ni);
AQHOME_API AQH_NODE_INFO *AQH_NodeDb_GetNodeInfoByBusAddr(AQH_NODE_DB *ndb, uint8_t busAddr);
AQHOME_API AQH_NODE_INFO *AQH_NodeDb_GetNodeInfoByUid(AQH_NODE_DB *ndb, uint32_t uid);
AQHOME_API AQH_NODE_INFO_LIST *AQH_NodeDb_GetNodeInfosByNodeType(AQH_NODE_DB *ndb, int t);
#endif