2015-11-23 16:24:26 +01:00
|
|
|
<!--
|
|
|
|
Copyright 2015 IBM Corp.
|
|
|
|
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="PhysicalWeb in">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
|
2016-03-02 22:57:53 +01:00
|
|
|
<input type="text" id="node-input-topic" placeholder="eddystone">
|
2015-11-23 16:24:26 +01:00
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<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="PhysicalWeb in">
|
2016-03-02 22:57:53 +01:00
|
|
|
<p><a href="https://google.github.io/physical-web/">Physical Web</a> node to scan for Eddystone beacons.</p>
|
|
|
|
<p>This node scans for Eddystones and publishes what it finds. It can output 2 types of message</p>
|
|
|
|
<ul>
|
|
|
|
<li><strong>URL</strong> -
|
2015-11-23 16:24:26 +01:00
|
|
|
<ul>
|
|
|
|
<li>type - Eddystone type</li>
|
|
|
|
<li>txPower - Received power at 0m in dBm</li>
|
|
|
|
<li>url - The URL the beacon is broadcasting</li>
|
|
|
|
<li>tlm - TLM data, if the device is interleaving broadcasts</li>
|
|
|
|
<li>rssi - RSSI of the beacon</li>
|
|
|
|
<li>distance - Estimated distance to the beacon</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2016-03-02 22:57:53 +01:00
|
|
|
<li><strong>UID</strong> -
|
2015-11-23 16:24:26 +01:00
|
|
|
<ul>
|
|
|
|
<li>type - Eddystone type</li>
|
|
|
|
<li>txPower - Received power at 0m in dBm</li>
|
|
|
|
<li>namespace - 10-byte ID of namspace</li>
|
|
|
|
<li>instance - 6-byte ID insance</li>
|
|
|
|
<li>tlm - TLM data, if the device is interleaving broadcasts</li>
|
|
|
|
<li>rssi - RSSI of the beacon</li>
|
|
|
|
<li>distance - Estimated distance to the beacon</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p>Where the tlm data will be in the following format</p>
|
|
|
|
<ul>
|
|
|
|
<li>tlm -
|
|
|
|
<ul>
|
|
|
|
<li>version - TML version</li>
|
|
|
|
<li>vbatt - Battery Voltage</li>
|
|
|
|
<li>temp - Temperature</li>
|
|
|
|
<li>advCnt - Advertising PDU count</li>
|
|
|
|
<li>secCnt - Time since power on or reboot</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li>rssi - RSSI of diecovered beacon</li>
|
|
|
|
<li>distance - Approximate distance to beacon</li>
|
|
|
|
</ul>
|
2016-03-02 22:57:53 +01:00
|
|
|
<p>Linux users should <a href="https://github.com/sandeepmistry/bleno#running-on-linux" target="_new">READ THIS</a>.</p>
|
2015-11-23 16:24:26 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('PhysicalWeb in',{
|
2016-03-02 22:57:53 +01:00
|
|
|
category: 'Physical_Web',
|
|
|
|
defaults: {
|
|
|
|
name: {value:"Eddystone"},
|
|
|
|
topic: {value:"eddystone"}
|
2015-11-23 16:24:26 +01:00
|
|
|
},
|
|
|
|
color: "#2F7ACD",
|
2016-03-02 22:57:53 +01:00
|
|
|
inputs:0,
|
|
|
|
outputs:1,
|
|
|
|
icon: "physical-web.png",
|
|
|
|
label: function() {
|
2015-11-23 16:24:26 +01:00
|
|
|
return this.name||"PhysicalWeb";
|
|
|
|
},
|
2016-03-02 22:57:53 +01:00
|
|
|
labelStyle: function() {
|
2015-11-23 16:24:26 +01:00
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="PhysicalWeb out">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-url"><i class="fa fa-link"></i> URL</label>
|
|
|
|
<input type="text" id="node-input-url" placeholder="http://...">
|
2016-02-22 12:14:41 +01:00
|
|
|
<!--<button type="button" id="node-input-url-shorten" disabled=true>Shorten</button> -->
|
2016-03-02 22:57:53 +01:00
|
|
|
<p style="margin-left:100px;width: 70%">This URL needs to be shorter than 18 bytes
|
|
|
|
in length to meet Eddystone spec</p>
|
2015-11-23 16:24:26 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2016-03-02 22:57:53 +01:00
|
|
|
<label for="node-input-period"><i class="fa fa-repeat"></i> Period (S)</label>
|
|
|
|
<input type="text" id="node-input-period" style="width:80px;" placeholder="Period">
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-power"><i class="fa fa-battery-half"></i> Power (dB)</label>
|
|
|
|
<input type="text" id="node-input-power" style="width:80px;" placeholder="Power">
|
2015-11-23 16:24:26 +01:00
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<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="PhysicalWeb out">
|
2016-03-02 22:57:53 +01:00
|
|
|
<p><a href="https://google.github.io/physical-web/">Physical Web</a> beacon node.</p>
|
|
|
|
<p>This node takes the value of <code>msg.payload</code> and publishes it as an Eddystone URL
|
|
|
|
announcement. URLs <b>must</b> be less than 18 bytes long, so should be run through a shortner first.</p>
|
|
|
|
<p>The config window will allow you to set the powerlevel (-30 to 100 db) and the period (ms)
|
|
|
|
between anouncements</p>
|
|
|
|
<p>Linux users should <a href="https://github.com/sandeepmistry/bleno#running-on-linux" target="_new">READ THIS</a>.</p>
|
2015-11-23 16:24:26 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('PhysicalWeb out',{
|
2016-03-02 22:57:53 +01:00
|
|
|
category: 'Physical_Web',
|
|
|
|
defaults: {
|
|
|
|
name: {value:"Eddystone"},
|
|
|
|
url: {value:""},
|
2015-11-23 16:24:26 +01:00
|
|
|
power: {value:"-21"},
|
2016-03-02 22:57:53 +01:00
|
|
|
period: {value:"10"}
|
2015-11-23 16:24:26 +01:00
|
|
|
},
|
|
|
|
color: "#2F7ACD",
|
2016-03-02 22:57:53 +01:00
|
|
|
inputs:1,
|
|
|
|
outputs:0,
|
|
|
|
icon: "physical-web.png",
|
|
|
|
label: function() {
|
2015-11-23 16:24:26 +01:00
|
|
|
return this.name||"PhysicalWeb";
|
|
|
|
},
|
2016-03-02 22:57:53 +01:00
|
|
|
labelStyle: function() {
|
2015-11-23 16:24:26 +01:00
|
|
|
return this.name?"node_label_italic":"";
|
2016-02-22 12:14:41 +01:00
|
|
|
},
|
|
|
|
oneditprepare: function() {
|
2016-03-02 22:57:53 +01:00
|
|
|
$( "#node-input-period" ).spinner({min:1});
|
|
|
|
$( "#node-input-power" ).spinner({min:-30,max:100});
|
2015-11-23 16:24:26 +01:00
|
|
|
}
|
|
|
|
});
|
2016-03-02 22:57:53 +01:00
|
|
|
</script>
|