Skip to content

Commit 4206752

Browse files
authored
Merge pull request DCC-EX#232 from DCC-EX/api-ref-updates
Further updates
2 parents bbe17bc + d9e9ac9 commit 4206752

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

docs/developer-reference/api.rst

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ CommandStation-EX API Reference
1919
* - Document status
2020
- Draft
2121
* - Document version
22-
- 0.1
22+
- 0.2
2323
* - Last update
24-
- 5th June 2022
24+
- 6th June 2022
2525

2626
This page documents the API syntax and usage for CommandStation-EX.
2727

@@ -94,31 +94,31 @@ A DCC++EX API message consists of a leading ``<`` symbol, a single character OPC
9494

9595
Messages cannot be nested, and a second ``<`` inside a message constitutes a syntax error.
9696

97-
5. Error responses
98-
===================
97+
5. Error and empty responses
98+
=============================
9999

100100
A command sent that is invalid or returns an error has a response of ``<X>``.
101101

102+
This same response will be sent if a command has no response.
103+
102104
Memory limitations prohibit more detailed error messages.
103105

104106
6. Parameter values
105107
====================
106108

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-
111109
There are three types of parameters in use:
112110

113111
6.1. Keyword
114112
_____________
115113

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.
117117

118118
6.2. Numeric
119119
_____________
120120

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.
122122

123123
6.3. String
124124
____________
@@ -161,4 +161,14 @@ Using our syntax standard, "J" is the OPCODE, and "T" is the parameter.
161161

162162
The response for this command will look something like ``<jT 1 17>``.
163163

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

Comments
 (0)