OceanDirect  2.4.0
OceanDirect C++/C API
NetworkConfigurationAPI.h
1 /*****************************************************
2  * @file NetworkConfigurationAPI.h
3  * @date May 2022
4  * @author Ocean Insight, Inc.
5  *
6  * This is an interface to OceanDirect that allows
7  * the user to read and write user strin to device.
8  * This is intended as a usable and extensible API.
9  */
10  /************************************************************************
11  *
12  * OCEAN INSIGHT CONFIDENTIAL
13  * __________________
14  *
15  * [2018] - [2022] Ocean Insight Incorporated
16  * All Rights Reserved.
17  *
18  * NOTICE: All information contained herein is, and remains
19  * the property of Ocean Insight Incorporated and its suppliers,
20  * if any. The intellectual and technical concepts contained
21  * herein are proprietary to Ocean Insight Incorporated
22  * and its suppliers and may be covered by U.S. and Foreign Patents,
23  * patents in process, and are protected by trade secret or copyright law.
24  * Dissemination of this information or reproduction of this material
25  * is strictly forbidden unless prior written permission is obtained
26  * from Ocean Insight Incorporated.
27  *
28  **************************************************************************/
29 
30 #ifndef NETWORK_CONFIGURATION_API_H
31 #define NETWORK_CONFIGURATION_API_H
32 
33 #include "api/DllDecl.h"
34 
41 namespace oceandirect {
42  namespace api {
43 
44  class DLL_DECL NetworkConfigurationAPI {
45  public:
46  NetworkConfigurationAPI() = default;
47  virtual ~NetworkConfigurationAPI() = default;
48  static NetworkConfigurationAPI*getInstance();
49 
50  static void shutdown();
51 
52  //Legacy Commands
65  std::uint32_t getNetworkInterfaceCount(long deviceID, int* errorCode);
66 
80  std::uint32_t getNetworkInterfaceType(long deviceID, int* errorCode, std::uint32_t interfaceIndex);
81 
95  bool getNetworkInterfaceStatus(long deviceID, int* errorCode, std::uint32_t interfaceIndex);
96 
110  void setNetworkInterfaceStatus(long deviceID, int* errorCode, std::uint32_t interfaceIndex, bool enable);
111 
125  bool getMulticastGroupEnabled(long deviceID, int* errorCode, std::uint32_t interfaceIndex);
126 
140  void setMulticastGroupEnabled(long deviceID, int* errorCode, std::uint32_t interfaceIndex, bool enabled);
141 
142 
155  void saveNetworkInterfaceSetting(long deviceID, int* errorCode, std::uint32_t interfaceIndex);
156 
157 
158  //OBP2 Commands
159  bool getIPAddressAssignedMode(long deviceID, int* errorCode);
160 
161  void setIPAddressAssignedMode(long deviceID, int* errorCode, bool useStaticIP);
162 
163 
183  void getNetworkConfiguration(long deviceID, int* errorCode, bool& outManualAssignment,
184  std::uint8_t* outIpv4Address, std::uint32_t ipv4AddressSize,
185  std::uint8_t* outSubnetMask, std::uint32_t subnetMaskSize,
186  std::uint8_t* outDefaultGateway, std::uint32_t defaultGatewaySize,
187  std::uint8_t* outDNSServer, std::uint32_t dnsServerSize);
188 
207  void setManualNetworkConfiguration(long deviceID, int* errorCode,
208  const std::uint8_t* ipv4Address, std::uint32_t ipv4AddressSize,
209  const std::uint8_t* subnetMask, std::uint32_t subnetMaskSize,
210  const std::uint8_t* defaultGateway, std::uint32_t defaultGatewaySize,
211  const std::uint8_t* dnsServer, std::uint32_t dnsServerSize);
212 
231  void getManualNetworkConfiguration(long deviceID, int* errorCode,
232  std::uint8_t* outIpv4Address, std::uint32_t ipv4AddressSize,
233  std::uint8_t* outSubnetMask, std::uint32_t subnetMaskSize,
234  std::uint8_t* outDefaultGateway, std::uint32_t defaultGatewaySize,
235  std::uint8_t* outDNSServer, std::uint32_t dnsServerSize);
236 
237 
250  bool getEthernetAddOnAvailable(long deviceID, int* errorCode);
251 
264  void getEthernetMACAddress(long deviceID, int* errorCode, std::uint8_t* outMACAddress, std::uint32_t outMACAddressSize);
265 
279  void setEthernetMACAddress(long deviceID, int* errorCode, const std::uint8_t* macAddress, std::uint32_t macAddressSize);
280 
292  bool getEthernetLoopBackTest(long deviceID, int* errorCode);
293 
294  private:
295  static NetworkConfigurationAPI *instance;
296  };
297  }
298 }
299 #endif /* NETWORK_CONFIGURATION_API_H */
Definition: NetworkConfigurationAPI.h:44
std::uint32_t getNetworkInterfaceType(long deviceID, int *errorCode, std::uint32_t interfaceIndex)
void setEthernetMACAddress(long deviceID, int *errorCode, const std::uint8_t *macAddress, std::uint32_t macAddressSize)
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 setNetworkInterfaceStatus(long deviceID, int *errorCode, std::uint32_t interfaceIndex, bool enable)
bool getMulticastGroupEnabled(long deviceID, int *errorCode, std::uint32_t interfaceIndex)
bool getNetworkInterfaceStatus(long deviceID, int *errorCode, std::uint32_t interfaceIndex)
bool getEthernetAddOnAvailable(long deviceID, int *errorCode)
std::uint32_t getNetworkInterfaceCount(long deviceID, int *errorCode)
void saveNetworkInterfaceSetting(long deviceID, int *errorCode, std::uint32_t interfaceIndex)
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)
void getEthernetMACAddress(long deviceID, int *errorCode, std::uint8_t *outMACAddress, std::uint32_t outMACAddressSize)
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)
void setMulticastGroupEnabled(long deviceID, int *errorCode, std::uint32_t interfaceIndex, bool enabled)
bool getEthernetLoopBackTest(long deviceID, int *errorCode)
This is an interface to OceanDirect that allows the user to connect to devices over USB and other bus...
Definition: OceanDirectAPI.h:144