node-red-contrib-slip
Version:
SLIP decoding and encoding for Node-RED
54 lines (47 loc) • 1.79 kB
HTML
<!--
Copyright 2016 Nicholas Humfrey, Nathanaël Lécaudé.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-template-name="slip">
<div class="form-row">
<label for="node-input-mode"><i class="fa fa-exchange"></i> Mode</label>
<select class="form-control" id="node-input-mode">
<option value="encode">Encode to SLIP</option>
<option value="decode">Decode from SLIP</option>
</select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="slip">
<p>Decode and encode messages using the
<a href="https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol">SLIP protocol</a>.
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('slip',{
category: 'function',
color:"#6e917b",
defaults: {
name: {value:""},
mode: {value:"", required:true}
},
inputs:1,
outputs:1,
icon: "slip.png",
align: "left",
label: function() {
return this.name||"slip "+this.mode;
}
});
</script>