Files
aqhomecontrol/aqhome/ipc/endpoint_ipc.h
Martin Preuss 518a3a53f9 Heavy work on IPC.
We will now have a broker (aqhome-data) which stores data and distributes
value change messages among connected clients.
aqhomed will connect to that broker and send its values there.
aqhome-mqtt will also connect to the broker and send its values there.
Other clients can later connect to check for changes and react according
to rules.
2023-09-10 23:13:03 +02:00

52 lines
2.0 KiB
C

/****************************************************************************
* 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_ENDPOINT_IPC_H
#define AQH_ENDPOINT_IPC_H
#include <aqhome/api.h>
#include <gwenhywfar/endpoint.h>
#define AQH_IPCENDPOINT_FLAGS_WANTUPDATES 0x0001
#define AQH_IPCENDPOINT_PERMS_LISTVALUES 0x0001
#define AQH_IPCENDPOINT_PERMS_READVALUE 0x0002
#define AQH_IPCENDPOINT_PERMS_ADDVALUE 0x0004
#define AQH_IPCENDPOINT_PERMS_LISTDATA 0x0010
#define AQH_IPCENDPOINT_PERMS_READDATA 0x0020
#define AQH_IPCENDPOINT_PERMS_ADDDATA 0x0040
AQHOME_API void AQH_IpcEndpoint_Extend(GWEN_MSG_ENDPOINT *ep);
AQHOME_API GWEN_MSG_ENDPOINT *AQH_IpcEndpoint_CreateIpcTcpClient(const char *host, int port, const char *name, int groupId);
AQHOME_API GWEN_MSG_ENDPOINT *AQH_IpcEndpoint_CreateIpcTcpServiceForSocket(GWEN_SOCKET *sk, const char *name, int groupId);
AQHOME_API uint32_t AQH_IpcEndpoint_GetAcceptedMsgGroups(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_IpcEndpoint_SetAcceptedMsgGroups(GWEN_MSG_ENDPOINT *ep, uint32_t i);
AQHOME_API void AQH_IpcEndpoint_AddAcceptedMsgGroups(GWEN_MSG_ENDPOINT *ep, uint32_t i);
AQHOME_API void AQH_IpcEndpoint_SubAcceptedMsgGroups(GWEN_MSG_ENDPOINT *ep, uint32_t i);
AQHOME_API const char *AQH_IpcEndpoint_GetServiceName(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_IpcEndpoint_SetServiceName(GWEN_MSG_ENDPOINT *ep, const char *s);
AQHOME_API const char *AQH_IpcEndpoint_GetUserName(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_IpcEndpoint_SetUserName(GWEN_MSG_ENDPOINT *ep, const char *s);
AQHOME_API uint32_t AQH_IpcEndpoint_GetPermissions(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_IpcEndpoint_SetPermissions(GWEN_MSG_ENDPOINT *ep, uint32_t i);
#endif