converter: littles improvements.
authorRomain Forlot <romain.forlot@iot.bzh>
Tue, 19 Nov 2019 15:44:38 +0000 (16:44 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Tue, 3 Dec 2019 18:46:26 +0000 (19:46 +0100)
Change-Id: I9198835b96c66c140f8b1d4167828302b9dc4959
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
low-can-binding/binding/low-can-subscription.cpp
low-can-binding/utils/converter.hpp

index 46eced4..73ca279 100644 (file)
@@ -420,7 +420,7 @@ int low_can_subscription_t::open_socket(low_can_subscription_t &subscription, co
                else if(flags & J1939_PROTOCOL)
                {
                        pgn_t pgn = J1939_NO_PGN;
-                       if(subscription.signal_ != nullptr)
+                       if(subscription.signal_)
                        {
                                pgn = subscription.signal_->get_message()->get_id();
                                std::shared_ptr<utils::socketcan_j1939_data_t> socket = std::make_shared<utils::socketcan_j1939_data_t>();
index cb52f1a..4523326 100644 (file)
@@ -23,6 +23,6 @@ class converter_t
 {
        public:
                static std::string to_hex(const uint8_t data[], const size_t length);
-               static void signal_to_bits_bytes(uint32_t bit_position, uint32_t bit_size, int &new_start_byte, int &new_end_byte, int &new_start_bit, int &new_end_bit);
+               static void signal_to_bits_bytes(uint32_t bit_position, uint32_t bit_size, int &new_start_byte, int &new_end_byte, uint8_t &new_start_bit, uint8_t &new_end_bit);
                static uint32_t bit_position_swap(uint32_t bit_position,uint32_t bit_size);
 };