OceanDirectLighthouseC++  3.1.1
OceanDirect Lighthouse C++/C API
oceandirect::api::Ipv4AddressAPI Class Reference

Public Member Functions

virtual void addStaticIpAddress (long deviceID, int *errorCode, unsigned char ifNum, unsigned char *ipAddress, int ipAddressLength, unsigned int netmask)
 
virtual void deleteStaticIpAddress (long deviceID, int *errorCode, unsigned char ifNum, unsigned char addressIndex)
 
virtual void getDefaultGatewayIpAddress (long deviceID, int *errorCode, unsigned char ifNum, unsigned char *outIpAddress, int ipAddressLength)
 
virtual int getNumberOfIpAddresses (long deviceID, int *errorCode, unsigned char ifNum)
 
virtual bool isDHCPEnabled (long deviceID, int *errorCode, unsigned char ifNum)
 
virtual void readIpAddress (long deviceID, int *errorCode, unsigned char ifNum, unsigned char addressIndex, unsigned char *ipAddress, int ipAddressLength, unsigned int *netmask)
 
virtual void setDefaultGatewayIpAddress (long deviceID, int *errorCode, unsigned char ifNum, unsigned char *ipAddress, int ipAddressLength)
 
virtual void setDHCPEnable (long deviceID, int *errorCode, unsigned char ifNum, unsigned char enabled)
 

Static Public Member Functions

static Ipv4AddressAPIgetInstance ()
 
static void shutdown ()
 

Static Protected Attributes

static Ipv4AddressAPIinstance
 

Member Function Documentation

◆ addStaticIpAddress()

virtual void oceandirect::api::Ipv4AddressAPI::addStaticIpAddress ( long  deviceID,
int *  errorCode,
unsigned char  ifNum,
unsigned char *  ipAddress,
int  ipAddressLength,
unsigned int  netmask 
)
virtual

Add a static IP address to the specified interface. The IP address is specified as 4 bytes in an array. The leading part of the IP address must contain the first element of the array, followed by the remaining parts in order to the last part of the IP address in the fourth element of the array.

See also
deleteStaticIpAddress()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1 or the ipAddress array size is less than 4.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
ipAddressthe static IP address to be added.
netmaskthe netmask specifying the subnet of the network the device is on.

◆ deleteStaticIpAddress()

virtual void oceandirect::api::Ipv4AddressAPI::deleteStaticIpAddress ( long  deviceID,
int *  errorCode,
unsigned char  ifNum,
unsigned char  addressIndex 
)
virtual

Delete a static IP address on the specified interface.

See also
addStaticIpAddress()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
addressIndexthe index of the address to be deleted.

◆ getDefaultGatewayIpAddress()

virtual void oceandirect::api::Ipv4AddressAPI::getDefaultGatewayIpAddress ( long  deviceID,
int *  errorCode,
unsigned char  ifNum,
unsigned char *  outIpAddress,
int  ipAddressLength 
)
virtual

Get the gateway ip address for the device on the specified interface.

See also
setDefaultGatewayIpAddress()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1 or the ipAddress array size is less than 4.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
outIpAddressthe output buffer for gateway IP address.
ipAddressLengththe output buffer length.

◆ getNumberOfIpAddresses()

virtual int oceandirect::api::Ipv4AddressAPI::getNumberOfIpAddresses ( long  deviceID,
int *  errorCode,
unsigned char  ifNum 
)
virtual

Get the number of IP addresses available on the specified interface. If DHCP is enabled on the specified interface then index 0 represents the DHCP address and the following addresses will be any static IP addresses.

Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
Returns
the number of IP addresses on the specified interface.

◆ isDHCPEnabled()

virtual bool oceandirect::api::Ipv4AddressAPI::isDHCPEnabled ( long  deviceID,
int *  errorCode,
unsigned char  ifNum 
)
virtual

Check to see if DHCP (client) is enabled on the specified interface. If DHCP is enabled then the device will be able to receive and IP address from a DHCP server in the network it is connected to.

See also
setDHCPEnable()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
Returns
true if DHCP is enabled on the specified interface, false otherwise.

◆ readIpAddress()

virtual void oceandirect::api::Ipv4AddressAPI::readIpAddress ( long  deviceID,
int *  errorCode,
unsigned char  ifNum,
unsigned char  addressIndex,
unsigned char *  ipAddress,
int  ipAddressLength,
unsigned int *  netmask 
)
virtual

Retrieve the IP address and netmask on the specified interface. If DHCP is enabled on the specified interface then index 0 represents the DHCP address and the following addresses will be any static IP addresses. The IP address is returned as 4 bytes into a user supplied array. The leading part of the IP address will be in the first element of the array, followed by the remaining parts in order to the last part of the IP address in the fourth element of the array.

See also
getNumberOfIpAddresses()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1 or the ipAddress array size is less than 4.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
addressIndexthe index of the address to be retrieved.
ipAddressa pointer to the array that will receive the IP address.
ipAddressLengththe size of the array ipAddress.
netmaska pointer to the netmask specifying the subnet of the network the device is on.

◆ setDefaultGatewayIpAddress()

virtual void oceandirect::api::Ipv4AddressAPI::setDefaultGatewayIpAddress ( long  deviceID,
int *  errorCode,
unsigned char  ifNum,
unsigned char *  ipAddress,
int  ipAddressLength 
)
virtual

Set the gateway ip address for the device on the specified interface.

See also
getDefaultGatewayIpAddress()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1 or the ipAddress array size is less than 4.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
ipAddressthe gateway IP address.
ipAddressLengththe gateway IP address length.

◆ setDHCPEnable()

virtual void oceandirect::api::Ipv4AddressAPI::setDHCPEnable ( long  deviceID,
int *  errorCode,
unsigned char  ifNum,
unsigned char  enabled 
)
virtual

Turn the DHCP client on or off for the device on the specified interface.

See also
isDHCPEnabled()
Parameters
deviceIDthe ID of the device returned by getDeviceIDs.
errorCodea code indicating the result of the operation: ERROR_SUCCESS on success; ERROR_NO_DEVICE if the device does not exist; ERROR_FEATURE_NOT_FOUND the feature is not enabled on the specified device; ERROR_TRANSFER_ERROR the device protocol for the feature could not be found; ERROR_CODE_INVALID_ARGUMENT the interface number is not 0 or 1.
ifNumthe interface number: 0 for Ethernet, 1 for wi-fi.
enableda value of 0 turns the DHCP client off, a value greater than 0 turns the DHCP client on.

The documentation for this class was generated from the following file: