SocketCan.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 SOCKETCAN_INCLUDEDEF_H
19 #define SOCKETCAN_INCLUDEDEF_H
20 //-----------------------------------------------
21 #include <boost/shared_ptr.hpp>
22 
23 #include <cob_generic_can/CanItf.h>
27 //-----------------------------------------------
28 
29 class SocketCan : public CanItf
30 {
31 public:
32  // --------------- Interface
33  SocketCan ( const char* device, int baudrate );
34  SocketCan ( const char* device );
35  ~SocketCan();
36  bool init_ret();
37  void init();
38  bool transmitMsg ( CanMsg CMsg, bool bBlocking = true );
39  bool receiveMsg ( CanMsg* pCMsg );
40  bool receiveMsgRetry ( CanMsg* pCMsg, int iNrOfRetry );
41  bool receiveMsgTimeout ( CanMsg* pCMsg, int nMicroSecTimeout );
42  bool isObjectMode() {
43  return false;
44  }
45 
46 private:
47  // --------------- Types
50 
52  const char* p_cDevice;
53 
54  void print_error(const can::State& state);
55 };
56 //-----------------------------------------------
57 #endif
bool isObjectMode()
Definition: SocketCan.h:42
bool m_bInitialized
Definition: SocketCan.h:51
bool transmitMsg(CanMsg CMsg, bool bBlocking=true)
Definition: SocketCan.cpp:84
Definition: CanMsg.h:28
bool receiveMsgRetry(CanMsg *pCMsg, int iNrOfRetry)
Definition: SocketCan.cpp:118
Definition: CanItf.h:44
can::BufferedReader m_reader
Definition: SocketCan.h:49
bool receiveMsgTimeout(CanMsg *pCMsg, int nMicroSecTimeout)
Definition: SocketCan.cpp:147
bool init_ret()
Definition: SocketCan.cpp:54
const char * p_cDevice
Definition: SocketCan.h:52
void init()
Definition: SocketCan.cpp:73
bool receiveMsg(CanMsg *pCMsg)
Definition: SocketCan.cpp:96
boost::shared_ptr< ThreadedSocketCANInterface > ThreadedSocketCANInterfaceSharedPtr
SocketCan(const char *device, int baudrate)
Definition: SocketCan.cpp:28
can::ThreadedSocketCANInterfaceSharedPtr m_handle
Definition: SocketCan.h:48
void print_error(const can::State &state)
Definition: SocketCan.cpp:167


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