aqhome: more work on http server.

This commit is contained in:
Martin Preuss
2023-08-08 23:49:28 +02:00
parent 3378908c93
commit aafecfa704
50 changed files with 2988 additions and 497 deletions

View File

@@ -41,7 +41,7 @@
<default>0</default>
<preset>0</preset>
<access>public</access>
<flags></flags>
<flags>with_getbymember</flags>
</member>
<member name="description" type="char_ptr" maxlen="256">

View File

@@ -82,6 +82,40 @@ void AQH_Storage_SetStateFile(AQH_STORAGE *sto, const char *s)
void AQH_Storage_AddRoom(AQH_STORAGE *sto, AQH_ROOM *r)
{
if (sto && r) {
uint64_t id;
id=++(sto->lastRoomId);
AQH_Room_SetId(r, id);
AQH_Room_List_Add(r, sto->roomList);
}
}
AQH_ROOM_LIST *AQH_Storage_GetRoomList(const AQH_STORAGE *sto)
{
return sto?sto->roomList:NULL;
}
AQH_ROOM *AQH_Storage_GetRoomById(const AQH_STORAGE *sto, uint64_t id)
{
return sto?AQH_Room_List_GetById(sto->roomList, id):NULL;
}
AQH_ROOM *AQH_Storage_GetRoomByName(const AQH_STORAGE *sto, const char *s)
{
return sto?AQH_Room_List_GetByName(sto->roomList, s):NULL;
}
void AQH_Storage_AddDevice(AQH_STORAGE *sto, AQH_DEVICE *dev)
{
if (sto && dev) {

View File

@@ -46,6 +46,11 @@ extern "C" {
AQHOME_API AQH_STORAGE *AQH_Storage_new(void);
AQHOME_API void AQH_Storage_free(AQH_STORAGE *sto);
AQHOME_API void AQH_Storage_AddRoom(AQH_STORAGE *sto, AQH_ROOM *r);
AQHOME_API AQH_ROOM_LIST *AQH_Storage_GetRoomList(const AQH_STORAGE *sto);
AQHOME_API AQH_ROOM *AQH_Storage_GetRoomById(const AQH_STORAGE *sto, uint64_t id);
AQHOME_API AQH_ROOM *AQH_Storage_GetRoomByName(const AQH_STORAGE *sto, const char *s);
AQHOME_API void AQH_Storage_AddDevice(AQH_STORAGE *sto, AQH_DEVICE *dev);
AQHOME_API AQH_DEVICE_LIST *AQH_Storage_GetDeviceList(const AQH_STORAGE *sto);
AQHOME_API AQH_DEVICE *AQH_Storage_GetDeviceById(const AQH_STORAGE *sto, uint64_t id);