Berkeley Nuclear Data Software
RS232Interface.h
Go to the documentation of this file.
1 #ifndef _RS232_INTERFACE_
2 #define _RS232_INTERFACE_
3 //project
4 #include "rs232.h"
5 
6 
7 //c++
8 #include <string>
9 namespace NSDInstControl
10 {
13 {
14 public:
16  void setPortNumber(int a_portNumber);
17  void setBaudRate(int a_baudrate);
18  int openComPort();
19  int closePort();
20  int write(std::string& a_string);
21  int read(std::string& a_response);
22  int writeRead(std::string a_cmd,
23  std::string& a_response,
24  bool a_print = false,
25  int a_delay =200000
26  );
28 private:
29  int m_portNum;
30  int m_baudRate;
31 
32  bool m_isOpen;
33 };//end class
34 
35 }
36 #endif
used as a c++ abstraction of the rs232 c functions in the RS232 folder
Definition: RS232Interface.h:13
RS232Interface()
Definition: RS232Interface.cpp:8
void setBaudRate(int a_baudrate)
Definition: RS232Interface.cpp:88
int read(std::string &a_response)
Definition: RS232Interface.cpp:54
void setPortNumber(int a_portNumber)
Definition: RS232Interface.cpp:75
int openComPort()
Definition: RS232Interface.cpp:18
int writeRead(std::string a_cmd, std::string &a_response, bool a_print=false, int a_delay=200000)
Definition: RS232Interface.cpp:111
int closePort()
Definition: RS232Interface.cpp:100
int write(std::string &a_string)
Definition: RS232Interface.cpp:32
~RS232Interface()
Definition: RS232Interface.cpp:133
CONF:HVMICC? is required before switching high voltage on.
Definition: bk9174BControl.h:9