waggle-sensor / wagman

The Waggle Manager (Wagman), a custom circuit board and control system for Wild Waggle Nodes
1 stars 3 forks source link

Clean up the way devices / hardware are modeled #22

Open seanshahkarami opened 7 years ago

seanshahkarami commented 7 years ago

The way the devices are modeled now doesn't really make much sense. For example, all devices are assumed to have a boot media selector. I think this was a side effect of trying to unify what features a device should have way too early. It’s probably better just to accept their quirks and model behavior as a few independent components, then keep a few different kind of state machines depending on the device type.

Another facet of this is, too much logic is groups under either the Device.cpp or Wagman.cpp files. For example, the idea of a "circuit breaker" relay should probably be developed as its own component and can persist its own state, the idea of a device state machine should be its own thing with transitions on some well defined events.