OceanDirect  1.31.0
OceanDirect C++/C API
RawBusAPI.h
1 /*****************************************************
2  * @file RawBusAPI.h
3  * @date January 2020
4  * @author Ocean Insight, Inc.
5  *
6  * This is an interface to OceanDirect that allows
7  * the user to connect to devices over USB and other buses.
8  * This is intended as a usable and extensible API.
9  *
10  * LICENSE:
11  *
12  * OceanDirect Copyright (C) 2020, Ocean Insight Inc
13  *
14  *******************************************************/
15 
16 #ifndef RAWBUSAPI_H
17 #define RAWBUSAPI_H
18 
19 #include "api/DllDecl.h"
20 #include <string>
27 namespace oceandirect {
28  namespace api {
29 
30  class DLL_DECL RawBusAPI {
31  public:
32  RawBusAPI();
33  virtual ~RawBusAPI();
34  static RawBusAPI *getInstance();
35 
36  static void shutdown();
37 
52  int accessUsbRead(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint);
53 
68  int accessUsbWrite(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint);
69 
83  int accessEthRead(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength);
84 
98  int accessEthWrite(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength);
99 
100  std::string getStringDescriptor(long deviceID, int *errorCode, int index);
101 
102  private:
103  static RawBusAPI *instance;
104  };
105  }
106 }
107 #endif /* RAWBUSAPI_H */
Definition: RawBusAPI.h:30
int accessEthWrite(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength)
int accessUsbWrite(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint)
int accessUsbRead(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength, unsigned char endpoint)
int accessEthRead(long deviceID, int *errorCode, unsigned char *buffer, unsigned int bufferLength)
This is an interface to OceanDirect that allows the user to connect to devices over USB and other bus...
Definition: DeviceFactory.h:38