BrewPi / firmware

Brewing temperature control firmware for the BrewPi Spark (Particle Photon inside)
http://www.brewpi.com
GNU Affero General Public License v3.0
97 stars 55 forks source link

Reserved object size should be defined by firmware and not the client #81

Closed elcojacobs closed 6 years ago

elcojacobs commented 6 years ago

Currently reserved object size is sent over serial when an object is created. This is risky and puts a responsibility on the client it shouldn't have.

The firmware knows the maximum size an object can become (calculated based on proto files in case of a protobuf definition). It should reserve this size in EEPROM. This will simplify the protocol because the size can be removed from these commands in request and response:

For objects that have variable size, the size can be part of the payload and this can still be indicated with size 0.