Push dev work to master #2
|
@ -11,7 +11,7 @@ const log = require('../log')('ble')
|
||||||
const wifi = require('../wifi')
|
const wifi = require('../wifi')
|
||||||
|
|
||||||
const BLENO_DEVICE_NAME = process.env.BLENO_DEVICE_NAME || 'intval3'
|
const BLENO_DEVICE_NAME = process.env.BLENO_DEVICE_NAME || 'intval3'
|
||||||
const DEVICE_ID = process.env.DEVICE_ID || 'intval3'
|
let DEVICE_ID = process.env.DEVICE_ID || 'intval3'
|
||||||
const SERVICE_ID = process.env.SERVICE_ID || 'intval3_ble'
|
const SERVICE_ID = process.env.SERVICE_ID || 'intval3_ble'
|
||||||
const CHAR_ID = process.env.CHAR_ID || 'intval3char'
|
const CHAR_ID = process.env.CHAR_ID || 'intval3char'
|
||||||
const WIFI_ID = process.env.WIFI_ID || 'wifichar'
|
const WIFI_ID = process.env.WIFI_ID || 'wifichar'
|
||||||
|
@ -134,7 +134,7 @@ class BLE {
|
||||||
log.info('stateChange', { state : state })
|
log.info('stateChange', { state : state })
|
||||||
if (state === 'poweredOn') {
|
if (state === 'poweredOn') {
|
||||||
log.info('Starting advertising', { BLE_ID : BLE_ID })
|
log.info('Starting advertising', { BLE_ID : BLE_ID })
|
||||||
bleno.startAdvertising(BLENO_DEVICE_NAME, [BLE_ID])
|
bleno.startAdvertising(BLE_ID, [CHAR_ID, WIFI_ID])
|
||||||
} else {
|
} else {
|
||||||
bleno.stopAdvertising()
|
bleno.stopAdvertising()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue