This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mesh sensor Model, data type

I'm setting up the message structure for usage in a sensor Model. The sensor readings may be represented by different data types (e.g. float, integer). How is this best handled in the Model? I've been thinking about these strategies:

  1. Use a data type big enough to contain all others, and cast them at the client based on sensor ID. This really doesn't feel like a good solution at all.
  2. Create separate messages (or even Models) for the different data types. This would probably work, but involves some code repetition.
  3. A C union. But I'm not sure how this would work in a Model. And would this incur an overhead when any of the smaller data types are used?
Related