UNPKG

cbuslibrary

Version:

Library to decode & encode CBUS messages

4,237 lines (1,126 loc) 302 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: cbusLibrary</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: cbusLibrary</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>cbusLibrary<span class="signature">()</span><span class="type-signature"></span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="cbusLibrary"><span class="type-signature"></span>new cbusLibrary<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line48">line 48</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(message)</span><span class="type-signature"> &rarr; {Object}</span></h4> <div class="description"> Decode a CBUS message<br> This will decode both 11 bit ID CBUS messages and also 29 bit extended messages, as these are identified in the message itself <br> The actual CBUS messsage is expected to be in 'Grid connect' ASCII format, either as a plain string<br> or as the 'encoded' property in a JSON object<br> NOTE: doesn't preserve the original input JSON, but creates new JSON object as output </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">CAN BUS message in a plain string or JSON format ('Grid connect' ASCII)</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line151">line 151</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Decoded properties as a JSON structure - content dependant on specific message, but will always have 'encoded' as the original input message, and also 'ID_TYPE' & 'text' elements<br> 'ID_TYPE' will be either 'S' (11 bit CBUS message) or 'X' (29 bit extended message) - or blank if not valid </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>// 11 bit CBUS message { "encoded": ":SA780NE1FF00007F01FF01;", "ID_TYPE":"S", "mnemonic": "PLOC", "opCode": "E1", "session": 255, "address": 0, "speed": 127, "direction": "Reverse", "Fn1": 1, "Fn2": 255, "Fn3": 1, "text": "PLOC (E1) Session 255 Address 0 Speed/Dir 127 Direction Reverse Fn1 1 Fn2 255 Fn3 1" } // 29 bit firmware download control message { "encoded":":X00080004N000000000D040000;", "ID_TYPE":"X", "operation":"PUT", "type":"CONTROL", "address":"000000", "RESVD":0, "CTLBT":13, "SPCMD":4, "CPDTL":0, "CPDTH":0 "text": {"encoded":":X00080004N000000000D040000;","ID_TYPE":"X","operation":"PUT","type":"CONTROL","address":"000000","RESVD":0,"CTLBT":13,"SPCMD":4,"CPDTL":0,"CPDTH":0} }</code></pre> <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(message)</span><span class="type-signature"> &rarr; {Object}</span></h4> <div class="description"> encode a CBUS message<br> This will encode either a 11 bit 'standard' or 29 bit 'extended' ID CBUS message from a supplied JSON object into a 'grid connect' ascii format<br> If the correct JSON properties for the parameters for the encoding are not present, an exception will be thrown<br> The JSON properties shared by both encode() & decode() are identical - however note decode() may return more properties than encode() requires<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">CBUS message properties as a JSON object</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line649">line 649</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> returns the original input JSON object with the resultant encoded CBUS message added using the 'encoded' property </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h4 class="name" id="encode_EXT_PUT_CONTROL"><span class="type-signature"></span>encode_EXT_PUT_CONTROL<span class="signature">(address, CTLBT, SPCMD, CPDTL, CPDTH)</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> 29 bit Extended CAN Identifier 'Put Control' firmware download message<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>address</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">6 digit hexadecimal number 000000 to FFFFFF</td> </tr> <tr> <td class="name"><code>CTLBT</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>SPCMD</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>CPDTL</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>CPDTH</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line1489">line 1489</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Example :X00080004N000000000D040000;<br> 29 bit fixed header (:X00080004N.......) </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="encode_EXT_PUT_DATA"><span class="type-signature"></span>encode_EXT_PUT_DATA<span class="signature">(data)</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> 29 bit Extended CAN Identifier 'Put Data' firmware download message<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>data</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="description last">8 byte data array</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line1502">line 1502</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Example :X00080005N20EF04F0FFFFFFFF;<br> 29 bit fixed header (:X00080004N.......) </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="encode_EXT_RESPONSE"><span class="type-signature"></span>encode_EXT_RESPONSE<span class="signature">(response)</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> 29 bit Extended CAN Identifier firmware download 'response' message<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>response</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">response number to firmware download control message</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line1522">line 1522</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Example :X80180004N02;<br> 29 bit fixed header (:X80080000N.......) </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="encodeACDAT"><span class="type-signature"></span>encodeACDAT<span class="signature">(nodeNumber, data1, data2, data3, data4, data5)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode F6<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data2</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data3</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data4</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data5</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line5033">line 5033</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltF6&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&ltdata1&gt&ltdata2&gt&ltdata3&gt&ltdata4&gt&ltdata5&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACK"><span class="type-signature"></span>encodeACK<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode 00<br> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line1542">line 1542</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=2&gt&ltCANID&gt]&lt00&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACOF"><span class="type-signature"></span>encodeACOF<span class="signature">(nodeNumber, eventNumber)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode 91<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3157">line 3157</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&lt91&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACOF1"><span class="type-signature"></span>encodeACOF1<span class="signature">(nodeNumber, eventNumber, data1)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode B1<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3726">line 3726</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltB1&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACOF2"><span class="type-signature"></span>encodeACOF2<span class="signature">(nodeNumber, eventNumber, data1, data2)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode D1<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data2</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line4254">line 4254</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltD1&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt&ltdata2&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACOF3"><span class="type-signature"></span>encodeACOF3<span class="signature">(nodeNumber, eventNumber, data1, data2, data3)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode F1<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data2</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data3</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line4847">line 4847</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltF1&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt&ltdata2&gt&ltdata3&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACON"><span class="type-signature"></span>encodeACON<span class="signature">(nodeNumber, eventNumber)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode 90<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3129">line 3129</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&lt90&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACON1"><span class="type-signature"></span>encodeACON1<span class="signature">(nodeNumber, eventNumber, data1)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode B0<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3695">line 3695</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltB0&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACON2"><span class="type-signature"></span>encodeACON2<span class="signature">(nodeNumber, eventNumber, data1, data2)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode D0<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data2</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line4220">line 4220</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltD0&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt&ltdata2&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeACON3"><span class="type-signature"></span>encodeACON3<span class="signature">(nodeNumber, eventNumber, data1, data2, data3)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode F0<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data2</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data3</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line4810">line 4810</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltF0&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt&ltdata2&gt&ltdata3&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeALOC"><span class="type-signature"></span>encodeALOC<span class="signature">(session, allocatonCode)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode 43<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>session</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">number 0 to 255</td> </tr> <tr> <td class="name"><code>allocatonCode</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">number 0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line2069">line 2069</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=2&gt&ltCANID&gt]&lt43&gt&ltsession&gt&ltallocatonCode&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeARDAT"><span class="type-signature"></span>encodeARDAT<span class="signature">(nodeNumber, data1, data2, data3, data4, data5)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode F7<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data2</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data3</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data4</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> <tr> <td class="name"><code>data5</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line5077">line 5077</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltF7&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&ltdata1&gt&ltdata2&gt&ltdata3&gt&ltdata4&gt&ltdata5&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeAREQ"><span class="type-signature"></span>encodeAREQ<span class="signature">(nodeNumber, eventNumber)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode 92<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3185">line 3185</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&lt92&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeAROF"><span class="type-signature"></span>encodeAROF<span class="signature">(nodeNumber, eventNumber)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode 94<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3241">line 3241</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&lt94&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeAROF1"><span class="type-signature"></span>encodeAROF1<span class="signature">(nodeNumber, eventNumber, data1)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode B4<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>eventNumber</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 65535</td> </tr> <tr> <td class="name"><code>data1</code></td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">0 to 255</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cbuslibrary.js.html">cbuslibrary.js</a>, <a href="cbuslibrary.js.html#line3818">line 3818</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> CBUS message encoded as a 'Grid Connect' ASCII string<br> Format: [&ltMjPri&gt&ltMinPri=3&gt&ltCANID&gt]&ltB4&gt&ltnodeNumber hi&gt&ltnodeNumber lo&gt&lteventNumber hi&gt&lteventNumber lo&gt&ltdata1&gt </div> <dl> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="encodeAROF2"><span class="type-signature"></span>encodeAROF2<span class="signature">(nodeNumber, eventNumber, data1, data2)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> opCode D5<br> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>nodeNumber</code></td> <td class="type"> <span class="param-type">int</span> </td>