socketcan_dune_implementation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
socketcan_dune_implementation [2019/10/11 17:10] – [Interface in DUNE] nikolalsocketcan_dune_implementation [2022/09/19 11:34] (current) – external edit 127.0.0.1
Line 27: Line 27:
  
 ==== Example of initializing a SocketCAN instance ==== ==== Example of initializing a SocketCAN instance ====
- +The CAN implementation uses ''%%DUNE/System/Error.hpp%%'' to send errors when something goes wrong while initializing SocketCAN. Here is an example on how to initialize SocketCAN while catching eventual errors: 
- +  try { 
 +   m_can = new Hardware::SocketCAN(m_args.can_dev, SocketCAN::CAN_BASIC_EFF); 
 +  } 
 +   catch(std::runtime_error& e) { 
 +   cri(DTR("Could not open CAN: %s"), e.what()); 
 +  }
 ===== Useful links ===== ===== Useful links =====
   * [[https://www.kernel.org/doc/Documentation/networking/can.txt|Linux kernel documentation on CAN]]   * [[https://www.kernel.org/doc/Documentation/networking/can.txt|Linux kernel documentation on CAN]]
  • socketcan_dune_implementation.1570806635.txt.gz
  • Last modified: 2022/09/19 11:33
  • (external edit)