diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-20 10:24:05 +0000 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-20 10:24:05 +0000 |
commit | 32e25cbca210a359b09768537b6f443fe90a3070 (patch) | |
tree | 3309794c15d8a8f8e9c1c08cad072ee1378813ba /CAN-config-generator/src/openxc/diagnostic_message.cpp | |
parent | 76c43dec62b2e21cd6446360c00d4fe6b437533f (diff) |
Separation Generator to a dedicated repo
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-config-generator/src/openxc/diagnostic_message.cpp')
-rwxr-xr-x | CAN-config-generator/src/openxc/diagnostic_message.cpp | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/CAN-config-generator/src/openxc/diagnostic_message.cpp b/CAN-config-generator/src/openxc/diagnostic_message.cpp deleted file mode 100755 index 3881abef..00000000 --- a/CAN-config-generator/src/openxc/diagnostic_message.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "diagnostic_message.hpp"
-
-namespace openxc
-{
- std::string diagnostic_message::bus() const
- {
- return bus_;
- }
-
- std::uint32_t diagnostic_message::id() const
- {
- return id_;
- }
-
- std::uint32_t diagnostic_message::mode() const
- {
- return mode_;
- }
-
- float diagnostic_message::frequency() const
- {
- return frequency_;
- }
-
- std::uint32_t diagnostic_message::pid() const
- {
- return pid_;
- }
-
- std::string diagnostic_message::name() const
- {
- return name_;
- }
-
- std::string diagnostic_message::decoder() const
- {
- return decoder_;
- }
-
- std::string diagnostic_message::callback() const
- {
- return callback_;
- }
-
- void diagnostic_message::from_json(const nlohmann::json& j)
- {
- bus_ = j.count("bus") ? j["bus"].get<std::string>() : "";
- id_ = j.count("id") ? j["id"].get<std::uint32_t>() : 0;
- mode_ = j.count("mode") ? j["mode"].get<std::uint32_t>() : 1;
- frequency_ = j.count("frequency") ? j["frequency"].get<float>() : 0;
- pid_ = j.count("pid") ? j["pid"].get<std::uint32_t>() : 0;
- name_ = j.count("name") ? j["name"].get<std::string>() : "";
- decoder_ = j.count("decoder") ? j["decoder"].get<std::string>() : "";
- callback_ = j.count("callback") ? j["callback"].get<std::string>() : "";
- }
-
- nlohmann::json diagnostic_message::to_json() const
- {
- nlohmann::json j;
- j["bus"] = bus_;
- j["id"] = id_;
- j["mode"] = mode_;
- j["frequency"] = frequency_;
- j["pid"] = pid_;
- j["name"] = name_;
- j["decoder"] = decoder_;
- j["callback"] = callback_;
- return j;
- }
-
- void to_json(nlohmann::json& j, const diagnostic_message& p)
- {
- j = p.to_json();
- }
-
- void from_json(const nlohmann::json& j, diagnostic_message& p)
- {
- p.from_json(j);
- }
-}
|