smoke-signal-js
Version:
A JavaScript port of Tobster's TobComm.
1,228 lines (306 loc) • 15 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Global - Documentation</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.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav >
<input type="text" id="nav-search" placeholder="Search" />
<h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/Smoke3785/smokesignal-js" target="_blank" class="menu-item" id="repository" >Github repo</a></h2><h3>Global</h3><ul><li><a href="global.html#getRequestObjectData">getRequestObjectData</a></li><li><a href="global.html#getSendCommandData">getSendCommandData</a></li><li><a href="global.html#getSendObjectData">getSendObjectData</a></li><li><a href="global.html#processBytes">processBytes</a></li><li><a href="global.html#requestObject">requestObject</a></li><li><a href="global.html#sendCommand">sendCommand</a></li><li><a href="global.html#sendObject">sendObject</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="getRequestObjectData"><span class="type-signature"></span>getRequestObjectData<span class="signature">({lObject,)</span><span class="type-signature"> → {bytebuffer}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line52">line 52</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Encodes data required to make an object request to a LaunchLike server.</p>
</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>{lObject,</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>lInstanceNumber, lStart, lLength}</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">bytebuffer</span>
</dd>
</dl>
<h4 class="name" id="getSendCommandData"><span class="type-signature"></span>getSendCommandData<span class="signature">({lCommand,)</span><span class="type-signature"> → {bytebuffer}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Encodes data required to send a command to a LaunchLike server.</p>
</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>{lCommand,</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>lInstanceNumber}</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">bytebuffer</span>
</dd>
</dl>
<h4 class="name" id="getSendObjectData"><span class="type-signature"></span>getSendObjectData<span class="signature">({)</span><span class="type-signature"> → {bytebuffer}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Encodes an object into a Tobject ( a bytebuffer prepended with metadata) to send data to a LaunchLike server.</p>
</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>{</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>lObject, lInstanceNumber, lStart, cData }</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">bytebuffer</span>
</dd>
</dl>
<h4 class="name" id="processBytes"><span class="type-signature">(async) </span>processBytes<span class="signature">(cData, context)</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="index.js.html">index.js</a>, <a href="index.js.html#line123">line 123</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Takes a Tobject and parses out a message type definition and length for the data.
The function then calls a handler method of the context which was provided to it with the transcribed data.</p>
</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>cData</code></td>
<td class="type">
<span class="param-type">bytebuffer</span>
</td>
<td class="description last"><p>The data which you wish to decode</p></td>
</tr>
<tr>
<td class="name"><code>context</code></td>
<td class="type">
<span class="param-type">class</span>
</td>
<td class="description last"><p>The class context from which you're calling this function.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>Nothing. This calls a function within the class context provided to it.</p>
</div>
<h4 class="name" id="requestObject"><span class="type-signature"></span>requestObject<span class="signature">({cData})</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="index.js.html">index.js</a>, <a href="index.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Requests an object from a LaunchLike server with the given code.</p>
</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>{cData}</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>An object containing the request code, the instance number, the starting position, and the length. Generally only the data is provided.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>Nothing. This calls a function within the class context provided to it.</p>
</div>
<h4 class="name" id="sendCommand"><span class="type-signature"></span>sendCommand<span class="signature">({lObject,)</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="index.js.html">index.js</a>, <a href="index.js.html#line72">line 72</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Requests a command from a LaunchLike server with the given code.</p>
</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>{lObject,</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>lInstanceNumber}</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>Nothing. This calls a function within the class context provided to it.</p>
</div>
<h4 class="name" id="sendObject"><span class="type-signature"></span>sendObject<span class="signature">({lObject,)</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="index.js.html">index.js</a>, <a href="index.js.html#line85">line 85</a>
</li></ul></dd>
</dl>
<div class="description usertext">
<p>Sends an object from a LaunchLike server with the given code and data.</p>
</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>{lObject,</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last"><p>lInstanceNumber, lStart, cData}</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>Nothing. This calls a function within the class context provided to it.</p>
</div>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu May 19 2022 14:49:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>
<script src="scripts/search.js" defer></script>
<script src="scripts/collapse.js" defer></script>
</body>
</html>