aboutsummaryrefslogtreecommitdiffstats
path: root/src/openxc/signal.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openxc/signal.hpp')
-rwxr-xr-xsrc/openxc/signal.hpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/openxc/signal.hpp b/src/openxc/signal.hpp
index 750926b..ce0a2e1 100755
--- a/src/openxc/signal.hpp
+++ b/src/openxc/signal.hpp
@@ -8,27 +8,36 @@
namespace openxc
{
+ enum sign_t
+ {
+ UNSIGNED = 0,
+ SIGN_BIT = 1,
+ ONES_COMPLEMENT = 2,
+ TWOS_COMPLEMENT = 3,
+ SIGN_BIT_EXTERN = 4
+ };
+
class signal
{
private:
std::string id_;
std::string generic_name_;
- std::uint32_t bit_position_;
- std::uint32_t bit_size_;
+ std::uint32_t bit_position_;
+ std::uint32_t bit_size_;
float factor_;
float offset_;
std::string decoder_;
bool ignore_;
bool enabled_;
- std::map<std::string, std::vector<std::uint32_t>> states_;
+ std::map<std::string, std::vector<std::uint32_t>> states_;
float max_frequency_;
bool send_same_;
bool force_send_changed_;
bool writable_;
std::string encoder_;
- std::pair<bool,int> multiplex_;
- bool is_big_endian_;
- bool is_signed_;
+ std::pair<bool,int> multiplex_;
+ sign_t sign_;
+ std::int32_t bit_sign_position_;
std::string unit_;
public:
@@ -49,8 +58,8 @@ namespace openxc
bool writable() const;
std::string encoder() const;
std::pair<bool,int> multiplex() const;
- bool is_big_endian() const;
- bool is_signed() const;
+ sign_t sign() const;
+ std::int32_t bit_sign_position() const;
std::string unit() const;
void from_json(const nlohmann::json& j);