NetOceanDirect  3.1.1
OceanDirect .NET API
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
NetOceanDirect::NetworkConfiguration Class Reference

Inherits NetOceanDirect::ManagedObject< NetworkConfigurationAPI >.

Public Member Functions

 NetworkConfiguration (NetworkConfigurationAPI *instance)
 
bool getIPAddressAssignedMode (long deviceID, int% errorCode)
 
void getManualNetworkConfiguration (long deviceID, int% errorCode, array< unsigned char >^% outIpv4Address, array< unsigned char >^% outSubnetMask, array< unsigned char >^% outDefaultGateway, array< unsigned char >^% outDNSServer)
 
bool getMulticastGroupEnabled (long deviceID, int% errorCode)
 
bool getMulticastGroupEnabled (long deviceID, int% errorCode, std::uint32_t interfaceIndex)
 
void getNetworkConfiguration (long deviceID, int% errorCode, bool% outManualAssignment, array< unsigned char >^% outIpv4Address, array< unsigned char >^% outSubnetMask, array< unsigned char >^% outDefaultGateway, array< unsigned char >^% outDNSServer)
 
std::uint32_t getNetworkInterfaceCount (long deviceID, int% errorCode)
 
bool getNetworkInterfaceStatus (long deviceID, int% errorCode)
 
bool getNetworkInterfaceStatus (long deviceID, int% errorCode, std::uint32_t interfaceIndex)
 
std::uint32_t getNetworkInterfaceType (long deviceID, int% errorCode)
 
std::uint32_t getNetworkInterfaceType (long deviceID, int% errorCode, std::uint32_t interfaceIndex)
 
void saveNetworkInterfaceSetting (long deviceID, int% errorCode)
 
void saveNetworkInterfaceSetting (long deviceID, int% errorCode, std::uint32_t interfaceIndex)
 
void setIPAddressAssignedMode (long deviceID, int% errorCode, bool useDHCP)
 
void setManualNetworkConfiguration (long deviceID, int% errorCode, array< unsigned char >^% ipv4Address, array< unsigned char >^% subnetMask, array< unsigned char >^% defaultGateway, array< unsigned char >^% dnsServer)
 
void setMulticastGroupEnabled (long deviceID, int% errorCode, bool enable)
 
void setMulticastGroupEnabled (long deviceID, int% errorCode, std::uint32_t interfaceIndex, bool enable)
 
void setNetworkInterfaceStatus (long deviceID, int% errorCode, bool enable)
 
void setNetworkInterfaceStatus (long deviceID, int% errorCode, std::uint32_t interfaceIndex, bool enable)
 
- Public Member Functions inherited from NetOceanDirect::ManagedObject< NetworkConfigurationAPI >
 ManagedObject (NetworkConfigurationAPI *instance)
 
NetworkConfigurationAPI * GetInstance ()
 

Static Public Member Functions

static NetworkConfiguration getInstance ()
 

Static Protected Attributes

static NetworkConfiguration networkConfig
 

Additional Inherited Members

- Protected Attributes inherited from NetOceanDirect::ManagedObject< NetworkConfigurationAPI >
NetworkConfigurationAPI * m_Instance
 

Member Function Documentation

◆ getIPAddressAssignedMode()

bool NetworkConfiguration::getIPAddressAssignedMode ( long  deviceID,
int%  errorCode 
)

Read the IP address mode from the OBP2 device.

See also
setIPAddressAssignedMode()
Parameters
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 ip address was generated via DHCP. False if the ip address was statically assigned.

◆ getManualNetworkConfiguration()

void NetworkConfiguration::getManualNetworkConfiguration ( long  deviceID,
int%  errorCode,
array< unsigned char >^%  outIpv4Address,
array< unsigned char >^%  outSubnetMask,
array< unsigned char >^%  outDefaultGateway,
array< unsigned char >^%  outDNSServer 
)

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]The static IP address.
outSubnetMask[out]The subnet mask.
outDefaultGateway[out]The default gateway IP address.
outDNSServer[out]The DNS server IP address.

◆ getMulticastGroupEnabled()

bool NetworkConfiguration::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()

void NetworkConfiguration::getNetworkConfiguration ( long  deviceID,
int%  errorCode,
bool%  outManualAssignment,
array< unsigned char >^%  outIpv4Address,
array< unsigned char >^%  outSubnetMask,
array< unsigned char >^%  outDefaultGateway,
array< unsigned char >^%  outDNSServer 
)

Read the current 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 generated IP address otherwise it's False (static IP).
ipv4Address[out]An output argument for the static IP address.
subnetMask[out]An output argument for the subnet mask.
defaultGateway[out]An output argument for the default gateway IP address.
dnsServer[out]An output argument for the DNS server IP address.

◆ getNetworkInterfaceCount()

std::uint32_t NetworkConfiguration::getNetworkInterfaceCount ( long  deviceID,
int%  errorCode 
)

Read the number of supported communication interface.

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

◆ getNetworkInterfaceStatus()

bool NetworkConfiguration::getNetworkInterfaceStatus ( long  deviceID,
int%  errorCode,
std::uint32_t  interfaceIndex 
)

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

See also
setNetworkInterfaceStatus()
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 the interface if enabled otherwise it's False.

◆ getNetworkInterfaceType()

std::uint32_t NetworkConfiguration::getNetworkInterfaceType ( long  deviceID,
int%  errorCode,
std::uint32_t  interfaceIndex 
)

Return the interface type of the given interface index.

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

◆ saveNetworkInterfaceSetting()

void NetworkConfiguration::saveNetworkInterfaceSetting ( long  deviceID,
int%  errorCode,
std::uint32_t  interfaceIndex 
)

Save the network interface settings to the 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.
interfaceIndex[in]The interface to save to.

◆ setIPAddressAssignedMode()

void NetworkConfiguration::setIPAddressAssignedMode ( long  deviceID,
int%  errorCode,
bool  useDHCP 
)

Set the IP address mode to the OBP2 device.

See also
getIPAddressAssignedMode()
Parameters
deviceIDthe 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.
useStaticIP[in]True will use DHCP server for ip assignment. False will use statically assigned IP address.

◆ setManualNetworkConfiguration()

void NetworkConfiguration::setManualNetworkConfiguration ( long  deviceID,
int%  errorCode,
array< unsigned char >^%  ipv4Address,
array< unsigned char >^%  subnetMask,
array< unsigned char >^%  defaultGateway,
array< unsigned char >^%  dnsServer 
)

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.
subnetMask[in]The subnet mask.
defaultGateway[in]The default gateway IP address.
dnsServer[in]The DNS server IP address.

◆ setMulticastGroupEnabled()

void NetworkConfiguration::setMulticastGroupEnabled ( long  deviceID,
int%  errorCode,
std::uint32_t  interfaceIndex,
bool  enable 
)

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()

void NetworkConfiguration::setNetworkInterfaceStatus ( long  deviceID,
int%  errorCode,
std::uint32_t  interfaceIndex,
bool  enable 
)

Enable or disable the interface.

See also
getNetworkInterfaceStatus()
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 interface. False will disable it.

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