openFrameworksArduino
ofTypes.h
1 #pragma once
2 
3 #include "ofConstants.h"
4 
5 #if (_MSC_VER)
6 #include <memory>
7 #else
8 #include <tr1/memory>
9 // import smart pointers utils into std
10 namespace std {
11 #if __cplusplus<201103L
12  //using std::tr1::shared_ptr;
13  //using std::tr1::weak_ptr;
14  //using std::tr1::enable_shared_from_this;
15 #endif
16  using std::tr1::static_pointer_cast;
17  using std::tr1::dynamic_pointer_cast;
18  using std::tr1::const_pointer_cast;
19  using std::tr1::__dynamic_cast_tag;
20 }
21 #endif
22 
23 //----------------------------------------------------------
24 // ofDeviceInfo
25 //----------------------------------------------------------
26 class ofSerial;
27 class ARDUINO_PORT ofSerialDeviceInfo{
28  friend class ofSerial;
29 
30  public:
31 
32  ofSerialDeviceInfo(std::string devicePathIn, std::string deviceNameIn, int deviceIDIn){
33  devicePath = devicePathIn;
34  deviceName = deviceNameIn;
35  deviceID = deviceIDIn;
36  }
37 
39  deviceName = "device undefined";
40  deviceID = -1;
41  }
42 
43  std::string getDevicePath(){
44  return devicePath;
45  }
46 
47  std::string getDeviceName(){
48  return deviceName;
49  }
50 
51  int getDeviceID(){
52  return deviceID;
53  }
54 
55  protected:
56  std::string devicePath; //eg: /dev/tty.cu/usbdevice-a440
57  std::string deviceName; //eg: usbdevice-a440 / COM4
58  int deviceID; //eg: 0,1,2,3 etc
59 
60  //TODO: other stuff for serial ?
61 };
62 
63 
Definition: ofTypes.h:27
Definition: ofSerial.h:27