aqhome: finished transformation of aqhome-data and aqhome-tool.
This commit is contained in:
@@ -333,6 +333,33 @@ void AQH_Endpoint_SetState(AQH_OBJECT *o, int i)
|
||||
|
||||
|
||||
|
||||
uint32_t AQH_Endpoint_GetAcceptedMsgGroups(const AQH_OBJECT *o)
|
||||
{
|
||||
if (o) {
|
||||
AQH_ENDPOINT *xo;
|
||||
|
||||
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQH_ENDPOINT, o);
|
||||
if (xo)
|
||||
return xo->acceptedMsgGroups;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AQH_Endpoint_SetAcceptedMsgGroups(AQH_OBJECT *o, uint32_t i)
|
||||
{
|
||||
if (o) {
|
||||
AQH_ENDPOINT *xo;
|
||||
|
||||
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQH_ENDPOINT, o);
|
||||
if (xo)
|
||||
xo->acceptedMsgGroups=i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
AQH_MESSAGE_LIST *AQH_Endpoint_GetMsgOutList(const AQH_OBJECT *o)
|
||||
{
|
||||
if (o) {
|
||||
|
||||
@@ -56,6 +56,9 @@ AQHOME_API void AQH_Endpoint_SubFlags(AQH_OBJECT *o, uint32_t i);
|
||||
AQHOME_API int AQH_Endpoint_GetState(const AQH_OBJECT *o);
|
||||
AQHOME_API void AQH_Endpoint_SetState(AQH_OBJECT *o, int i);
|
||||
|
||||
AQHOME_API uint32_t AQH_Endpoint_GetAcceptedMsgGroups(const AQH_OBJECT *o);
|
||||
AQHOME_API void AQH_Endpoint_SetAcceptedMsgGroups(AQH_OBJECT *o, uint32_t i);
|
||||
|
||||
AQHOME_API AQH_MESSAGE_LIST *AQH_Endpoint_GetMsgOutList(const AQH_OBJECT *o);
|
||||
AQHOME_API AQH_MESSAGE *AQH_Endpoint_GetNextMsgOut(AQH_OBJECT *o);
|
||||
AQHOME_API void AQH_Endpoint_AddMsgOut(AQH_OBJECT *o, AQH_MESSAGE *msg);
|
||||
|
||||
@@ -27,6 +27,8 @@ struct AQH_ENDPOINT {
|
||||
uint32_t flags;
|
||||
char *serviceName;
|
||||
char *userName;
|
||||
|
||||
uint32_t acceptedMsgGroups;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,34 +14,15 @@
|
||||
#include "aqhome/msg/ipc/m_ipc.h"
|
||||
#include "aqhome/msg/ipc/m_ipc_result.h"
|
||||
#include "aqhome/msg/ipc/m_ipc_tag16.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_connect.h"
|
||||
#include "aqhome/msg/ipc/m_ipc_connect.h"
|
||||
|
||||
#include <gwenhywfar/debug.h>
|
||||
|
||||
|
||||
|
||||
int AQH_IpcEndpoint_ExchangeConnectMsg(AQH_OBJECT *ipcEndpoint,
|
||||
uint16_t connectMsgCode,
|
||||
uint16_t resultMsgCode,
|
||||
const char *clientId,
|
||||
const char *userId,
|
||||
const char *passw,
|
||||
uint32_t flags,
|
||||
int timeoutInSeconds)
|
||||
{
|
||||
AQH_MESSAGE *msgOut;
|
||||
uint32_t msgId;
|
||||
|
||||
msgId=AQH_Endpoint_GetNextMessageId(ipcEndpoint);
|
||||
msgOut=AQH_IpcdMessageConnect_new(connectMsgCode, msgId, 0, clientId, userId, passw, flags);
|
||||
AQH_Endpoint_AddMsgOut(ipcEndpoint, msgOut);
|
||||
|
||||
return AQH_IpcEndpoint_WaitForResultMsg(ipcEndpoint, resultMsgCode, msgId, timeoutInSeconds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int AQH_IpcEndpoint_WaitForResultMsg(AQH_OBJECT *ipcEndpoint, uint16_t resultMsgCode, uint32_t refMsgId, int timeoutInSeconds)
|
||||
int AQH_IpcEndpoint_WaitForResultMsg(AQH_OBJECT *ipcEndpoint,
|
||||
uint8_t protoId, uint8_t protoVer, uint16_t resultMsgCode,
|
||||
uint32_t refMsgId, int timeoutInSeconds)
|
||||
{
|
||||
for (;;) {
|
||||
AQH_MESSAGE *msgIn;
|
||||
@@ -55,7 +36,9 @@ int AQH_IpcEndpoint_WaitForResultMsg(AQH_OBJECT *ipcEndpoint, uint16_t resultMsg
|
||||
int code;
|
||||
|
||||
code=AQH_IpcMessage_GetCode(msgIn);
|
||||
if (code==resultMsgCode) {
|
||||
if (AQH_IpcMessage_GetProtoId(msgIn)==protoId &&
|
||||
AQH_IpcMessage_GetProtoVersion(msgIn)==protoVer &&
|
||||
code==resultMsgCode) {
|
||||
int result;
|
||||
|
||||
result=AQH_IpcMessageResult_GetResult(tagList);
|
||||
|
||||
@@ -14,18 +14,12 @@
|
||||
|
||||
|
||||
|
||||
AQHOME_API int AQH_IpcEndpoint_ExchangeConnectMsg(AQH_OBJECT *ipcEndpoint,
|
||||
uint16_t connectMsgCode,
|
||||
uint16_t resultMsgCode,
|
||||
const char *clientId,
|
||||
const char *userId,
|
||||
const char *passw,
|
||||
uint32_t flags,
|
||||
int timeoutInSeconds);
|
||||
AQHOME_API int AQH_IpcEndpoint_WaitForResultMsg(AQH_OBJECT *ipcEndpoint, uint16_t resultMsgCode, uint32_t refMsgId, int timeoutInSeconds);
|
||||
AQHOME_API int AQH_IpcEndpoint_WaitForResultMsg(AQH_OBJECT *ipcEndpoint,
|
||||
uint8_t protoId, uint8_t protoVer, uint16_t resultMsgCode,
|
||||
uint32_t refMsgId, int timeoutInSeconds);
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcEndpoint_WaitForResponseMsg(AQH_OBJECT *ipcEndpoint, uint32_t refMsgId, int timeoutInSeconds);
|
||||
AQHOME_API void AQH_IpcEndpoint_SendResponseResultToEndpoint(AQH_OBJECT *ep,
|
||||
uint8_t protoId, uint8_t protoVer,uint16_t code,
|
||||
uint8_t protoId, uint8_t protoVer, uint16_t code,
|
||||
uint32_t refMsgId, int result);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user