StreamOperators.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
22 //----------------------------------------------------------------------
23 #include "StreamOperators.h"
24 
25 #include <iomanip>
26 
27 namespace icl_hardware {
28 namespace can {
29 
30 std::ostream& operator << (std::ostream& os, const tCanMessage& msg)
31 {
32  return os << "ID: " << std::dec << msg.id << " - DLC: " << unsigned(msg.dlc) << " - Data:"
33  << std::hex << std::setfill('0')
34  << " " << std::setw(2) << unsigned(msg.data[0])
35  << " " << std::setw(2) << unsigned(msg.data[1])
36  << " " << std::setw(2) << unsigned(msg.data[2])
37  << " " << std::setw(2) << unsigned(msg.data[3])
38  << " " << std::setw(2) << unsigned(msg.data[4])
39  << " " << std::setw(2) << unsigned(msg.data[5])
40  << " " << std::setw(2) << unsigned(msg.data[6])
41  << " " << std::setw(2) << unsigned(msg.data[7])
42  << std::dec;
43 }
44 
45 }
46 }
Implements a struct representing a can message.
Definition: tCanMessage.h:43
std::ostream & operator<<(std::ostream &os, InterpretedCanMessages const &interpreted_can_messages)


fzi_icl_can
Author(s):
autogenerated on Mon Jun 10 2019 13:17:02