PCanDevice.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 CPCANDEVICE_H
19 #define CPCANDEVICE_H
20 
21 #include "../Device/ProtocolDevice.h"
22 #include <libpcan/libpcan.h>
23 
25 {
26  private:
27 
28  // ---- private data ---------------------------------------------------- ;
29 
30  // ---- private auxiliary functions ------------------------------------- ;
31 
32  protected:
33 
34  // ---- protected data -------------------------------------------------- ;
35 
36  HANDLE m_handle;
37  int m_hDevice;
41  unsigned long m_uiBaudRate;
42  unsigned short m_uiQueueSize;
43  unsigned long m_uiTimeOut;
45 
46  // ---- protected auxiliary functions ----------------------------------- ;
47 
48  int getDeviceError(int iErrorState);
49  int setBaudRate();
50  int setBaudRate(unsigned char iBaudRate);
51  int setMessageId(unsigned long uiMessageId);
52  int clearReadQueue();
53  int reinit(unsigned char ucBaudRateId);
54  int readDevice(CProtocolMessage& rclProtocolMessage);
55  int writeDevice(CProtocolMessage& rclProtocolMessage);
56  char * m_DeviceName;
57 
58  public:
59 
60  // ---- public data ----------------------------------------------------- ;
61 
62 
63 
64  // ---- constructors / destructor --------------------------------------- ;
65 
67  CPCanDevice();
69  CPCanDevice(const CPCanDevice& rclPCanDevice);
71  virtual ~CPCanDevice();
72 
73  // ---- operators ------------------------------------------------------- ;
74 
75  // assignment operator
76  CPCanDevice& operator=(const CPCanDevice& rclPCanDevice);
77 
78  // ---- query functions ------------------------------------------------- ;
79 
80  // ---- modify functions ------------------------------------------------ ;
81 
82  void setQueueSize(unsigned short uiQueueSize);
83  void setTimeOut(unsigned long uiTimeOut);
84 
85  // ---- I/O functions --------------------------------------------------- ;
86 
87  // ---- exec functions -------------------------------------------------- ;
88 
89  int init();
90  int init(unsigned long baudRate);
91  int init(const char* acInitString);
92  int exit();
94 };
95 
96 #endif
CPCanDevice::m_uiQueueSize
unsigned short m_uiQueueSize
Definition: PCanDevice.h:42
CProtocolDevice
Definition: ProtocolDevice.h:29
CPCanDevice::setTimeOut
void setTimeOut(unsigned long uiTimeOut)
Definition: PCanDevice.cpp:477
CPCanDevice
Definition: PCanDevice.h:24
CPCanDevice::m_uiBaudRate
unsigned long m_uiBaudRate
Definition: PCanDevice.h:41
CPCanDevice::readDevice
int readDevice(CProtocolMessage &rclProtocolMessage)
Definition: PCanDevice.cpp:348
CPCanDevice::setBaudRate
int setBaudRate()
Definition: PCanDevice.cpp:115
CPCanDevice::m_uiTimeOut
unsigned long m_uiTimeOut
Definition: PCanDevice.h:43
CPCanDevice::~CPCanDevice
virtual ~CPCanDevice()
destructor
Definition: PCanDevice.cpp:441
CPCanDevice::reinit
int reinit(unsigned char ucBaudRateId)
Definition: PCanDevice.cpp:211
CPCanDevice::m_iNoOfRetries
int m_iNoOfRetries
Definition: PCanDevice.h:44
CPCanDevice::exit
int exit()
Definition: PCanDevice.cpp:725
CPCanDevice::m_DeviceName
char * m_DeviceName
Definition: PCanDevice.h:56
CPCanDevice::setQueueSize
void setQueueSize(unsigned short uiQueueSize)
Definition: PCanDevice.cpp:472
CPCanDevice::m_iDeviceId
int m_iDeviceId
Definition: PCanDevice.h:39
CPCanDevice::waitForStartMotionAll
int waitForStartMotionAll()
Definition: PCanDevice.cpp:763
CPCanDevice::m_hDevice
int m_hDevice
Definition: PCanDevice.h:37
CPCanDevice::init
int init()
Definition: PCanDevice.cpp:495
CPCanDevice::operator=
CPCanDevice & operator=(const CPCanDevice &rclPCanDevice)
Definition: PCanDevice.cpp:454
CProtocolMessage
Definition: ProtocolMessage.h:23
CPCanDevice::getDeviceError
int getDeviceError(int iErrorState)
Definition: PCanDevice.cpp:35
CPCanDevice::setMessageId
int setMessageId(unsigned long uiMessageId)
Definition: PCanDevice.cpp:169
CPCanDevice::CPCanDevice
CPCanDevice()
default constructor
Definition: PCanDevice.cpp:429
CPCanDevice::writeDevice
int writeDevice(CProtocolMessage &rclProtocolMessage)
Definition: PCanDevice.cpp:392
CPCanDevice::m_hSyncDevice
int m_hSyncDevice
Definition: PCanDevice.h:38
CPCanDevice::m_handle
HANDLE m_handle
Definition: PCanDevice.h:36
CPCanDevice::clearReadQueue
int clearReadQueue()
Definition: PCanDevice.cpp:186
CPCanDevice::m_bInitialized
bool m_bInitialized
Definition: PCanDevice.h:40


schunk_libm5api
Author(s): Florian Weisshardt
autogenerated on Sat May 7 2022 02:17:13