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

Public Member Functions

virtual bool getEthernetAddOnAvailable (long deviceID, int *errorCode)
 
virtual bool getEthernetLoopBackTest (long deviceID, int *errorCode)
 
virtual void getEthernetMACAddress (long deviceID, int *errorCode, std::uint8_t *outMACAddress, std::uint32_t outMACAddressSize)
 
virtual bool getIPAddressAssignedMode (long deviceID, int *errorCode)
 
virtual void getManualNetworkConfiguration (long deviceID, int *errorCode, std::uint8_t *outIpv4Address, std::uint32_t ipv4AddressSize, std::uint8_t *outSubnetMask, std::uint32_t subnetMaskSize, std::uint8_t *outDefaultGateway, std::uint32_t defaultGatewaySize, std::uint8_t *outDNSServer, std::uint32_t dnsServerSize)
 
bool getMulticastGroupEnabled (long deviceID, int *errorCode, std::uint32_t interfaceIndex)
 
virtual void getNetworkConfiguration (long deviceID, int *errorCode, bool &outManualAssignment, std::uint8_t *outIpv4Address, std::uint32_t ipv4AddressSize, std::uint8_t *outSubnetMask, std::uint32_t subnetMaskSize, std::uint8_t *outDefaultGateway, std::uint32_t defaultGatewaySize, std::uint8_t *outDNSServer, std::uint32_t dnsServerSize)
 
virtual std::uint32_t getNetworkInterfaceCount (long deviceID, int *errorCode)
 
virtual bool getNetworkInterfaceStatus (long deviceID, int *errorCode, std::uint32_t interfaceIndex)
 
virtual std::uint32_t getNetworkInterfaceType (long deviceID, int *errorCode, std::uint32_t interfaceIndex)
 
virtual void saveNetworkInterfaceSetting (long deviceID, int *errorCode, std::uint32_t interfaceIndex)
 
virtual void setEthernetMACAddress (long deviceID, int *errorCode, const std::uint8_t *macAddress, std::uint32_t macAddressSize)
 
virtual void setIPAddressAssignedMode (long deviceID, int *errorCode, bool useDHCP)
 
virtual void setManualNetworkConfiguration (long deviceID, int *errorCode, const std::uint8_t *ipv4Address, std::uint32_t ipv4AddressSize, const std::uint8_t *subnetMask, std::uint32_t subnetMaskSize, const std::uint8_t *defaultGateway, std::uint32_t defaultGatewaySize, const std::uint8_t *dnsServer, std::uint32_t dnsServerSize)
 
void setMulticastGroupEnabled (long deviceID, int *errorCode, std::uint32_t interfaceIndex, bool enabled)
 
virtual void setNetworkInterfaceStatus (long deviceID, int *errorCode, std::uint32_t interfaceIndex, bool enable)
 

Static Public Member Functions

static NetworkConfigurationAPIgetInstance ()
 
static void shutdown ()
 

Static Protected Attributes

static NetworkConfigurationAPIinstance
 

Member Function Documentation

◆ getEthernetAddOnAvailable()

virtual bool oceandirect::api::NetworkConfigurationAPI::getEthernetAddOnAvailable ( long  deviceID,
int *  errorCode 
)
virtual

Return True or False on whether an ethernet add-on package is available in the OBP2 enabled device.

Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
Returns
True if the add-on is available otherwise False.

◆ getEthernetLoopBackTest()

virtual bool oceandirect::api::NetworkConfigurationAPI::getEthernetLoopBackTest ( long  deviceID,
int *  errorCode 
)
virtual

Run a loop back and return true if it's successful.

Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
Returns
True for successful loop back testing otherwise its False.

◆ getEthernetMACAddress()

virtual void oceandirect::api::NetworkConfigurationAPI::getEthernetMACAddress ( long  deviceID,
int *  errorCode,
std::uint8_t *  outMACAddress,
std::uint32_t  outMACAddressSize 
)
virtual

Read the ethernet 6-byte mac address from an OBP2 enabled device.

