Skip to content

Commit

Permalink
Deploying to gh-pages from @ 9dbfdff 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
flash62au committed Dec 17, 2023
1 parent 9cfc2cc commit 5c63cd9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions _sources/include/include.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
..
.. |DCC-EX| raw:: html

<span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span>
<a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>
..
.. |EX-CS| raw:: html

<span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span>
<a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>
..
.. |EX-NCL| raw:: html

Expand Down
4 changes: 2 additions & 2 deletions contribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@

<section id="contributions">
<h1>Contributions<a class="headerlink" href="#contributions" title="Link to this heading"></a></h1>
<p>The <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> team welcomes contributions to the DCCEXProtocol library.</p>
<p>The best way to get involved is to reach out to the <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> team via our <a class="reference external" href="https://discord.gg/PuPnNMp8Qf">Discord server</a>.</p>
<p>The <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> team welcomes contributions to the DCCEXProtocol library.</p>
<p>The best way to get involved is to reach out to the <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> team via our <a class="reference external" href="https://discord.gg/PuPnNMp8Qf">Discord server</a>.</p>
<p>You can also try the other methods outlined on our <a class="reference external" href="https://dcc-ex.com/support/contact-us.html">Contact Us page</a>.</p>
<section id="library-maintenance">
<h2>Library Maintenance<a class="headerlink" href="#library-maintenance" title="Link to this heading"></a></h2>
Expand Down
14 changes: 7 additions & 7 deletions examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ <h1>Examples<a class="headerlink" href="#examples" title="Link to this heading">
</div>
<section id="dccexprotocol-basic">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">DCCEXProtocol_Basic</a><a class="headerlink" href="#dccexprotocol-basic" title="Link to this heading"></a></h2>
<p>This example demonstrates the basics of creating a WiFi connection to your <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> using the library, and monitoring for broadcasts and command responses.</p>
<p>This example demonstrates the basics of creating a WiFi connection to your <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> using the library, and monitoring for broadcasts and command responses.</p>
</section>
<section id="dccexprotocol-delegate">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">DCCEXProtocol_Delegate</a><a class="headerlink" href="#dccexprotocol-delegate" title="Link to this heading"></a></h2>
<p>This example builds on the basic example and, in addition, demonstrates how to implement a custom <cite>DCCEXProtocolDelegate`</cite> class to respond to broadcasts and command responses received from <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span>.</p>
<p>This example builds on the basic example and, in addition, demonstrates how to implement a custom <cite>DCCEXProtocolDelegate`</cite> class to respond to broadcasts and command responses received from <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>.</p>
</section>
<section id="dccexprotocol-roster-etc">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">DCCEXProtocol_Roster_etc</a><a class="headerlink" href="#dccexprotocol-roster-etc" title="Link to this heading"></a></h2>
<p>This example demonstrates how to retrieve the object types from <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span>, and further demonstrates how to use the delegate to display these object lists when received.</p>
<p>This example demonstrates how to retrieve the object types from <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>, and further demonstrates how to use the delegate to display these object lists when received.</p>
</section>
<section id="dccexprotocol-loco-control">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">DCCEXProtocol_Loco_Control</a><a class="headerlink" href="#dccexprotocol-loco-control" title="Link to this heading"></a></h2>
Expand All @@ -554,7 +554,7 @@ <h2><a class="toc-backref" href="#id6" role="doc-backlink">DCCEXProtocol_Turnout
<h2><a class="toc-backref" href="#id7" role="doc-backlink">DCCEXProtocol_Multi_Throttle_Control</a><a class="headerlink" href="#dccexprotocol-multi-throttle-control" title="Link to this heading"></a></h2>
<p>This example demonstrates how client throttle software may be written to control multiple locomotives (or consists for that matter) concurrently.</p>
<p>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.</p>
<p>Note when setting speed and direction, these should be sent to the <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> via the <span class="ex-prefix">DCCEX</span><span class="ex-suffix">Protocol library</span>, and any local references to these should be set based on the response received, not directly by the input method in use.</p>
<p>Note when setting speed and direction, these should be sent to the <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> via the <span class="ex-prefix">DCCEX</span><span class="ex-suffix">Protocol library</span>, and any local references to these should be set based on the response received, not directly by the input method in use.</p>
<p>For example, when setting the speed based on the position of a rotary encoder, send that value via the protocol’s <cite>setThrottle()</cite> method, but do not display that speed directly. Instead, utlise the delegate’s <cite>receivedLocoUpdate()</cite> method to update the displayed speed.</p>
<p>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.</p>
</section>
Expand All @@ -565,15 +565,15 @@ <h2><a class="toc-backref" href="#id8" role="doc-backlink">DCCEXProtocol_Track_t
<hr class="docutils" />
<section id="additional-examples">
<h2><a class="toc-backref" href="#id9" role="doc-backlink">Additional Examples</a><a class="headerlink" href="#additional-examples" title="Link to this heading"></a></h2>
<p>The following examples are not strictly related to the <span class="ex-prefix">DCCEX</span><span class="ex-suffix">Protocol library</span>, but hopefully will be useful for anyone developing a throttle to use with any <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span>.</p>
<p>The following examples are not strictly related to the <span class="ex-prefix">DCCEX</span><span class="ex-suffix">Protocol library</span>, but hopefully will be useful for anyone developing a throttle to use with any <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>.</p>
<section id="dccexprotocol-ssid">
<h3><a class="toc-backref" href="#id10" role="doc-backlink">DCCEXProtocol_SSID</a><a class="headerlink" href="#dccexprotocol-ssid" title="Link to this heading"></a></h3>
<p>This example demonstrates how client throttle software may be written to find all the SSIDs (networks) that are available.</p>
</section>
<section id="dccexprotocol-mdns">
<h3><a class="toc-backref" href="#id11" role="doc-backlink">DCCEXProtocol_mDNS</a><a class="headerlink" href="#dccexprotocol-mdns" title="Link to this heading"></a></h3>
<p>This example demonstrates how client throttle software may be written to find all the <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> and WiThrottle servers that are advertising via mDNS.</p>
<p>Note that <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> only advertise as <code class="docutils literal notranslate"><span class="pre">wiThrottle</span></code> servers, but will use and respond with either the <strong>WiThrottle protocol</strong> or the <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span>
<p>This example demonstrates how client throttle software may be written to find all the <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> and WiThrottle servers that are advertising via mDNS.</p>
<p>Note that <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> only advertise as <code class="docutils literal notranslate"><span class="pre">wiThrottle</span></code> servers, but will use and respond with either the <strong>WiThrottle protocol</strong> or the <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span>
<span class="ex-suffix"> native command protocol</span> depending the type of command it first receives from the client (throttle).</p>
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ <h1>Documentation for the DCC-EX Native command protocol library - DCCEXProtocol
<section id="dcc-ex-native-command-protocol-library">
<h2>DCC-EX Native command protocol library<a class="headerlink" href="#dcc-ex-native-command-protocol-library" title="Link to this heading"></a></h2>
<p>This library implements the <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span>
<span class="ex-suffix"> native command protocol</span> (as used in the <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> ONLY), allowing a device to connect to the server and act as a client (such as a hardware based throttle).</p>
<span class="ex-suffix"> native command protocol</span> (as used in the <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> ONLY), allowing a device to connect to the server and act as a client (such as a hardware based throttle).</p>
<p>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.</p>
<p>There has also been limited testing on STM32F103C8 Bluepill with a serial connection.</p>
</section>
Expand Down
6 changes: 3 additions & 3 deletions overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ <h1>Library Design Principles<a class="headerlink" href="#library-design-princip
<span class="ex-suffix"> native command protocol</span>.</p>
<section id="dccexprotocol-class">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">DCCEXProtocol Class</a><a class="headerlink" href="#dccexprotocol-class" title="Link to this heading"></a></h2>
<p>The <cite>DCCEXProtocol</cite> class manages all relevant objects advertised by a <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> and exposes simple methods to control these objects from the client software.</p>
<p>The <cite>DCCEXProtocol</cite> class manages all relevant objects advertised by a <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> and exposes simple methods to control these objects from the client software.</p>
<p>These objects include:</p>
<ul class="simple">
<li><p>Roster entries</p></li>
Expand All @@ -523,8 +523,8 @@ <h2><a class="toc-backref" href="#id1" role="doc-backlink">DCCEXProtocol Class</
</section>
<section id="dccexprotocoldelegate-class">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">DCCEXProtocolDelegate Class</a><a class="headerlink" href="#dccexprotocoldelegate-class" title="Link to this heading"></a></h2>
<p>The <cite>DCCEXProtocolDelegate</cite> class enables the client software to respond to various events generated by a <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> as either broadcasts or responses to commands.</p>
<p>The events able to be managed via this class are over and above those managed by the <cite>DCCEXProtocol</cite> 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 <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span>.</p>
<p>The <cite>DCCEXProtocolDelegate</cite> class enables the client software to respond to various events generated by a <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> as either broadcasts or responses to commands.</p>
<p>The events able to be managed via this class are over and above those managed by the <cite>DCCEXProtocol</cite> 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 <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>.</p>
</section>
</section>

