-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathble-uart.html
67 lines (65 loc) · 1.98 KB
/
ble-uart.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script type="text/javascript">
RED.nodes.registerType('uart-in',{
category: 'network',
color: 'rgb(0, 144, 212)',
defaults: {
name: {value:""},
output_type: {value:"string"}
},
inputs:0,
outputs:1,
icon: "bluetooth.png",
label: function() {
return this.name || "uart-in";
},
oneditprepare: function() {
$("#node-input-output_type").change(function() {
const a = $("#node-input-output_type").val();
console.log('ble output output_type', a);
});
$("#node-input-output_type").change();
}
});
</script>
<script type="text/html" data-template-name="uart-in">
<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>
<div class="form-row">
<label for="node-input-output_type"><i class="fa fa-tag"></i> output type</label>
<select id="node-input-output_type" style="width:60%; margin-right:5px;">
<option value="string">String</option>
<option value="buffer">Buffer</option>
<option value="hex">Hex</option>
</select>
</div>
</script>
<script type="text/html" data-help-name="uart-in">
<p>Emits BLE serial messages sent to the local peripheral.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('uart-notify',{
category: 'network',
color: 'rgb(0, 144, 212)',
defaults: {
name: {value:""},
},
inputs:1,
outputs:0,
align: "right",
icon: "bluetooth.png",
label: function() {
return this.name || 'uart-notify';
}
});
</script>
<script type="text/html" data-template-name="uart-notify">
<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/html" data-help-name="uart-notify">
<p>Sends BLE serial messages to the connected BLE client.</p>
</script>