@stoprocent/noble 2.1.0 → 2.1.2
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/hci-socket/hci.js +2 -2
- package/lib/mac/src/ble_manager.h +1 -0
- package/lib/mac/src/ble_manager.mm +10 -0
- package/package.json +1 -1
- package/prebuilds/darwin-x64+arm64/@stoprocent+noble.node +0 -0
- package/prebuilds/win32-ia32/@stoprocent+noble.node +0 -0
- package/prebuilds/win32-x64/@stoprocent+noble.node +0 -0
package/lib/hci-socket/hci.js
CHANGED
|
@@ -934,13 +934,13 @@ Hci.prototype.processCmdCompleteEvent = function (cmd, status, result) {
|
|
|
934
934
|
this.emit('reset');
|
|
935
935
|
} else if (cmd === LE_READ_LOCAL_SUPPORTED_FEATURES && status === 0) {
|
|
936
936
|
// Set _isExtended based on leExtendedAdvertising bit (12)
|
|
937
|
-
this._isExtended =
|
|
938
|
-
|
|
937
|
+
this._isExtended = (result[1] & (1 << 4)) !== 0;
|
|
939
938
|
this.emit('leFeatures', result);
|
|
940
939
|
|
|
941
940
|
if (this._isExtended) {
|
|
942
941
|
this.setCodedPhySupport();
|
|
943
942
|
}
|
|
943
|
+
|
|
944
944
|
this.setEventMask();
|
|
945
945
|
this.setLeEventMask();
|
|
946
946
|
this.readLocalVersion();
|
|
@@ -22,6 +22,15 @@
|
|
|
22
22
|
|
|
23
23
|
- (void)centralManagerDidUpdateState:(CBCentralManager *)central
|
|
24
24
|
{
|
|
25
|
+
if (central.state != self.lastState && self.lastState == CBManagerStatePoweredOff && central.state == CBManagerStatePoweredOn) {
|
|
26
|
+
[self.peripherals enumerateKeysAndObjectsUsingBlock:^(id key, CBPeripheral* peripheral, BOOL *stop) {
|
|
27
|
+
if (peripheral.state == CBPeripheralStateConnected) {
|
|
28
|
+
[self.centralManager cancelPeripheralConnection:peripheral];
|
|
29
|
+
}
|
|
30
|
+
}];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
self.lastState = central.state;
|
|
25
34
|
auto state = stateToString(central.state);
|
|
26
35
|
emit.RadioState(state);
|
|
27
36
|
}
|
|
@@ -142,6 +151,7 @@
|
|
|
142
151
|
// Simulate discovery handling
|
|
143
152
|
[self centralManager:central didDiscoverPeripheral:peripheral advertisementData:advertisementData RSSI:RSSI];
|
|
144
153
|
}
|
|
154
|
+
|
|
145
155
|
std::string uuid = getUuid(peripheral);
|
|
146
156
|
emit.Connected(uuid, "");
|
|
147
157
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|