UNPKG

nimcodec

Version:

Encoder/decoder for satellite IoT using Non-IP Messages

1,296 lines (545 loc) 22.9 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Namespace: nimo</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <script src="scripts/jquery.min.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/bootstrap.min.css"> <link type="text/css" rel="stylesheet" href="styles/jaguar.css"> <script> var config = {"monospaceLinks":false,"cleverLinks":true,"default":{}}; </script> </head> <body> <div id="wrap" class="clearfix"> <div class="navigation"> <h3 class="applicationName"><a href="index.html"></a></h3> <div class="search"> <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations"> </div> <ul class="list"> <li class="item" data-name="field"> <span class="title"> <a href="field.html">field</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.array"> <span class="title"> <a href="field.array.html">field.array</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.bitkeylist"> <span class="title"> <a href="field.bitkeylist.html">field.bitkeylist</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.bool"> <span class="title"> <a href="field.bool.html">field.bool</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.data"> <span class="title"> <a href="field.data.html">field.data</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.enum"> <span class="title"> <a href="field.enum.html">field.enum</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.int"> <span class="title"> <a href="field.int.html">field.int</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.string"> <span class="title"> <a href="field.string.html">field.string</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="field.uint"> <span class="title"> <a href="field.uint.html">field.uint</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="nimo"> <span class="title"> <a href="nimo.html">nimo</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="nimo.decodeMessage"><a href="nimo.html#.decodeMessage">decodeMessage</a></li> <li data-name="nimo.encodeMessage"><a href="nimo.html#.encodeMessage">encodeMessage</a></li> <li data-name="nimo.exportJson"><a href="nimo.html#.exportJson">exportJson</a></li> <li data-name="nimo.exportXml"><a href="nimo.html#.exportXml">exportXml</a></li> <li data-name="nimo.importCodec"><a href="nimo.html#.importCodec">importCodec</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="types"> <span class="title"> <a href="types.html">types</a> <span class="static">static</span> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> <span class="subtitle">Typedefs</span> <li data-name="types.Field"><a href="types.html#.Field">Field</a></li> <li data-name="types.FieldType"><a href="types.html#.FieldType">FieldType</a></li> <li data-name="types.Message"><a href="types.html#.Message">Message</a></li> <li data-name="types.NimoCodec"><a href="types.html#.NimoCodec">NimoCodec</a></li> <li data-name="types.Service"><a href="types.html#.Service">Service</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> </ul> <ul class="events itemMembers"> </ul> </li> </ul> </div> <div class="main"> <h1 class="page-title" data-filename="nimo.html">Namespace: nimo</h1> <section> <header> <h2> nimo </h2> </header> <article> <div class="container-overview"> <div class="description"><p>Codec functions for Non-IP Modems based on ORBCOMM protocols</p></div> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <dl> <dt> <div class="nameContainer"> <h4 class="name" id=".decodeMessage"> <span class="type-signature static">static</span>nimo.decodeMessage<span class="signature">(payloadRaw, codec, <span class="optional">isMo</span>)</span> </h4> <div class="tag-source"> nimo/message.js, line 22 </div> </div> </dt> <dd> <div class="description"> <p>Decode a message from its raw payload using a specified codec. The codec may specify a path to a compliant XML or JSON file, or be a compliant string or object conforming to <code>NimoCodec</code> structure.</p> </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>payloadRaw</code></td> <td class="type"> <span class="param-type">Array.&lt;number></span> | <span class="param-type">Buffer</span> </td> <td class="default"> </td> <td class="description last"> <p>Decimal bytes or Buffer sent over the air</p></td> </tr> <tr> <td class="name"><code>codec</code></td> <td class="type"> <span class="param-type">NimoCodec</span> | <span class="param-type">string</span> </td> <td class="default"> </td> <td class="description last"> <p>The codec may be a file path, string or object</p></td> </tr> <tr> <td class="name"><code>isMo</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="default"> true </td> <td class="description last"> <span class="optional">optional</span> <p>Indicates if the message was Mobile-Originated</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> A decoded <code>Message</code> or empty object </dd> <dt> <div class="nameContainer"> <h4 class="name" id=".encodeMessage"> <span class="type-signature static">static</span>nimo.encodeMessage<span class="signature">(message, codec, isMo)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Buffer}</span> </h4> <div class="tag-source"> nimo/message.js, line 79 </div> </div> </dt> <dd> <div class="description"> <p>Encode a <code>Message</code> object to a bytes buffer using the specified codec.</p> </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>message</code></td> <td class="type"> <span class="param-type">Message</span> </td> <td class="default"> </td> <td class="description last"> <p>The <code>Message</code> object to encode</p></td> </tr> <tr> <td class="name"><code>codec</code></td> <td class="type"> <span class="param-type">NimoCodec</span> | <span class="param-type">String</span> </td> <td class="default"> </td> <td class="description last"> <p>The <code>NimoCodec</code> or file path to use</p></td> </tr> <tr> <td class="name"><code>isMo</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="default"> false </td> <td class="description last"> <p>Set if the message is Mobile-Originated (default false)</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Throws:</h5> <div class="param-desc"> <p>If unable to process the codec or message</p> </div> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> Buffer </td> <td class="description last">The encoded message buffer</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id=".exportJson"> <span class="type-signature static">static</span>nimo.exportJson<span class="signature">(codec, filepath)</span> </h4> <div class="tag-source"> nimo/codeckey.js, line 181 </div> </div> </dt> <dd> <div class="description"> <p>Export to NIM codec key file format</p> </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>codec</code></td> <td class="type"> <span class="param-type">NimoCodec</span> </td> <td class="description last"> </td> </tr> <tr> <td class="name"><code>filepath</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"> </td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id=".exportXml"> <span class="type-signature static">static</span>nimo.exportXml<span class="signature">(codec, filepath)</span> </h4> <div class="tag-source"> nimo/codeckey.js, line 192 </div> </div> </dt> <dd> <div class="description"> <p>Expert to IDPMSG/XML format (PLACEHOLDER NOT IMPLEMENTED)</p> </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>codec</code></td> <td class="type"> <span class="param-type">NimoCodec</span> </td> <td class="description last"> <p>The codec key object</p></td> </tr> <tr> <td class="name"><code>filepath</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"> <p>The location/name of the file to output</p></td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> <dt> <div class="nameContainer"> <h4 class="name" id=".importCodec"> <span class="type-signature static">static</span>nimo.importCodec<span class="signature">(codec)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{NimoCodec}</span> </h4> <div class="tag-source"> nimo/codeckey.js, line 140 </div> </div> </dt> <dd> <div class="description"> <p>Imports and basic sanity on the specified <code>NimCodec</code> key. Accepts valid <code>NimoCodec</code>, string representation in XML or JSON, or the path to a valid XML(.idpmsg) or JSON file.</p> </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>codec</code></td> <td class="type"> <span class="param-type">NimoCodec</span> | <span class="param-type">string</span> </td> <td class="description last"> <p>Codec object, string or file path</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Throws:</h5> <div class="param-desc"> <p>If unable to parse or validate the codec</p> </div> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> NimoCodec </td> <td class="description last">valid Codec object</td> </tr> </tbody> </table> </dd> </dl> </article> </section> <footer> Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Feb 05 2024 16:52:36 GMT-0500 (Eastern Standard Time) </footer> </div> </div> <script>prettyPrint();</script> <script src="scripts/jaguar.js"></script> </body> </html>