paulscherrerinstitute / StreamDevice

EPICS Driver for message based I/O
GNU General Public License v3.0
28 stars 42 forks source link

Allow default values for protocol parameters #81

Open ralphlange opened 3 years ago

ralphlange commented 3 years ago

If protocols could set default values for parameters, it would be easier to extend protocols without breaking their database API.

Use case (happened today): For an "intelligent" modular measurement device, modules may have one or multiple inputs ("subchannels"). The existing protocol supported a module type with one input, so the "select subchannel" command was hard-coded to 1.

An upgrade to support a module with multiple inputs made the subchannel a second parameter, which requires to change all existing databases. If the protocol were able set a default value for parameter 2, such upgrades could keep compatibilty.