aqhome: finished transformation of aqhome-data and aqhome-tool.
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
<headers dist="true" install="$(pkgincludedir)/msg" >
|
||||
m_ipc.h
|
||||
m_ipc_tag16.h
|
||||
m_ipc_connect.h
|
||||
m_ipc_result.h
|
||||
</headers>
|
||||
|
||||
@@ -60,6 +61,7 @@
|
||||
|
||||
m_ipc.c
|
||||
m_ipc_tag16.c
|
||||
m_ipc_connect.c
|
||||
m_ipc_result.c
|
||||
</sources>
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
|
||||
<headers dist="true" install="$(pkgincludedir)/msg" >
|
||||
m_ipcd.h
|
||||
m_ipcd_connect.h
|
||||
m_ipcd_multidata.h
|
||||
m_ipcd_devices.h
|
||||
m_ipcd_values.h
|
||||
@@ -63,7 +62,6 @@
|
||||
$(local/typefiles)
|
||||
|
||||
m_ipcd.c
|
||||
m_ipcd_connect.c
|
||||
m_ipcd_multidata.c
|
||||
m_ipcd_devices.c
|
||||
m_ipcd_values.c
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
|
||||
|
||||
|
||||
#define AQH_MSGTYPE_IPC_DATA_RESULT 0x0001 /* AQH_ResultIpcMsg */
|
||||
|
||||
#define AQH_MSGTYPE_IPC_DATA_CONNECT_REQ 0x0010 /* serviceName, userName, password */
|
||||
#define AQH_MSGTYPE_IPC_DATA_RESULT AQH_MSGTYPE_IPC_RESULT
|
||||
#define AQH_MSGTYPE_IPC_DATA_CONNECT_REQ AQH_MSGTYPE_IPC_CONNECT_REQ
|
||||
|
||||
#define AQH_MSGTYPE_IPC_DATA_UPDATEDATA 0x0100 /* AQH_MultiDataDataIpcMsg */
|
||||
#define AQH_MSGTYPE_IPC_DATA_DATACHANGED 0x0200 /* AQH_MultiDataDataIpcMsg */
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/****************************************************************************
|
||||
* This file is part of the project AqHome.
|
||||
* AqHome (c) by 2025 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_M_IPCD_CONNECT_H
|
||||
#define AQH_M_IPCD_CONNECT_H
|
||||
|
||||
|
||||
|
||||
#include <aqhome/api.h>
|
||||
#include <aqhome/ipc2/message.h>
|
||||
|
||||
#include <gwenhywfar/tag16.h>
|
||||
|
||||
|
||||
#define AQH_MSGDATA_CONNECT_TAGS_CLIENTID 0x0001
|
||||
#define AQH_MSGDATA_CONNECT_TAGS_USERID 0x0002
|
||||
#define AQH_MSGDATA_CONNECT_TAGS_PASSWORD 0x0003
|
||||
#define AQH_MSGDATA_CONNECT_TAGS_FLAGS 0x0004
|
||||
|
||||
#define AQH_MSGDATA_CONNECT_FLAGS_WANTUPDATES 0x0001
|
||||
|
||||
|
||||
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcdMessageConnect_new(uint16_t code,
|
||||
uint32_t msgId, uint32_t refMsgId,
|
||||
const char *clientId, const char *userId, const char *password,
|
||||
uint32_t flags);
|
||||
|
||||
AQHOME_API void AQH_IpcdMessageConnect_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList,
|
||||
GWEN_BUFFER *dbuf, const char *sText);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -25,6 +25,8 @@
|
||||
#define AQH_IPCMSG_OFFS_PAYLOAD 16 /* begin of payload for a given message */
|
||||
|
||||
|
||||
#define AQH_MSGTYPE_IPC_RESULT 0x0001
|
||||
#define AQH_MSGTYPE_IPC_CONNECT_REQ 0x0010
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,9 +11,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_connect.h"
|
||||
#include "aqhome/msg/ipc/m_ipc_connect.h"
|
||||
#include "aqhome/msg/ipc/m_ipc_tag16.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd.h"
|
||||
#include "aqhome/msg/ipc/m_ipc.h"
|
||||
|
||||
#include <gwenhywfar/text.h>
|
||||
@@ -34,22 +33,23 @@
|
||||
* ------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
AQH_MESSAGE *AQH_IpcdMessageConnect_new(uint16_t code, uint32_t msgId, uint32_t refMsgId,
|
||||
const char *clientId, const char *userId, const char *password, uint32_t flags)
|
||||
AQH_MESSAGE *AQH_IpcMessageConnect_new(uint8_t protoId, uint8_t protoVer, uint16_t code,
|
||||
uint32_t msgId, uint32_t refMsgId,
|
||||
const char *clientId, const char *userId, const char *password, uint32_t flags)
|
||||
{
|
||||
AQH_MESSAGE *msg;
|
||||
GWEN_BUFFER *buf;
|
||||
|
||||
buf=GWEN_Buffer_new(0, 256, 0, 1);
|
||||
if (clientId && *clientId)
|
||||
GWEN_Tag16_WriteStringTagToBuffer(AQH_MSGDATA_CONNECT_TAGS_CLIENTID, clientId, buf);
|
||||
GWEN_Tag16_WriteStringTagToBuffer(AQH_MSG_CONNECT_TAGS_CLIENTID, clientId, buf);
|
||||
if (userId && *userId)
|
||||
GWEN_Tag16_WriteStringTagToBuffer(AQH_MSGDATA_CONNECT_TAGS_USERID, userId, buf);
|
||||
GWEN_Tag16_WriteStringTagToBuffer(AQH_MSG_CONNECT_TAGS_USERID, userId, buf);
|
||||
if (password && *password)
|
||||
GWEN_Tag16_WriteStringTagToBuffer(AQH_MSGDATA_CONNECT_TAGS_PASSWORD, password, buf);
|
||||
GWEN_Tag16_WriteUint32TagToBuffer(AQH_MSGDATA_CONNECT_TAGS_FLAGS, flags, buf);
|
||||
GWEN_Tag16_WriteStringTagToBuffer(AQH_MSG_CONNECT_TAGS_PASSWORD, password, buf);
|
||||
GWEN_Tag16_WriteUint32TagToBuffer(AQH_MSG_CONNECT_TAGS_FLAGS, flags, buf);
|
||||
|
||||
msg=AQH_IpcMessage_new(AQH_IPC_PROTOCOL_DATA_ID, AQH_IPC_PROTOCOL_DATA_VERSION, code, msgId, refMsgId,
|
||||
msg=AQH_IpcMessage_new(protoId, protoVer, code, msgId, refMsgId,
|
||||
GWEN_Buffer_GetUsedBytes(buf), (const uint8_t*) GWEN_Buffer_GetStart(buf));
|
||||
|
||||
GWEN_Buffer_free(buf);
|
||||
@@ -58,16 +58,16 @@ AQH_MESSAGE *AQH_IpcdMessageConnect_new(uint16_t code, uint32_t msgId, uint32_t
|
||||
|
||||
|
||||
|
||||
void AQH_IpcdMessageConnect_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, GWEN_BUFFER *dbuf, const char *sText)
|
||||
void AQH_IpcMessageConnect_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, GWEN_BUFFER *dbuf, const char *sText)
|
||||
{
|
||||
char *clientId=NULL;
|
||||
char *userId=NULL;
|
||||
uint32_t flags=0;
|
||||
|
||||
if (tagList) {
|
||||
clientId=AQH_Tag16_GetTagDataAsNewString(tagList, AQH_MSGDATA_CONNECT_TAGS_CLIENTID, NULL);
|
||||
userId=AQH_Tag16_GetTagDataAsNewString(tagList, AQH_MSGDATA_CONNECT_TAGS_USERID, NULL);
|
||||
flags=AQH_Tag16_GetTagDataAsUint32(tagList, AQH_MSGDATA_CONNECT_TAGS_FLAGS, 0);
|
||||
clientId=AQH_Tag16_GetTagDataAsNewString(tagList, AQH_MSG_CONNECT_TAGS_CLIENTID, NULL);
|
||||
userId=AQH_Tag16_GetTagDataAsNewString(tagList, AQH_MSG_CONNECT_TAGS_USERID, NULL);
|
||||
flags=AQH_Tag16_GetTagDataAsUint32(tagList, AQH_MSG_CONNECT_TAGS_FLAGS, 0);
|
||||
}
|
||||
|
||||
GWEN_Buffer_AppendArgs(dbuf,
|
||||
40
aqhome/msg/ipc/m_ipc_connect.h
Normal file
40
aqhome/msg/ipc/m_ipc_connect.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
* This file is part of the project AqHome.
|
||||
* AqHome (c) by 2025 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_M_IPCD_CONNECT_H
|
||||
#define AQH_M_IPCD_CONNECT_H
|
||||
|
||||
|
||||
|
||||
#include <aqhome/api.h>
|
||||
#include <aqhome/ipc2/message.h>
|
||||
|
||||
#include <gwenhywfar/tag16.h>
|
||||
|
||||
|
||||
#define AQH_MSG_CONNECT_TAGS_CLIENTID 0x0001
|
||||
#define AQH_MSG_CONNECT_TAGS_USERID 0x0002
|
||||
#define AQH_MSG_CONNECT_TAGS_PASSWORD 0x0003
|
||||
#define AQH_MSG_CONNECT_TAGS_FLAGS 0x0004
|
||||
|
||||
#define AQH_MSG_CONNECT_FLAGS_WANTUPDATES 0x0001
|
||||
|
||||
|
||||
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcMessageConnect_new(uint8_t protoId, uint8_t protoVer, uint16_t code,
|
||||
uint32_t msgId, uint32_t refMsgId,
|
||||
const char *clientId, const char *userId, const char *password,
|
||||
uint32_t flags);
|
||||
|
||||
AQHOME_API void AQH_IpcMessageConnect_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList,
|
||||
GWEN_BUFFER *dbuf, const char *sText);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -49,6 +49,7 @@
|
||||
m_ipcn_forward.h
|
||||
m_ipcn_getdevices_req.h
|
||||
m_ipcn_getdevices_rsp.h
|
||||
m_ipcn_setaccmsggrps.h
|
||||
</headers>
|
||||
|
||||
|
||||
@@ -63,6 +64,7 @@
|
||||
m_ipcn_forward.c
|
||||
m_ipcn_getdevices_req.c
|
||||
m_ipcn_getdevices_rsp.c
|
||||
m_ipcn_setaccmsggrps.c
|
||||
</sources>
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
#define AQH_IPC_PROTOCOL_NODES_VERSION 1
|
||||
|
||||
|
||||
#define AQH_MSGTYPE_IPC_NODES_RESULT 0xf001
|
||||
#define AQH_MSGTYPE_IPC_NODES_RESULT AQH_MSGTYPE_IPC_RESULT
|
||||
#define AQH_MSGTYPE_IPC_NODES_CONNECT_REQ AQH_MSGTYPE_IPC_CONNECT_REQ
|
||||
|
||||
#define AQH_MSGTYPE_IPC_NODES_FORWARD 0xf100
|
||||
#define AQH_MSGTYPE_IPC_NODES_VALUE 0xf200
|
||||
|
||||
@@ -52,6 +52,13 @@ AQH_MESSAGE *AQH_IpcnMessageGetDevicesRsp_new(uint16_t code, uint32_t msgId, uin
|
||||
|
||||
|
||||
|
||||
uint32_t AQH_IpcnMessageGetDevicesRsp_GetFlags(const GWEN_TAG16_LIST *tagList)
|
||||
{
|
||||
return tagList?AQH_Tag16_GetTagDataAsUint32(tagList, AQH_MSGNODE_GETDEVICES_RSP_TAGS_FLAGS, 0):0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
AQH_NODE_INFO *AQH_IpcnMessageGetDevicesRsp_ReadNodeInfo(const GWEN_TAG16_LIST *tagList)
|
||||
{
|
||||
if (tagList) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <gwenhywfar/buffer.h>
|
||||
|
||||
|
||||
#define AQH_MSGNODE_GETDEVICES_RSP_FLAGS_LASTMSG 0x01
|
||||
|
||||
#define AQH_MSGNODE_GETDEVICES_RSP_TAGS_FLAGS 0x01
|
||||
#define AQH_MSGNODE_GETDEVICES_RSP_TAGS_NODEINFO 0xc2
|
||||
@@ -28,6 +29,7 @@
|
||||
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcnMessageGetDevicesRsp_new(uint16_t code, uint32_t msgId, uint32_t refMsgId,
|
||||
uint32_t flags, const AQH_NODE_INFO *ni);
|
||||
AQHOME_API uint32_t AQH_IpcnMessageGetDevicesRsp_GetFlags(const GWEN_TAG16_LIST *tagList);
|
||||
AQHOME_API AQH_NODE_INFO *AQH_IpcnMessageGetDevicesRsp_ReadNodeInfo(const GWEN_TAG16_LIST *tagList);
|
||||
|
||||
AQHOME_API void AQH_IpcnMessageGetDevicesRsp_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList,
|
||||
|
||||
77
aqhome/msg/ipc/nodes/m_ipcn_setaccmsggrps.c
Normal file
77
aqhome/msg/ipc/nodes/m_ipcn_setaccmsggrps.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/****************************************************************************
|
||||
* This file is part of the project AqHome.
|
||||
* AqHome (c) by 2025 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.
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "aqhome/msg/ipc/nodes/m_ipcn_setaccmsggrps.h"
|
||||
#include "aqhome/msg/ipc/nodes/m_ipcn.h"
|
||||
#include "aqhome/msg/ipc/m_ipc_tag16.h"
|
||||
#include "aqhome/msg/ipc/m_ipc.h"
|
||||
|
||||
#include <gwenhywfar/text.h>
|
||||
#include <gwenhywfar/tag16.h>
|
||||
#include <gwenhywfar/buffer.h>
|
||||
#include <gwenhywfar/debug.h>
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* forward declarations
|
||||
* ------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
* implementation
|
||||
* ------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
AQH_MESSAGE *AQH_IpcnMessageSetAcceptedMsgGroups_new(uint16_t code, uint32_t msgId, uint32_t refMsgId, uint32_t grps)
|
||||
{
|
||||
AQH_MESSAGE *msg;
|
||||
GWEN_BUFFER *buf;
|
||||
|
||||
buf=GWEN_Buffer_new(0, 256, 0, 1);
|
||||
|
||||
GWEN_Tag16_WriteUint32TagToBuffer(AQH_MSGNODES_SETACCMSGGRPS_TAGS_GROUPS, grps, buf);
|
||||
|
||||
msg=AQH_IpcMessage_new(AQH_IPC_PROTOCOL_NODES_ID, AQH_IPC_PROTOCOL_NODES_VERSION, code, msgId, refMsgId,
|
||||
GWEN_Buffer_GetUsedBytes(buf), (const uint8_t*) GWEN_Buffer_GetStart(buf));
|
||||
GWEN_Buffer_free(buf);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint32_t AQH_IpcnMessageSetAcceptedMsgGroups_GetGroups(const GWEN_TAG16_LIST *tagList)
|
||||
{
|
||||
return tagList?AQH_Tag16_GetTagDataAsUint32(tagList, AQH_MSGNODES_SETACCMSGGRPS_TAGS_GROUPS, 0):0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AQH_IpcnMessageSetAcceptedMsgGroups_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList,
|
||||
GWEN_BUFFER *dbuf, const char *sText)
|
||||
{
|
||||
GWEN_Buffer_AppendArgs(dbuf,
|
||||
"SET_ACCEPTED_MSG_GROUPS(%s) %s (code=%d, proto=%d, proto version=%d, groups=%08x)\n",
|
||||
AQH_IpcnMessage_MsgTypeToChar(AQH_IpcMessage_GetCode(msg)),
|
||||
sText?sText:"",
|
||||
AQH_IpcMessage_GetCode(msg),
|
||||
AQH_IpcMessage_GetProtoId(msg),
|
||||
AQH_IpcMessage_GetProtoVersion(msg),
|
||||
AQH_IpcnMessageSetAcceptedMsgGroups_GetGroups(tagList));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
42
aqhome/msg/ipc/nodes/m_ipcn_setaccmsggrps.h
Normal file
42
aqhome/msg/ipc/nodes/m_ipcn_setaccmsggrps.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/****************************************************************************
|
||||
* This file is part of the project AqHome.
|
||||
* AqHome (c) by 2025 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_MSGNODES_SETACCMSGGRPS_H
|
||||
#define AQH_MSGNODES_SETACCMSGGRPS_H
|
||||
|
||||
|
||||
|
||||
#include <aqhome/api.h>
|
||||
#include <aqhome/ipc2/message.h>
|
||||
#include <aqhome/data/value.h>
|
||||
|
||||
#include <gwenhywfar/tag16.h>
|
||||
#include <gwenhywfar/buffer.h>
|
||||
|
||||
|
||||
|
||||
#define AQH_MSGNODES_SETACCMSGGRPS_TAGS_GROUPS 0x0001
|
||||
|
||||
|
||||
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcnMessageSetAcceptedMsgGroups_new(uint16_t code, uint32_t msgId, uint32_t refMsgId, uint32_t grps);
|
||||
|
||||
AQHOME_API void AQH_IpcdMessageSetAcceptedMsgGroups_DumpToBuffer(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList,
|
||||
GWEN_BUFFER *dbuf, const char *sText);
|
||||
|
||||
uint32_t AQH_IpcnMessageSetAcceptedMsgGroups_GetGroups(const GWEN_TAG16_LIST *tagList);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user