incyclist-devices 1.4.64 → 1.4.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/ble/ble-interface.js
CHANGED
|
@@ -55,9 +55,7 @@ class BleInterface extends ble_1.BleInterfaceClass {
|
|
|
55
55
|
if (this.logger) {
|
|
56
56
|
this.logger.logEvent(event);
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
console.log('~~BLE:', event);
|
|
60
|
-
}
|
|
58
|
+
console.log('~~BLE:', event);
|
|
61
59
|
}
|
|
62
60
|
onStateChange(state) {
|
|
63
61
|
if (state !== ble_1.BleState.POWERED_ON) {
|
|
@@ -540,8 +538,8 @@ class BleInterface extends ble_1.BleInterfaceClass {
|
|
|
540
538
|
if (fromCache)
|
|
541
539
|
this.logEvent({ message: 'adding from Cache', peripheral: peripheral.address });
|
|
542
540
|
else {
|
|
543
|
-
const { id, name, address } = peripheral;
|
|
544
|
-
this.logEvent({ message: 'BLE scan: found device', peripheral: { id, name, address } });
|
|
541
|
+
const { id, name, address, advertisement = {} } = peripheral;
|
|
542
|
+
this.logEvent({ message: 'BLE scan: found device', peripheral: { id, name, address, services: advertisement.serviceUuids } });
|
|
545
543
|
}
|
|
546
544
|
if (!peripheral || !peripheral.advertisement || !peripheral.advertisement.serviceUuids || peripheral.advertisement.serviceUuids.length === 0)
|
|
547
545
|
return;
|
|
@@ -552,7 +550,11 @@ class BleInterface extends ble_1.BleInterfaceClass {
|
|
|
552
550
|
return;
|
|
553
551
|
peripheralsProcessed.push(peripheral.address);
|
|
554
552
|
const characteristics = yield this.getCharacteristics(peripheral);
|
|
555
|
-
const
|
|
553
|
+
const connector = this.getConnector(peripheral);
|
|
554
|
+
const connectedPeripheral = connector.getPeripheral();
|
|
555
|
+
const { id, name, address, advertisement = {} } = connectedPeripheral;
|
|
556
|
+
const DeviceClasses = this.getDeviceClasses(connectedPeripheral, { profile });
|
|
557
|
+
this.logEvent({ message: 'BLE scan: device connected', peripheral: { id, name, address, services: advertisement.serviceUuids, classes: DeviceClasses.map(c => c.prototype.constructor.name) } });
|
|
556
558
|
let cntFound = 0;
|
|
557
559
|
DeviceClasses.forEach((DeviceClass) => __awaiter(this, void 0, void 0, function* () {
|
|
558
560
|
if (!DeviceClass)
|