p5.serialport
Version:
Library for serial port and p5.js
1,129 lines (247 loc) • 12.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</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">Global</h1>
<section>
<header>
<h2></h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="clients"><span class="type-signature"></span>clients<span class="type-signature"> :Array.<<a href="Client.html">Client</a>></span></h4>
<div class="description">
<p>Array of all connected <a href="Client.html"><code>Client</code></a> objects.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<<a href="Client.html">Client</a>></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line40">line 40</a>
</li></ul></dd>
</dl>
<h4 class="name" id="LOGGING"><span class="type-signature"></span>LOGGING<span class="type-signature"> :Boolean</span></h4>
<div class="description">
<p>Variable to decide whether to console.log detailed messages</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Boolean</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line19">line 19</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serialPorts"><span class="type-signature"></span>serialPorts<span class="type-signature"> :Array.<<a href="SerialPort.html">SerialPort</a>></span></h4>
<div class="description">
<p>Array of all opened <a href="SerialPort.html"><code>SerialPort</code></a> objects.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<<a href="SerialPort.html">SerialPort</a>></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line35">line 35</a>
</li></ul></dd>
</dl>
<h4 class="name" id="serialPortsList"><span class="type-signature"></span>serialPortsList<span class="type-signature"> :Array.<String></span></h4>
<div class="description">
<p>Array of all opened serial port names in string.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Array.<String></span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line30">line 30</a>
</li></ul></dd>
</dl>
<h4 class="name" id="wss"><span class="type-signature"></span>wss<span class="type-signature"> :ws</span></h4>
<div class="description">
<p>Web socket server. Initialized in start() function.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">ws</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line24">line 24</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="logit"><span class="type-signature"></span>logit<span class="signature">(mess)</span><span class="type-signature"></span></h4>
<div class="description">
<p>console.log log messages when LOGGING == true</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>mess</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>String to log when LOGGING == true</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="classes_Client.js.html">classes/Client.js</a>, <a href="classes_Client.js.html#line89">line 89</a>
</li></ul></dd>
</dl>
<h4 class="name" id="logit"><span class="type-signature"></span>logit<span class="signature">(mess)</span><span class="type-signature"></span></h4>
<div class="description">
<p>console.log log messages when LOGGING == true</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>mess</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>String to log when LOGGING == true</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="classes_SerialPort.js.html">classes/SerialPort.js</a>, <a href="classes_SerialPort.js.html#line171">line 171</a>
</li></ul></dd>
</dl>
<h4 class="name" id="logit"><span class="type-signature"></span>logit<span class="signature">(mess)</span><span class="type-signature"></span></h4>
<div class="description">
<p>console.log log messages when LOGGING == true</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>mess</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>String to log when LOGGING == true</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line42">line 42</a>
</li></ul></dd>
</dl>
<h4 class="name" id="start"><span class="type-signature"></span>start<span class="signature">(port)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Initialize web socket server at port 8081. Initialize web socket clients on connection by creating a <a href="Client.html"><code>Client</code></a> object and create a (@link SerialPort SerialPort} object after determining that it has not been opened already. Initialize web socket client message events.</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>port</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>port number used to open web socket server.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line52">line 52</a>
</li></ul></dd>
</dl>
<h4 class="name" id="stop"><span class="type-signature"></span>stop<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Stops web socket server after closing all <a href="SerialPort.html"><code>SerialPort</code></a> connections and <a href="Client.html"><code>Client</code></a> connections</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="p5.serialserver.js.html">p5.serialserver.js</a>, <a href="p5.serialserver.js.html#line196">line 196</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Client.html">Client</a></li><li><a href="SerialPort.html">SerialPort</a></li></ul><h3>Events</h3><ul><li><a href="Client.html#event:message">message</a></li></ul><h3>Global</h3><ul><li><a href="global.html#clients">clients</a></li><li><a href="global.html#LOGGING">LOGGING</a></li><li><a href="global.html#logit">logit</a></li><li><a href="global.html#serialPorts">serialPorts</a></li><li><a href="global.html#serialPortsList">serialPortsList</a></li><li><a href="global.html#start">start</a></li><li><a href="global.html#stop">stop</a></li><li><a href="global.html#wss">wss</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Sun Jul 17 2022 21:38:31 GMT-0400 (Chile Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>