GetActionAcknowledgeInfo
Top  Previous  Next

Description

Returns the array containing IP addresses of devices that acknowledged the Action Command.


Syntax


[VB]
Value=objActiveGige.GetActionAcknowledgeInfo


[C/C++]
HRESULT GetActionAcknowledgeInfo ( VARIANT* pIP );


Data Types
[VB]

Return value: Variant (Array of Long values)


Parameters
[C/C++]

pIP [out,retval]  
Pointer to the SAFEARRAY (unsigned long) containing the IP addresses of devices having acknowledged the Action command.  
 
 
Return Values

S_OK  
Success  
E_FAIL  
Failure.  


Example


This MFC code fragment send the action command to the network and retrieves the IP addresses of devices that acknowledged the action command:

#include
 <Winsock2.h>
#include
 <sstream>

m_ActiveGige->SendActionCommand(0, 0, 1, 3, 0);

VARIANT ipList = m_ActiveGige->GetActionAcknowledgeInfo();

long
 nElementCount=0;
char
 *SafeArray;
unsigned
 long* pBuffer = new unsigned long[nElementCount];

SafeArrayGetUBound(ipList.parray,1,&nElementCount);  
SafeArrayAccessData (ipList.parray, (void
**)&SafeArray);
memcpy(pBuffer,SafeArray, nElementCount * sizeof
(int));
SafeArrayUnaccessData (ipList.parray);
stringstream ss;
for
 (int i=0; i<nElementCount; i++)
{
   in_addr ip; ip.S_un.S_addr = pBuffer[i];
   ss << inet_ntoa(ip) << "\n"
;
}
 

Remarks


When device asserts the action command, it typically sends an acknowledge response back to the application. This method allows you to check the amount of devices that acknowledged the action command and retreive their IP addresses. For more information refer to SendActionCommand.