diff --git a/_sources/include/include.rst.txt b/_sources/include/include.rst.txt index 3f6695f..428de02 100644 --- a/_sources/include/include.rst.txt +++ b/_sources/include/include.rst.txt @@ -3,11 +3,11 @@ .. .. |DCC-EX| raw:: html - DCC-EX + DCC-EX .. .. |EX-CS| raw:: html - EX‑CommandStation + EX‑CommandStation .. .. |EX-NCL| raw:: html diff --git a/contribute.html b/contribute.html index 8b45eda..1a0a21f 100644 --- a/contribute.html +++ b/contribute.html @@ -496,8 +496,8 @@

Contributions

-

The DCC-EX team welcomes contributions to the DCCEXProtocol library.

-

The best way to get involved is to reach out to the DCC-EX team via our Discord server.

+

The DCC-EX team welcomes contributions to the DCCEXProtocol library.

+

The best way to get involved is to reach out to the DCC-EX team via our Discord server.

You can also try the other methods outlined on our Contact Us page.

Library Maintenance

diff --git a/examples.html b/examples.html index 47d1183..578303d 100644 --- a/examples.html +++ b/examples.html @@ -528,15 +528,15 @@

Examples

DCCEXProtocol_Basic

-

This example demonstrates the basics of creating a WiFi connection to your EX‑CommandStation using the library, and monitoring for broadcasts and command responses.

+

This example demonstrates the basics of creating a WiFi connection to your EX‑CommandStation using the library, and monitoring for broadcasts and command responses.

DCCEXProtocol_Delegate

-

This example builds on the basic example and, in addition, demonstrates how to implement a custom DCCEXProtocolDelegate` class to respond to broadcasts and command responses received from EX‑CommandStation.

+

This example builds on the basic example and, in addition, demonstrates how to implement a custom DCCEXProtocolDelegate` class to respond to broadcasts and command responses received from EX‑CommandStation.

DCCEXProtocol_Roster_etc

-

This example demonstrates how to retrieve the object types from EX‑CommandStation, and further demonstrates how to use the delegate to display these object lists when received.

+

This example demonstrates how to retrieve the object types from EX‑CommandStation, and further demonstrates how to use the delegate to display these object lists when received.

DCCEXProtocol_Loco_Control

@@ -554,7 +554,7 @@

DCCEXProtocol_Turnout

DCCEXProtocol_Multi_Throttle_Control

This example demonstrates how client throttle software may be written to control multiple locomotives (or consists for that matter) concurrently.

What can’t be demonstrated in this example is the control of speed and direction, which would typically be accomplished with the use of rotary encoders or similar.

-

Note when setting speed and direction, these should be sent to the EX‑CommandStation via the DCCEXProtocol library, and any local references to these should be set based on the response received, not directly by the input method in use.

+

Note when setting speed and direction, these should be sent to the EX‑CommandStation via the DCCEXProtocol library, and any local references to these should be set based on the response received, not directly by the input method in use.

For example, when setting the speed based on the position of a rotary encoder, send that value via the protocol’s setThrottle() method, but do not display that speed directly. Instead, utlise the delegate’s receivedLocoUpdate() method to update the displayed speed.

This ensures that the user of the throttle sees the accurate results of what the throttle is doing, and provides validation that the EX-CommandStation is responding to the user input.

@@ -565,15 +565,15 @@

DCCEXProtocol_Track_t

Additional Examples

-

The following examples are not strictly related to the DCCEXProtocol library, but hopefully will be useful for anyone developing a throttle to use with any EX‑CommandStation.

+

The following examples are not strictly related to the DCCEXProtocol library, but hopefully will be useful for anyone developing a throttle to use with any EX‑CommandStation.

DCCEXProtocol_SSID

This example demonstrates how client throttle software may be written to find all the SSIDs (networks) that are available.

DCCEXProtocol_mDNS

-

This example demonstrates how client throttle software may be written to find all the EX‑CommandStation and WiThrottle servers that are advertising via mDNS.

-

Note that DCC-EX EX‑CommandStation only advertise as wiThrottle servers, but will use and respond with either the WiThrottle protocol or the DCC-EX +

This example demonstrates how client throttle software may be written to find all the EX‑CommandStation and WiThrottle servers that are advertising via mDNS.

+

Note that DCC-EX EX‑CommandStation only advertise as wiThrottle servers, but will use and respond with either the WiThrottle protocol or the DCC-EX native command protocol depending the type of command it first receives from the client (throttle).