See also
setEthernetMACAddress
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
outMACAddress[in]The output buffer for mac address.
outMACAddressSize[in]The output buffer size which must be at least 6 bytes long.

◆ getIPAddressAssignedMode()

virtual bool oceandirect::api::NetworkConfigurationAPI::getIPAddressAssignedMode ( long  deviceID,
int *  errorCode 
)
virtual

Read the ip address assignment mode from an OBP2 enabled device.

See also
setIPAddressAssignedMode()
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
Returns
True if it's DHCP IP address otherwise it's False (static IP).

◆ getManualNetworkConfiguration()

virtual void oceandirect::api::NetworkConfigurationAPI::getManualNetworkConfiguration ( long  deviceID,
int *  errorCode,
std::uint8_t *  outIpv4Address,
std::uint32_t  ipv4AddressSize,
std::uint8_t *  outSubnetMask,
std::uint32_t  subnetMaskSize,
std::uint8_t *  outDefaultGateway,
std::uint32_t  defaultGatewaySize,
std::uint8_t *  outDNSServer,
std::uint32_t  dnsServerSize 
)
virtual

Read the network configuration parameters (static ip address) from an OBP2 enabled device.

See also
setManualNetworkConfiguration()
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
outIpv4Address[out]Output buffer for the static IP address.
ipv4AddressSize[in]The static IP address buffer length.
outSubnetMask[out]Output buffer for the subnet mask.
subnetMaskSize[in]The subnet mask buffer length.
outDefaultGateway[out]Output buffer for the default gateway IP address.
defaultGatewaySize[in]The default gateway buffer length.
outDNSServer[out]Output buffer for the DNS server IP address.
dnsServerSize[in]The DNS server buffer length.

◆ getMulticastGroupEnabled()

bool oceandirect::api::NetworkConfigurationAPI::getMulticastGroupEnabled ( long  deviceID,
int *  errorCode,
std::uint32_t  interfaceIndex 
)

Return true if the multicast group message is enabled otherwise it's false.

See also
setMulticastGroupEnabled()
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
interfaceIndex[in]The interface to look at.
Returns
True if it's enabled otherwise it's False.

◆ getNetworkConfiguration()

virtual void oceandirect::api::NetworkConfigurationAPI::getNetworkConfiguration ( long  deviceID,
int *  errorCode,
bool &  outManualAssignment,
std::uint8_t *  outIpv4Address,
std::uint32_t  ipv4AddressSize,
std::uint8_t *  outSubnetMask,
std::uint32_t  subnetMaskSize,
std::uint8_t *  outDefaultGateway,
std::uint32_t  defaultGatewaySize,
std::uint8_t *  outDNSServer,
std::uint32_t  dnsServerSize 
)
virtual

Read the network configuration parameters from an OBP2 enabled device.

Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
outManualAssignment[out]An output argument that contains the IP Address mode. True if it's DHCP IP address otherwise it's False (static IP).
outIpv4Address[out]Output buffer for the static IP address.
ipv4AddressSize[in]The static IP address buffer size.
outSubnetMask[out]Output buffer for the subnet mask.
subnetMaskSize[in]The subnet mask buffer size.
outDefaultGateway[out]Output buffer for the default gateway IP address.
defaultGatewaySize[in]The default gateway buffer size.
outDNSServer[out]Output buffer for the DNS server IP address.
dnsServerSize[in]The DNS server buffer size.

◆ getNetworkInterfaceCount()

virtual std::uint32_t oceandirect::api::NetworkConfigurationAPI::getNetworkInterfaceCount ( long  deviceID,
int *  errorCode 
)
virtual

Read the number of supported communication interface.

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.
Returns
The number of interface.

◆ getNetworkInterfaceStatus()

virtual bool oceandirect::api::NetworkConfigurationAPI::getNetworkInterfaceStatus ( long  deviceID,
int *  errorCode,
std::uint32_t  interfaceIndex 
)
virtual

