CanPeakSysUSB.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef CANPEAKSYSUSB_INCLUDEDEF_H
19 #define CANPEAKSYSUSB_INCLUDEDEF_H
20 //-----------------------------------------------
21 #include <cob_generic_can/CanItf.h>
22 #include <libpcan/libpcan.h>
23 #include <cob_utilities/IniFile.h>
24 //-----------------------------------------------
25 
26 class CANPeakSysUSB : public CanItf
27 {
28 public:
29  // --------------- Interface
30  CANPeakSysUSB(const char* device, int baudrate);
31  CANPeakSysUSB(const char* cIniFile);
33  bool init_ret();
34  void init();
35  void destroy() {};
36  bool transmitMsg(CanMsg CMsg, bool bBlocking = true);
37  bool receiveMsg(CanMsg* pCMsg);
38  bool receiveMsgRetry(CanMsg* pCMsg, int iNrOfRetry);
39  bool receiveMsgTimeout(CanMsg* pCMsg, int nMicroSeconds);
40  bool isObjectMode() { return false; }
41 
42 private:
43  // --------------- Types
44  HANDLE m_handle;
45 
49  const char* p_cDevice;
51 
52  static const int c_iInterrupt;
53  static const int c_iPort;
54 
55  bool initCAN();
56 
57  void outputDetailedStatus();
58 };
59 //-----------------------------------------------
60 #endif
61 
bool receiveMsg(CanMsg *pCMsg)
void outputDetailedStatus()
IniFile m_IniFile
Definition: CanPeakSysUSB.h:47
Definition: CanMsg.h:28
CANPeakSysUSB(const char *device, int baudrate)
Definition: CanItf.h:44
bool receiveMsgRetry(CanMsg *pCMsg, int iNrOfRetry)
bool isObjectMode()
Definition: CanPeakSysUSB.h:40
const char * p_cDevice
Definition: CanPeakSysUSB.h:49
bool receiveMsgTimeout(CanMsg *pCMsg, int nMicroSeconds)
static const int c_iPort
Definition: CanPeakSysUSB.h:53
bool transmitMsg(CanMsg CMsg, bool bBlocking=true)
static const int c_iInterrupt
Definition: CanPeakSysUSB.h:52


cob_generic_can
Author(s): Christian Connette
autogenerated on Wed Apr 7 2021 02:11:52