Expand Down
6 changes: 3 additions & 3 deletions usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ <h1>Usage<a class="headerlink" href="#usage" title="Link to this heading"></a
</ul>
</nav>
</aside>
<p>Whilst this library extrapolates the need for understanding the specific <span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span> native commands from a throttle developer, it is highly recommended to familiarise yourself with the concepts outlined in the <a class="reference external" href="https://dcc-ex.com/throttles/tech-reference.html">https://dcc-ex.com/throttles/tech-reference.html</a>.</p>
<p>Whilst this library extrapolates the need for understanding the specific <a href="https://dcc-ex.com/"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a> native commands from a throttle developer, it is highly recommended to familiarise yourself with the concepts outlined in the <a class="reference external" href="https://dcc-ex.com/throttles/tech-reference.html">https://dcc-ex.com/throttles/tech-reference.html</a>.</p>
<section id="setup">
<h2><a class="toc-backref" href="#id1" role="doc-backlink">Setup</a><a class="headerlink" href="#setup" title="Link to this heading"></a></h2>
<p>Once the <cite>DCCEXProtocol</cite> object is instantiated, a connection must be made to the <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span> using the <cite>connect(&amp;stream)</cite> method and providing a suitable Arduino Stream, such as a WiFi client or serial connection.</p>
<p>Once the <cite>DCCEXProtocol</cite> object is instantiated, a connection must be made to the <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a> using the <cite>connect(&amp;stream)</cite> method and providing a suitable Arduino Stream, such as a WiFi client or serial connection.</p>
<p>It is also recommended to enable logging to an Arduino Stream using the <cite>setLogStream(&amp;stream)</cite> method.</p>
<p>As covered in the design principles above, you must include the <cite>check()</cite> 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 <cite>DCCEXProtocolDelegate</cite> class.</p>
<p>Refer to the <a class="reference internal" href="examples.html"><span class="doc">Examples</span></a> to see how this may be implemented.</p>
Expand All @@ -525,7 +525,7 @@ <h2><a class="toc-backref" href="#id2" role="doc-backlink">Control and Inputs</a
</section>
<section id="retrieving-and-referring-to-object-lists">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Retrieving and referring to object lists</a><a class="headerlink" href="#retrieving-and-referring-to-object-lists" title="Link to this heading"></a></h2>
<p>To retrieve the various objects lists from <span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span>, use the <cite>getLists(bool rosterRequired, bool turnoutListRequired, bool routeListRequired, bool turntableListRequired)</cite> method within your <cite>loop()</cite> function to ensure these are retrieved successfully.</p>
<p>To retrieve the various objects lists from <a href="https://dcc-ex.com/"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>, use the <cite>getLists(bool rosterRequired, bool turnoutListRequired, bool routeListRequired, bool turntableListRequired)</cite> method within your <cite>loop()</cite> function to ensure these are retrieved successfully.</p>
<p>All objects are contained within linked lists and can be access via for loops:</p>
<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">Loco</span><span class="o">*</span><span class="w"> </span><span class="n">loco</span><span class="o">=</span><span class="n">dccexProtocol</span><span class="p">.</span><span class="n">roster</span><span class="o">-&gt;</span><span class="n">getFirst</span><span class="p">();</span><span class="w"> </span><span class="n">loco</span><span class="p">;</span><span class="w"> </span><span class="n">loco</span><span class="o">=</span><span class="n">loco</span><span class="o">-&gt;</span><span class="n">getNext</span><span class="p">())</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// loco methods are available here</span>
Expand Down

0 comments on commit 5c63cd9

Please sign in to comment.