Return true if the interface is enabled otherwise it's false.

See also
setNetworkInterfaceStatus()
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.
interfaceIndexThe interface to look at.
Returns
True if the interface if enabled otherwise it's False.

◆ getNetworkInterfaceType()

virtual std::uint32_t oceandirect::api::NetworkConfigurationAPI::getNetworkInterfaceType ( long  deviceID,
int *  errorCode,
std::uint32_t  interfaceIndex 
)
virtual

Return the interface type of the given interface index.

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.
interfaceIndexThe interface to look at.
Returns
The interface type which could be one 0(Loopback), 1(wired ethernet), 2 (WIFI), and 3 (USB - CDC Ethernet).

◆ saveNetworkInterfaceSetting()

virtual void oceandirect::api::NetworkConfigurationAPI::saveNetworkInterfaceSetting ( long  deviceID,
int *  errorCode,
std::uint32_t  interfaceIndex 
)
virtual

Save the network interface settings to the device.

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.
interfaceIndexThe interface to save to.

◆ setEthernetMACAddress()

virtual void oceandirect::api::NetworkConfigurationAPI::setEthernetMACAddress ( long  deviceID,
int *  errorCode,
const std::uint8_t *  macAddress,
std::uint32_t  macAddressSize 
)
virtual

Writes a new ethernet 6-byte mac address into an OBP2 enabled device.

See also
getEthernetMACAddress
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
macAddress[in]The new mac address.
macAddress[in]The new mac address buffer size which is 6-byte long.
Returns
The mac address.

◆ setIPAddressAssignedMode()

virtual void oceandirect::api::NetworkConfigurationAPI::setIPAddressAssignedMode ( long  deviceID,
int *  errorCode,
bool  useDHCP 
)
virtual

Set the ip address assignment mode to the OBP2 enabled device.

See also
getIPAddressAssignedMode()
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
useDHCPTrue if it's DHCP IP address otherwise it's False (static IP).

◆ setManualNetworkConfiguration()

virtual void oceandirect::api::NetworkConfigurationAPI::setManualNetworkConfiguration ( long  deviceID,
int *  errorCode,
const std::uint8_t *  ipv4Address,
std::uint32_t  ipv4AddressSize,
const std::uint8_t *  subnetMask,
std::uint32_t  subnetMaskSize,
const std::uint8_t *  defaultGateway,
std::uint32_t  defaultGatewaySize,
const std::uint8_t *  dnsServer,
std::uint32_t  dnsServerSize 
)
virtual

Write the network configuration parameters (static ip address) on OBP2 enabled device.

See also
getManualNetworkConfiguration()
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
ipv4Address[in]The static IP address.
ipv4AddressSize[in]The static IP address buffer length.
subnetMask[in]The subnet mask.
subnetMaskSize[in]The subnet mask buffer length.
defaultGateway[in]The default gateway IP address.
defaultGatewaySize[in]The default gateway buffer length.
dnsServer[in]The DNS server IP address.
dnsServerSize[in]The DNS server buffer length.

◆ setMulticastGroupEnabled()

void oceandirect::api::NetworkConfigurationAPI::setMulticastGroupEnabled ( long  deviceID,
int *  errorCode,
std::uint32_t  interfaceIndex,
bool  enabled 
)

Enable or disable the multicast message group.

See also
getMulticastGroupEnabled()
Parameters
deviceID[in]the ID of the device returned by getDeviceIDs.
errorCode[out]a 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.
interfaceIndex[in]The interface to look at.
enable[in]True will enable the multicast group message. False will disable it.

◆ setNetworkInterfaceStatus()

virtual void oceandirect::api::NetworkConfigurationAPI::setNetworkInterfaceStatus ( long  deviceID,
int *  errorCode,
std::uint32_t  interfaceIndex,
bool  enable 
)
virtual

Enable or disable the interface.

See also
getNetworkInterfaceStatus()
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.
interfaceIndexThe interface to look at.
enableTrue will enable the interface. False will disable it.

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