diff --git a/index.html b/index.html index e202db7..c4c0218 100644 --- a/index.html +++ b/index.html @@ -500,7 +500,7 @@

Documentation for the DCC-EX Native command protocol library - DCCEXProtocol

DCC-EX Native command protocol library

This library implements the DCC-EX - native command protocol (as used in the DCC-EX EX‑CommandStation ONLY), allowing a device to connect to the server and act as a client (such as a hardware based throttle).

+ native command protocol (as used in the DCC-EX EX‑CommandStation ONLY), allowing a device to connect to the server and act as a client (such as a hardware based throttle).

The implementation of this library is tested on ESP32 based devices running the Arduino framework. There’s nothing in here that’s specific to the ESP32, and little of Arduino that couldn’t be replaced as needed.

There has also been limited testing on STM32F103C8 Bluepill with a serial connection.

diff --git a/overview.html b/overview.html index d60079b..b61351f 100644 --- a/overview.html +++ b/overview.html @@ -511,7 +511,7 @@

Library Design Principles native command protocol.

DCCEXProtocol Class

-

The DCCEXProtocol class manages all relevant objects advertised by a DCC-EX EX‑CommandStation and exposes simple methods to control these objects from the client software.

+

The DCCEXProtocol class manages all relevant objects advertised by a DCC-EX EX‑CommandStation and exposes simple methods to control these objects from the client software.

These objects include:

  • Roster entries

  • @@ -523,8 +523,8 @@

    DCCEXProtocol Class

    DCCEXProtocolDelegate Class

    -

    The DCCEXProtocolDelegate class enables the client software to respond to various events generated by a DCC-EX EX‑CommandStation as either broadcasts or responses to commands.

    -

    The events able to be managed via this class are over and above those managed by the DCCEXProtocol class and are entirely customisable by the client software to provide dynamic user experience updates such as displaying status changes to objects as they are broadcast from the DCC-EX EX‑CommandStation.

    +

    The DCCEXProtocolDelegate class enables the client software to respond to various events generated by a DCC-EX EX‑CommandStation as either broadcasts or responses to commands.

    +

    The events able to be managed via this class are over and above those managed by the DCCEXProtocol class and are entirely customisable by the client software to provide dynamic user experience updates such as displaying status changes to objects as they are broadcast from the DCC-EX EX‑CommandStation.

diff --git a/usage.html b/usage.html index 3e01330..939b70f 100644 --- a/usage.html +++ b/usage.html @@ -506,10 +506,10 @@

Usage -

Whilst this library extrapolates the need for understanding the specific DCC-EX native commands from a throttle developer, it is highly recommended to familiarise yourself with the concepts outlined in the https://dcc-ex.com/throttles/tech-reference.html.

+

Whilst this library extrapolates the need for understanding the specific DCC-EX native commands from a throttle developer, it is highly recommended to familiarise yourself with the concepts outlined in the https://dcc-ex.com/throttles/tech-reference.html.

Setup

-

Once the DCCEXProtocol object is instantiated, a connection must be made to the EX‑CommandStation using the connect(&stream) method and providing a suitable Arduino Stream, such as a WiFi client or serial connection.

+

Once the DCCEXProtocol object is instantiated, a connection must be made to the EX‑CommandStation using the connect(&stream) method and providing a suitable Arduino Stream, such as a WiFi client or serial connection.

It is also recommended to enable logging to an Arduino Stream using the setLogStream(&stream) method.

As covered in the design principles above, you must include the check() method as often as possible to receive command responses and broadcasts and have these processed by the library and any event handlers defined in your custom DCCEXProtocolDelegate class.

Refer to the Examples to see how this may be implemented.

@@ -525,7 +525,7 @@

Control and Inputs

Retrieving and referring to object lists

-

To retrieve the various objects lists from EX‑CommandStation, use the getLists(bool rosterRequired, bool turnoutListRequired, bool routeListRequired, bool turntableListRequired) method within your loop() function to ensure these are retrieved successfully.

+

To retrieve the various objects lists from EX‑CommandStation, use the getLists(bool rosterRequired, bool turnoutListRequired, bool routeListRequired, bool turntableListRequired) method within your loop() function to ensure these are retrieved successfully.

All objects are contained within linked lists and can be access via for loops:

for (Loco* loco=dccexProtocol.roster->getFirst(); loco; loco=loco->getNext()) {
   // loco methods are available here