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:
- 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.
- Create separate messages (or even Models) for the different data types. This would probably work, but involves some code repetition.
- 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?