aqhome: finished transformation of aqhome-data and aqhome-tool.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user