From 6cabd0e9260e0e0e5c981e9255d46c2f9470cbe5 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Wed, 13 Dec 2017 18:31:59 -0500 Subject: [PATCH] Use a better device id --- lib/ble/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ble/index.js b/lib/ble/index.js index 1e8af08..d9f2804 100644 --- a/lib/ble/index.js +++ b/lib/ble/index.js @@ -10,13 +10,14 @@ const util = require('util') const log = require('../log')('ble') const wifi = require('../wifi') -const BLENO_DEVICE_NAME = process.env.BLENO_DEVICE_NAME || 'intval3' -let DEVICE_ID = process.env.DEVICE_ID || 'intval3' +const DEVICE_NAME = process.env.DEVICE_ID || 'intval3' const SERVICE_ID = process.env.SERVICE_ID || 'intval3_ble' const CHAR_ID = process.env.CHAR_ID || 'intval3char' const WIFI_ID = process.env.WIFI_ID || 'wifichar' const NETWORK = os.networkInterfaces() const MAC = getMac() || spoofMac() +// +process.env.BLENO_DEVICE_NAME += '_' + MAC let currentWifi = 'disconnected' let getState @@ -130,11 +131,10 @@ class BLE { getState = bleGetState bleno.on('stateChange', state => { - const BLE_ID = `${DEVICE_ID}_${MAC}` log.info('stateChange', { state : state }) if (state === 'poweredOn') { - log.info('Starting advertising', { BLE_ID : BLE_ID }) - bleno.startAdvertising(BLE_ID, [CHAR_ID]) + log.info('Starting advertising', { DEVICE_NAME: DEVICE_NAME }) + bleno.startAdvertising(DEVICE_NAME, [CHAR_ID]) } else { bleno.stopAdvertising() }