Message: Create a type system so non-frame data can be represented

This change breaks existing code, hence the version bump, but it's
going to be much less error prone going forward.
This commit is contained in:
Paul Hollinsky
2021-05-22 01:58:36 -04:00
parent 21e93d1f73
commit 21bc4eeff2
48 changed files with 853 additions and 527 deletions
@@ -11,13 +11,18 @@ namespace icsneo {
class VersionMessage : public Message {
public:
VersionMessage(bool main) : MainChip(main) { network = Network::NetID::Main51; }
enum Chip : uint8_t {
MainChip,
SecondaryChips
};
// If true, the included version is for the main chip
const bool MainChip;
VersionMessage(Chip chip) : Message(Message::Type::DeviceVersion), ForChip(chip) {}
// nullopt here indicates invalid
std::vector< optional<DeviceAppVersion> > Versions;
// What chips the versions are for
const Chip ForChip;
};
}