aqhome-nodes: write db on fini(). Extract info from DEVICE message.

This commit is contained in:
Martin Preuss
2024-09-18 00:15:43 +02:00
parent 08399ecf87
commit 7590aa3717
4 changed files with 30 additions and 11 deletions

View File

@@ -78,16 +78,8 @@ void AqHomed_Loop(AQHOMED *aqh, int timeoutInMsecs)
GWEN_Msg_List_GetCount(GWEN_MsgEndpoint_GetSendMessageList(aqh->brokerEndpoint)));
#endif
if (AQH_NodeDb_IsModified(aqh->nodeDb)) {
if (aqh->dbFile) {
GWEN_DB_NODE *dbNodeDb;
dbNodeDb=GWEN_DB_Group_new("nodeDb");
AQH_NodeDb_toDb(aqh->nodeDb, dbNodeDb);
GWEN_DB_WriteFile(dbNodeDb, aqh->dbFile, GWEN_DB_FLAGS_DEFAULT);
GWEN_DB_Group_free(dbNodeDb);
}
}
if (AQH_NodeDb_IsModified(aqh->nodeDb))
AqHomed_WriteNodeDb(aqh);
}
}