GetIpAddress
Top  Previous  Next

Description

Returns the current IP configuration of the virtual camera device.

[C++]
int
 GetIpAddress(char ip[16], char mask[16], char gateway[16]);


Parameters
[C/C++]
 
[out] char ip[16]  
Pointer to a buffer that receives the string value of the ip address of the camera in the IPv4 format (four decimals in the range of 0-255 separated by dots).  
 
[out] const mask[16]  
Pointer to a buffer that receives the string value of the subnet mask in the IPv4 format.  
 
[out] const gateway[16]  
Pointer to a buffer that receives the string value of the gateway in the IPv4 format.  
 

Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_INVALIDARG  
Wrong IPv4 format  
 
 
Example
 
This fragment of code retrieves the current IP configuration of the virtual camera:

char ip[16], mask[16], gateway[16];  
      m_pCamera->GetIpAddress (ip, mask, gateway);


Remarks


Typically the IP configuration of a virtual camera device coincides with the IP configuration of the network adapter it is connected to. There are two cases though when the camera's IP address can differ from the NIC's IP: 1) if an external client application modified the camera's IP address through the Force IP protocol; 2) if the camera's IP address is set by the SetIpAddress method.

To obtain the IP address of the network adapter (as opposed to the camera's IP), use GetInterfaceAtIndex.