Skip to content

Commit 11adbe9

Browse files
author
Daisuke Baba
committed
Merge branch 'hotfix/1.0.1'
2 parents 8d5e029 + 469f800 commit 11adbe9

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ sudo hcidump -t -x
266266
Set `GENERIC_BLE_TRACE=true` on starting Node-RED and you can find the precise log in `/var/log/syslog`.
267267

268268
# Revision History
269+
* 1.0.1
270+
- Fix an issue where custom characteristics cannot be listed on the Generic BLE config node dialog
271+
269272
* 1.0.0
270273
- Fix an issue where some devices cannot be discovered within a specific time window even after they can be connected
271274
- Fix an issue where the Scan Result select widget didn't show the same item as the stored device info

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-generic-ble",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Node-RED nodes for generic BLE devices",
55
"license": "Apache-2.0",
66
"repository": {

src/generic-ble.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,20 +592,17 @@ function toApiObject(peripheral) {
592592
});
593593
}
594594

595-
function toDetailedObject(peripheral) {
595+
function toDetailedObject(peripheral, RED) {
596596
let p = Promise.resolve();
597597
return toApiObject(peripheral).then(obj => {
598598
if (peripheral.services) {
599599
obj.characteristics = [];
600600
peripheral.services.map((s) => {
601601
obj.characteristics = obj.characteristics.concat((s.characteristics || []).map((c) => {
602-
if (!c.type) {
603-
return null;
604-
}
605602
let characteristic = {
606603
uuid: c.uuid,
607-
name: c.name,
608-
type: c.type,
604+
name: c.name || RED._('generic-ble.label.unnamedChr'),
605+
type: c.type || RED._('generic-ble.label.customType'),
609606
notifiable: c.properties.indexOf('notify') >= 0,
610607
readable: c.properties.indexOf('read') >= 0,
611608
writable: c.properties.indexOf('write') >= 0,
@@ -918,7 +915,7 @@ export default function(RED) {
918915
}
919916

920917
let task = () => {
921-
return toDetailedObject(peripheral).then(bleDevice => {
918+
return toDetailedObject(peripheral, RED).then(bleDevice => {
922919
if (TRACE) {
923920
RED.log.info(`/__bledev/${address} OUTPUT`, JSON.stringify(bleDevice, null, 2));
924921
}

src/locales/en-US/generic-ble.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ generic-ble:
1313
characteristics: GATT Characteristics
1414
notAvailable: (not available)
1515
notification: Emit notify events
16+
customType: (Custom Type)
17+
unnamedChr: <Unnamed>
1618
placeholder:
1719
localName: BLE device name
1820
address: aa:11:bb:22:cc:33 (case insensitive)

0 commit comments

Comments
 (0)