ESDDevice.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 SCHUNK GmbH & Co. KG
3  * Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef CESDDEVICE_H
19 #define CESDDEVICE_H
20 
21 #include "../Device/ProtocolDevice.h"
22 
23 class CESDDevice : public CProtocolDevice
24 {
25  private:
26 
27  // ---- private data ---------------------------------------------------- ;
28 
29  // ---- private auxiliary functions ------------------------------------- ;
30 
31  protected:
32 
33  // ---- protected data -------------------------------------------------- ;
34 
35 #if defined (_WIN32)
36  HANDLE m_hDevice;
37  HANDLE m_hSyncDevice;
38 #endif
39 #if defined(__LINUX__)
40 // HANDLE m_hDevice;
41 // HANDLE m_hSyncDevice;
42  int m_hDevice;
43  int m_hSyncDevice;
44 #endif
45 #if defined (__QNX__)
46  int m_hDevice;
47  int m_hSyncDevice;
48 #endif
50  unsigned long m_uiBaudRate;
51  unsigned short m_uiQueueSize;
52  unsigned long m_uiTimeOut;
53 
54  // ---- protected auxiliary functions ----------------------------------- ;
55 
56  int getDeviceError(int iErrorState);
57  int setBaudRate();
58  int setMessageId(unsigned long uiMessageId);
59  int clearReadQueue();
60  int reinit(unsigned char ucBaudRateId);
61  int readDevice(CProtocolMessage& rclProtocolMessage);
62  int writeDevice(CProtocolMessage& rclProtocolMessage);
63 
64  public:
65 
66  // ---- public data ----------------------------------------------------- ;
67 
68 
69 
70  // ---- constructors / destructor --------------------------------------- ;
71 
73  CESDDevice();
75  CESDDevice(const CESDDevice& rclESDDevice);
77  virtual ~CESDDevice();
78 
79  // ---- operators ------------------------------------------------------- ;
80 
81  // assignment operator
82  CESDDevice& operator=(const CESDDevice& rclESDDevice);
83 
84  // ---- query functions ------------------------------------------------- ;
85 
86  // ---- modify functions ------------------------------------------------ ;
87 
88  void setQueueSize(unsigned short uiQueueSize);
89  void setTimeOut(unsigned long uiTimeOut);
90 
91  // ---- I/O functions --------------------------------------------------- ;
92 
93  // ---- exec functions -------------------------------------------------- ;
94 
95  int init();
96  int init(const char* acInitString);
97  int exit();
99 };
100 
101 #endif
void setQueueSize(unsigned short uiQueueSize)
Definition: ESDDevice.cpp:458
unsigned short m_uiQueueSize
Definition: ESDDevice.h:51
int exit()
Definition: ESDDevice.cpp:672
int waitForStartMotionAll()
Definition: ESDDevice.cpp:703
int writeDevice(CProtocolMessage &rclProtocolMessage)
Definition: ESDDevice.cpp:386
int m_iDeviceId
Definition: ESDDevice.h:49
int clearReadQueue()
Definition: ESDDevice.cpp:170
void setTimeOut(unsigned long uiTimeOut)
Definition: ESDDevice.cpp:463
unsigned long m_uiBaudRate
Definition: ESDDevice.h:50
CESDDevice & operator=(const CESDDevice &rclESDDevice)
Definition: ESDDevice.cpp:440
int reinit(unsigned char ucBaudRateId)
Definition: ESDDevice.cpp:184
int setMessageId(unsigned long uiMessageId)
Definition: ESDDevice.cpp:155
int getDeviceError(int iErrorState)
Definition: ESDDevice.cpp:41
int setBaudRate()
Definition: ESDDevice.cpp:113
int init()
Definition: ESDDevice.cpp:480
virtual ~CESDDevice()
destructor
Definition: ESDDevice.cpp:429
CESDDevice()
default constructor
Definition: ESDDevice.cpp:419
unsigned long m_uiTimeOut
Definition: ESDDevice.h:52
int readDevice(CProtocolMessage &rclProtocolMessage)
Definition: ESDDevice.cpp:332


schunk_libm5api
Author(s): Florian Weisshardt
autogenerated on Mon Nov 25 2019 03:48:19