summaryrefslogtreecommitdiffstats
path: root/src/openxc/can_message.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-28 13:49:08 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-11 10:25:38 +0000
commit9a441dad97539ec696d33eabb8ac36c222790e7f (patch)
treea8c5ed2ec746ef133d51b8964e2f2aff49f18ec2 /src/openxc/can_message.cpp
parente2a6bd168da5505f150ffad21aaf03498f2a3f67 (diff)
Adds CAN FD flag on message object.
Adds CAN FD flag on message object when generating CPP file for the low-can service. So with this commit you are now able to use a new flags in your JSON CAN message definitions. This will imply that messages received from a certain CAN ID will be handled as CAN FD. Bug-AGL: SPEC-1980 Change-Id: Ia5fb573711742591c068928aee914ba708c802df Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/openxc/can_message.cpp')
-rwxr-xr-xsrc/openxc/can_message.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/openxc/can_message.cpp b/src/openxc/can_message.cpp
index 40e897b..77418d8 100755
--- a/src/openxc/can_message.cpp
+++ b/src/openxc/can_message.cpp
@@ -17,6 +17,16 @@ namespace openxc
return bus_;
}
+ void can_message::is_fd(const bool is_fd)
+ {
+ is_fd_ = is_fd;
+ }
+
+ bool can_message::is_fd() const
+ {
+ return is_fd_;
+ }
+
bool can_message::bit_numbering_inverted() const
{
return bit_numbering_inverted_;
@@ -65,6 +75,7 @@ namespace openxc
void can_message::from_json(const nlohmann::json& j)
{
bus_ = j.count("bus") ? j["bus"].get<std::string>() : "";
+ is_fd_ = j.count("is_fd") ? j["is_fd"].get<bool>() : false;
bit_numbering_inverted_ = j.count("bit_numbering_inverted") ? j["bit_numbering_inverted"].get<bool>() : false;
name_ = j.count("name") ? j["name"].get<std::string>() : "";
handlers_ = j.count("handlers") ? j["handlers"].get<std::vector<std::string>>() : std::vector<std::string>();
@@ -96,6 +107,7 @@ namespace openxc
{
nlohmann::json j;
j["bus"] = bus_;
+ j["is_fd"] = is_fd_;
j["bit_numbering_inverted"] = bit_numbering_inverted_;
j["signals"] = signals_;
j["name"] = name_;