diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-11-08 11:06:01 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-11-08 16:17:44 +0000 |
commit | fa7a8abbbe1d83a287bb6e826a6cdf47fad75dff (patch) | |
tree | e3e903e07f07edc87b6d2a19e33f620e1309059e /src/vis-session.cpp | |
parent | e5c3353376d4f308a0cde2f4a7668abb746a83ee (diff) |
Update message data type handlingneedlefish
KUKSA.val 0.2.1 always returned numeric values as floating point, this
has changed with 0.2.5 and support is required to handle data points
actually having integer or unsigned integer types.
Bug-AGL: SPEC-4598
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ica9b3e5fc27e110c02788dde6549e0bb194ffeb1
Diffstat (limited to 'src/vis-session.cpp')
-rw-r--r-- | src/vis-session.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vis-session.cpp b/src/vis-session.cpp index 880e3ae..53a554c 100644 --- a/src/vis-session.cpp +++ b/src/vis-session.cpp @@ -288,6 +288,12 @@ bool VisSession::parseData(const json &message, std::string &path, std::string & } else if (dp["value"].is_number_float()) { double num = dp["value"]; value = std::to_string(num); + } else if (dp["value"].is_number_unsigned()) { + unsigned int num = dp["value"]; + value = std::to_string(num); + } else if (dp["value"].is_number_integer()) { + int num = dp["value"]; + value = std::to_string(num); } else if (dp["value"].is_boolean()) { value = dp["value"] ? "true" : "false"; } else { |