Serveur OPCUA générique
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Macros
hardware_serial.h
Aller à la documentation de ce fichier.
1 /******************************************************************************
2 
3  ******************************************************************************/
4 #ifndef __HARDWARE_SERIAL_H__
5 #define __HARDWARE_SERIAL_H__
6 
7 #include "nodemanagerroot.h"
8 
9 #include "uabase.h"
10 #include "uastring.h"
11 #include "statuscode.h"
12 #include "uaarraytemplates.h"
13 #include "uathread.h"
14 #include "nodemanagerbase.h"
15 #include "string"
16 
17 #include <termios.h>
18 #include <iostream>
19 #include <fstream>
20 #include <fcntl.h>
21 #include "serial.h"
22 
23 #define LG_BUFFER 1024
24 
25 class Serial;
26 
27 namespace CTA_UA {
28 class NodeManagerCTA;
29 class ControllerObject;
30 }
31 
32 namespace CTA_Hardware {
33 class HardWareInterface;
34 }
35 
36 class PluginsLoader;
37 class DataSenderReceiver;
38 namespace CTA_Slc {
39 class NodeManagerSlc;
40 }
41 
42 namespace CTA_Slc_Dict {
43 class SimpleDevice;
44 }
45 namespace CTA_Hardware {
46 
48 public:
49  HardWare_Serial(std::string full, const char *acm, speed_t vitesse,
50  DataSenderReceiver *my_plugins, int manageInterface);
52  int open();
53  int close();
54  int init(std::string name);
55 
56  void write(std::string cmd);
57  int set(std::string ip, int port, std::vector<Byte> value);
58  int set(std::string value, std::vector<short int> res) {
59  return 0;
60  }
61  ;
62  int set(std::string value, std::vector<int> res) {
63  return 0;
64  }
65  ;
66  int set(std::string value, std::vector<long> res) {
67  return 0;
68  }
69  ;
70  int set(std::string value, std::vector<float> res) {
71  return 0;
72  }
73  ;
74  int get(std::string command, std::vector<Byte> *res) {return 0;};
75  int get(std::string command, std::vector<short int> *res){return 0;};
76  int get(std::string command, std::vector<int> *res){return 0;};
77  int get(std::string command, std::vector<long> *res){return 0;};
78  int get(std::string command, std::vector<float> *res){return 0;};
79 
80  int set(std::string value);
81  int set(std::string value, std::vector<Byte> res) {
82  return 0;
83  }
84  ;
85  int cmd(std::string value, std::string *retValue) {
86  return 0;
87  }
88  ;
89  int get(std::string command, std::string *result);
90 
91 public:
92  OpcUa_Int value;
98 
99  std::string m_address;
100  std::string m_deviceSerial;
102  int m_nbBit;
104  std::string m_parity;
105  std::string m_pullPush;
106  std::string m_name;
108  std::string m_data_Type;
109  std::string m_headerId;
114 
115  std::string m_id1;
116  std::string m_id2;
117 
118  char recvBuffer[8192];
121  std::string m_full;
122 
123  int nb_read;
124  unsigned char buffer[LG_BUFFER];
125  struct termios tio;
126  int tty_fd;
128 };
129 }
130 #endif