node-red-contrib-vscp-tcp
Version:

149 lines (130 loc) • 5.83 kB
HTML
<!--
MIT License
Copyright (c) 2020 Åke Hedman, Grodans Paradis AB
This file is part of the VSCP (https://www.vscp.org)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<script type="text/javascript">
RED.nodes.registerType('vscp-tcp-out',{
category: 'vscp',
defaults: {
name: {value:"", required:true},
host: {value:"", required:true, type:"vscp-tcp-config-host"},
username: {value:"admin", required:true},
password: {value:"secret", required:true},
keyctx: {value:"", required:false},
},
credentials: {
username: {type:"text"},
password: {type:"password"}
},
color:"#ffe033",
inputs:1,
outputs:0,
icon: "font-awesome/fa-chevron-left",
label: function() {
return this.name||"VSCP";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>
<script type="text/x-red" data-template-name="vscp-tcp-out">
<hr />
<div class="form-row">
<label for="node-input-host"><i class="fa fa-server"></i> Host</label>
<input id="node-input-host" >
</div>
<div class="form-row">
<label for="node-input-username"><i class="fa fa-user"></i> Username</label>
<input type="text" id="node-input-username" placeholder="Username">
</div>
<div class="form-row">
<label for="node-input-password"><i class="fa fa-key"></i> Password</label>
<input type="password" id="node-input-password" placeholder="Password">
</div>
<div class="form-row">
<label for="node-input-keyctx"><i class="fa fa-tag"></i> Context key</label>
<input type="text" id="node-input-keyctx" placeholder="Context">
</div>
<hr />
<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="vscp-tcp-out">
<p>VSCP tcp/ip output connection. Use to connects to a remote VSCP
tcp/ip host that export the VSCP tcp/ip link interface and
send events to the remote host.</p>
<h3>Inputs</h3>
<dl class="message-properties">
There is no inputs on this node.
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Standard output
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd>VSCP events will be posted here as a Javascript object
when they are received from the remote host.</dd>
</dl>
</li>
</ol>
<h3>Details</h3>
The VSCP tcp/ip link interface is an interface that allows a remote
machine or user to control a VSCP hardware device or some software like
the VSCP daemon. The interface allows for filtering and for sending AND
receiving VSCP events among many other things.
A VSCP event object have thew following content
<pre>
{
vscpHead: 3,
vscpClass: 10,
vscpType: 6,
vscpObId: 0,
vscpTimeStamp: 0,
vscpDateTime: 2020-02-11T17:00:02.000Z,
vscpGuid: 'FF:FF:FF:FF:FF:FF:FF:FE:B8:27:EB:40:59:96:00:01',
vscpData: [ 1,2,3,4,5 ]
}
</pre>
<p><b>vscpTimeStamp</b>, <b>vscpObId</b> and <b>vscpDateTime</b> and be omitted and
will still automatically get meaningful defaults. <b>vscpHead</b> can also often
be omitted and if so will then be set to zero. <b>vscpGuid/b> can be set to '-'
to be set to the GUID of <b>remote interface</b> which is enough to identify a
common client. See <a href="https://docs.vscp.org/spec/latest">VSCP Specification</a> for VSCP class/type's and
data content.</p>
<p>Even if the object form is the preferred event format it is also possible to send
VSCP events on string form. The string form is define as</p>
<pre>
vscpHead,vscpClass,vscpType,vscpObId,vscpDateTime,vscpTimeTamp,vscpGuid,vscpData...
</pre>
which can be simplified as
<pre>
vscpHead,vscpClass,vscpType,,,,-,vscpData...
</pre>
<h3>References</h3>
<ul>
<li><a>https://docs.vscp.org/spec/latest</a> - VSCP Specifircation</li>
<li><a>https://docs.vscp.org/vscpd/latest/#/./tcp_ip_protocol_description</a> - full description of <code>VSCP tcp/ip link</code> protocol</li>
<li><a>https://docs.vscp.org/</a> - documentation for VSCP</li>
<li><a>https://github.com/grodansparadis/node-red-contrib-vscp-tcp</a> - the nodes github repository</li>
<li><a>https://www.vscp.org/</a> - home of VSCP</li>
</ul>
</script>