aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/can
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-14 17:31:12 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-21 12:02:11 +0200
commit2a4abf5bd6440e9cd5b98b70453d74ae3d1b8cfa (patch)
tree637ad119b03aa7f10a2ffef5fde100e5075ff52b /low-can-binding/can
parenta483f245eb1aae07917c9074568c8cda82855ff6 (diff)
Fix: encoding value method has wrong signature.
Change-Id: I227c721f782eef85f83db9ffdb7cc0e180d17da4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/can')
-rw-r--r--low-can-binding/can/can-encoder.cpp12
-rw-r--r--low-can-binding/can/can-encoder.hpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/low-can-binding/can/can-encoder.cpp b/low-can-binding/can/can-encoder.cpp
index b87407f..9ba8531 100644
--- a/low-can-binding/can/can-encoder.cpp
+++ b/low-can-binding/can/can-encoder.cpp
@@ -30,18 +30,18 @@
/// @param[in] length - The length of the destination buffer.
///
/// @return Returns a can_frame struct initialized and ready to be send.
-const can_frame build_frame(const can_signal_t& signal, uint64_t value)
+const can_frame encoder_t::build_frame(const std::shared_ptr<can_signal_t>& signal, uint64_t value)
{
struct can_frame cf;
::memset(&cf, 0, sizeof(cf));
- cf.can_id = signal.get_message()->get_id();
+ cf.can_id = signal->get_message()->get_id();
cf.can_dlc = CAN_MAX_DLEN;
bitfield_encode_float((float)value,
- signal.get_bit_position(),
- signal.get_bit_size(),
- signal.get_factor(),
- signal.get_offset(),
+ signal->get_bit_position(),
+ signal->get_bit_size(),
+ signal->get_factor(),
+ signal->get_offset(),
cf.data,
CAN_MAX_DLEN);
diff --git a/low-can-binding/can/can-encoder.hpp b/low-can-binding/can/can-encoder.hpp
index f7e8394..c79e224 100644
--- a/low-can-binding/can/can-encoder.hpp
+++ b/low-can-binding/can/can-encoder.hpp
@@ -24,7 +24,7 @@
class encoder_t
{
public:
- static const can_frame build_frame(const can_signal_t& signal, uint64_t value);
+ static const can_frame build_frame(const std::shared_ptr<can_signal_t>& signal, uint64_t value);
static uint64_t encode_state(const can_signal_t& signal, const std::string& value, bool* send);
static uint64_t encode_boolean(const can_signal_t& signal, bool value, bool* send);
static uint64_t encode_number(const can_signal_t& signal, float value, bool* send);