You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer-reference/api.rst
+21-11Lines changed: 21 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,9 @@ CommandStation-EX API Reference
19
19
* - Document status
20
20
- Draft
21
21
* - Document version
22
-
- 0.1
22
+
- 0.2
23
23
* - Last update
24
-
- 5th June 2022
24
+
- 6th June 2022
25
25
26
26
This page documents the API syntax and usage for CommandStation-EX.
27
27
@@ -94,31 +94,31 @@ A DCC++EX API message consists of a leading ``<`` symbol, a single character OPC
94
94
95
95
Messages cannot be nested, and a second ``<`` inside a message constitutes a syntax error.
96
96
97
-
5. Error responses
98
-
===================
97
+
5. Error and empty responses
98
+
=============================
99
99
100
100
A command sent that is invalid or returns an error has a response of ``<X>``.
101
101
102
+
This same response will be sent if a command has no response.
103
+
102
104
Memory limitations prohibit more detailed error messages.
103
105
104
106
6. Parameter values
105
107
====================
106
108
107
-
Parameters containing ``a-z``, ``A-Z``, or ``_`` are hashed to create integers. Thus a command like ``<D WIFI ON>`` is internally identical to ``<D wifi on>``.
108
-
109
-
The translation of parameters from text to integer is base10 unless noted in :ref:`developer-reference/api:a.1. parameter values`.
110
-
111
109
There are three types of parameters in use:
112
110
113
111
6.1. Keyword
114
112
_____________
115
113
116
-
These are a consecutive sequence of non-blank characters consisting of ``a-z``, ``A-Z``, or ``_``, eg. "JOIN", "WIFI", "ON".
114
+
These are a consecutive sequence of one or more non-blank characters consisting of ``a-z``, ``A-Z``, or ``_``, eg. "JOIN", "WIFI", "ON".
115
+
116
+
Keyword parameters are internally hashed to created integers.
117
117
118
118
6.2. Numeric
119
119
_____________
120
120
121
-
These are a consective sequence of digits, with an optional leading ``-`` to indicate a negative value. Unless noted in :ref:`developer-reference/api:a.1. parameter values`, these numbers are base10.
121
+
These are a consective sequence of one or more digits, with an optional leading ``-`` to indicate a negative value. Unless noted in :ref:`developer-reference/api:a.1. parameter values`, these numbers are base10.
122
122
123
123
6.3. String
124
124
____________
@@ -161,4 +161,14 @@ Using our syntax standard, "J" is the OPCODE, and "T" is the parameter.
161
161
162
162
The response for this command will look something like ``<jT 1 17>``.
163
163
164
-
Using our parsing sequence, we obtain the OPCODE "j", with the subsequent parameters being "T", "1", and "17".
164
+
Using our parsing sequence, we obtain the OPCODE "j", with the subsequent parameters being "T", "1", and "17".
165
+
166
+
Appendix C. Further information
167
+
================================
168
+
169
+
C.1. Keyword parameters are not case sensitive
170
+
_______________________________________________
171
+
172
+
Unlike OPCODES, keyword parameters are not case sensitive.
173
+
174
+
As noted, parameters containing ``a-z``, ``A-Z``, or ``_`` are hashed to create integers which results in commands such as ``<D WIFI ON>`` being treated identically to ``<D wifi on>``.
0 commit comments