DCC-EX / CommandStation-EX

EX-CommandStation firmware from DCC-EX. Includes support for WiFi and a standalone WiThrottle server. A complete re-write of the original DCC++.
https://dcc-ex.github.io/
GNU General Public License v3.0
154 stars 104 forks source link

Consistent Command Structure Proposal #306

Open pmantoine opened 1 year ago

pmantoine commented 1 year ago

Peter (flash62au) has some possible rules for a new command structure:

  1. Uppercase commands. Lowercase responses (echo)
  2. most commands would have two parts. a) what type of 'thing' you are acting on. b) the action or nature of the respose. e.g. <P 1 = Power on <P 1 1 =Power On Track 1
  3. the first letter have a clear, unique meaning. e.g. T,t = turnout L,l=loco or E,e=engine P,p =power
  4. if a response first letter has more than one meaning then the second letter (or second parameter) will be distinctly different e.g <T A = Throttle,Action <T L = Throttle list request <t L = Throttle list response <t E = Throttle Entry respone etc.
  5. a response (type) will always have the same number of parameters e.g. <t E id "desc" = valid or <t E id X = unkown
  6. etc.
Asbelos commented 1 year ago

Do not use <> as command delimiters to avoid all confusion and ambiguity of previous protocol.