@autorunify/capacitor-nrfmesh 0.0.6 → 0.0.8
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.
|
@@ -303,6 +303,7 @@ class BleManager {
|
|
|
303
303
|
|
|
304
304
|
while (timeCount > 0) {
|
|
305
305
|
delay(timeMillis)
|
|
306
|
+
devicesByFilter.clear()
|
|
306
307
|
synchronized(devices) {
|
|
307
308
|
devices.forEach { device ->
|
|
308
309
|
if (filter == "provisioned" && device.provisioned) {
|
|
@@ -318,7 +319,6 @@ class BleManager {
|
|
|
318
319
|
if (max > 0 && devicesByFilter.size >= max) {
|
|
319
320
|
break
|
|
320
321
|
} else {
|
|
321
|
-
devicesByFilter = mutableListOf()
|
|
322
322
|
timeCount--;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -328,8 +328,10 @@ class BleManager {
|
|
|
328
328
|
|
|
329
329
|
fun disconnect(): Boolean {
|
|
330
330
|
try {
|
|
331
|
-
if (isConnected.value
|
|
331
|
+
if (isConnected.value == true) {
|
|
332
332
|
mesh.disconnect()
|
|
333
|
+
} else {
|
|
334
|
+
async.emit(JSObject(), MESH_STATE_DISCONNECTED)
|
|
333
335
|
}
|
|
334
336
|
|
|
335
337
|
return isConnected.value!!
|
|
@@ -24,7 +24,7 @@ class MeshDevice {
|
|
|
24
24
|
this.rssi = scanResult.rssi
|
|
25
25
|
|
|
26
26
|
this.scanRecord = scanResult.scanRecord
|
|
27
|
-
this.name =
|
|
27
|
+
this.name = scanRecord?.deviceName ?: "Unknown"
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
fun match(scanResult: ScanResult): Boolean {
|
|
@@ -17,7 +17,7 @@ import java.nio.ByteOrder.LITTLE_ENDIAN
|
|
|
17
17
|
|
|
18
18
|
class SensorGetWrapper : SensorGet {
|
|
19
19
|
constructor(appkey: ApplicationKey, propertyId: Short?)
|
|
20
|
-
: super(appkey,
|
|
20
|
+
: super(appkey, null) {
|
|
21
21
|
if (propertyId != null) {
|
|
22
22
|
this.mParameters = ByteBuffer
|
|
23
23
|
.allocate(2)
|