DbcMessage.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2018 New Eagle
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of New Eagle nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 #ifndef _NEW_EAGLE_DBC_MESSAGE_H
36 #define _NEW_EAGLE_DBC_MESSAGE_H
37 
38 #include <string>
39 #include <can_msgs/Frame.h>
40 
42 
43 namespace NewEagle
44 {
46  {
47  uint32_t Id;
48  std::string Comment;
49  };
50 
51  enum IdType
52  {
53  STD = 0,
54  EXT = 1
55  };
56 
57  typedef struct {
58  uint8_t :8;
59  uint8_t :8;
60  uint8_t :8;
61  uint8_t :8;
62  uint8_t :8;
63  uint8_t :8;
64  uint8_t :8;
65  uint8_t :8;
66  } EmptyData;
67 
68  class DbcMessage
69  {
70  public:
71  DbcMessage();
72  DbcMessage(
73  uint8_t dlc,
74  uint32_t id,
75  IdType idType,
76  std::string name,
77  uint32_t rawId
78  );
79 
80  ~DbcMessage();
81 
82  uint8_t GetDlc();
83  uint32_t GetId();
84  IdType GetIdType();
85  std::string GetName();
86  can_msgs::Frame GetFrame();
87  uint32_t GetSignalCount();
88  void SetFrame(const can_msgs::Frame::ConstPtr& msg);
89  void AddSignal(std::string signalName, NewEagle::DbcSignal signal);
90  NewEagle::DbcSignal* GetSignal(std::string signalName);
91  void SetRawText(std::string rawText);
92  uint32_t GetRawId();
93  void SetComment(NewEagle::DbcMessageComment comment);
94  std::map<std::string, NewEagle::DbcSignal>* GetSignals();
95  bool AnyMultiplexedSignals();
96 
97  private:
98  std::map<std::string, NewEagle::DbcSignal> _signals;
99  uint8_t _data[8];
100  uint8_t _dlc;
101  uint32_t _id;
103  std::string _name;
104  uint32_t _rawId;
106  };
107 }
108 #endif // _NEW_EAGLE_DBC_UTILITIES_H
std::map< std::string, NewEagle::DbcSignal > _signals
Definition: DbcMessage.h:98
std::string _name
Definition: DbcMessage.h:103
Definition: Dbc.h:45
NewEagle::DbcMessageComment _comment
Definition: DbcMessage.h:105


can_dbc_parser
Author(s): Ryan Borchert
autogenerated on Sat Jan 9 2021 03:56:18