node-red-noble-connect.html 2.06 KB
Newer Older
David Mondou's avatar
David Mondou committed
1
2
<!-- edit dialog -->
<script type="text/x-red" data-template-name="noble-connect">
3
4
5
6
7
8
9
10
11
12
13
14
  <!-- Limit to particular device name (default to Thingy).  Note that there is space for a max of 8 characters for the name in the Thingy advertising packet -->
  <div class="form-row">
    <label for="node-input-target_name"><i class="fa fa-tasks"></i> Restrict by Name (8 char max)</label>
    <input type="text" id="node-input-target_name" placeholder="Thingy">
  </div>
  <div class="form-tips">Leave empty for scanning all devices with default name of Thingy.</div>
  <!-- Limit to stronger RSSI devices -->
  <div class="form-row">
    <label for="node-input-rssi"><i class="fa fa-tasks"></i> Restrict by RSSI</label>
    <input type="text" id="node-input-rssi" placeholder="-100..0">
  </div>
  <div class="form-tips">Leave empty for scanning all devices regardless of signal strength.</div>
David Mondou's avatar
David Mondou committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  <!-- Limit to list of UUIDs -->
  <div class="form-row">
    <label for="node-input-uuids"><i class="fa fa-tasks"></i> Restrict by Service UUID</label>
    <input type="text" id="node-input-uuids" placeholder="Comma separated list">
  </div>
  <div class="form-tips">Leave empty for scanning all devices offering any service.</div>
  <!-- name -->
  <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>

<!-- help tab -->
<script type="text/x-red" data-help-name="noble-connect">
  <p></p>
</script>

<script type="text/javascript">
  RED.nodes.registerType("noble-connect",{
Spencer Williams's avatar
name    
Spencer Williams committed
35
    category: "Rigado DevKit",
David Mondou's avatar
David Mondou committed
36
37
38
    color: "#A6BBCF",
    defaults: {
      uuids: {value: "", validate: RED.validators.regex(/^([a-fA-F0-9]{32}){0,1}(?:,[a-fA-F0-9]{32})*$/)},
39
40
      target_name: {value: "", validate: function(v) {return v.length >= 0 && v.length <= 8} },
      rssi: {value: "-100", validate: function(v) {return v>= -100 && v <= 0} },
David Mondou's avatar
David Mondou committed
41
42
43
44
45
46
47
48
49
50
      name: {value: ""}
    },
    inputs:1,
    outputs:3,
    icon: "bluetooth.png",
    label: function() {
      return this.name||"noble-connect";
    }
  });
</script>