You don't need command 0x0097 to read information from agent. You should use CMD_GET_PARAMETER (0x0041) and set name of the parameter to variable VID_PARAMETER (85). Agent will reply with command CMD_REQUEST_COMPLETED (0x001D). First, check variable VID_RCC (28). If it contains 0, then value of requested parameter will be in variable VID_VALUE (21). For example:
CSCPMessage msg;
msg.SetCode(CMD_GET_PARAMETER);
msg.SetId(requestId);
msg.SetVariable(VID_PARAMETER, "Agent.Version");
<send message and get response into CSCPMessage *response>
DWORD rcc = response->GetVariableLong(VID_RCC);
if (rcc == ERR_SUCCESS)
{
char buffer[256];
response->GetVariableStr(VID_VALUE, buffer, 256);
// Now buffer contains value of requested parameter
}
Best regards,
Victor
CSCPMessage msg;
msg.SetCode(CMD_GET_PARAMETER);
msg.SetId(requestId);
msg.SetVariable(VID_PARAMETER, "Agent.Version");
<send message and get response into CSCPMessage *response>
DWORD rcc = response->GetVariableLong(VID_RCC);
if (rcc == ERR_SUCCESS)
{
char buffer[256];
response->GetVariableStr(VID_VALUE, buffer, 256);
// Now buffer contains value of requested parameter
}
Best regards,
Victor