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 
CANPeakSysUSB::receiveMsg
bool receiveMsg(CanMsg *pCMsg)
Definition: CanPeakSysUSB.cpp:160
CANPeakSysUSB::c_iPort
static const int c_iPort
Definition: CanPeakSysUSB.h:53
CanItf.h
IniFile.h
CANPeakSysUSB::init
void init()
Definition: CanPeakSysUSB.cpp:79
IniFile
CANPeakSysUSB::m_bSimuEnabled
bool m_bSimuEnabled
Definition: CanPeakSysUSB.h:48
CANPeakSysUSB
Definition: CanPeakSysUSB.h:26
CANPeakSysUSB::outputDetailedStatus
void outputDetailedStatus()
Definition: CanPeakSysUSB.cpp:323
CANPeakSysUSB::m_handle
HANDLE m_handle
Definition: CanPeakSysUSB.h:44
CANPeakSysUSB::destroy
void destroy()
Definition: CanPeakSysUSB.h:35
CanItf
Definition: CanItf.h:44
CanMsg
Definition: CanMsg.h:28
CANPeakSysUSB::receiveMsgRetry
bool receiveMsgRetry(CanMsg *pCMsg, int iNrOfRetry)
Definition: CanPeakSysUSB.cpp:199
CANPeakSysUSB::CANPeakSysUSB
CANPeakSysUSB(const char *device, int baudrate)
Definition: CanPeakSysUSB.cpp:30
CANPeakSysUSB::initCAN
bool initCAN()
Definition: CanPeakSysUSB.cpp:278
CANPeakSysUSB::m_iBaudrateVal
int m_iBaudrateVal
Definition: CanPeakSysUSB.h:50
CANPeakSysUSB::m_bInitialized
bool m_bInitialized
Definition: CanPeakSysUSB.h:46
CANPeakSysUSB::~CANPeakSysUSB
~CANPeakSysUSB()
Definition: CanPeakSysUSB.cpp:49
CANPeakSysUSB::isObjectMode
bool isObjectMode()
Definition: CanPeakSysUSB.h:40
CANPeakSysUSB::p_cDevice
const char * p_cDevice
Definition: CanPeakSysUSB.h:49
CANPeakSysUSB::c_iInterrupt
static const int c_iInterrupt
Definition: CanPeakSysUSB.h:52
CANPeakSysUSB::init_ret
bool init_ret()
Definition: CanPeakSysUSB.cpp:58
CANPeakSysUSB::receiveMsgTimeout
bool receiveMsgTimeout(CanMsg *pCMsg, int nMicroSeconds)
Definition: CanPeakSysUSB.cpp:245
CANPeakSysUSB::m_IniFile
IniFile m_IniFile
Definition: CanPeakSysUSB.h:47
CANPeakSysUSB::transmitMsg
bool transmitMsg(CanMsg CMsg, bool bBlocking=true)
Definition: CanPeakSysUSB.cpp:105


cob_generic_can
Author(s): Christian Connette
autogenerated on Wed Nov 8 2023 03:47:51