@autorunify/capacitor-nrfmesh 0.0.15 → 0.0.16
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.
|
@@ -110,7 +110,7 @@ class BleManager {
|
|
|
110
110
|
if (service == null || service.size < 18) return
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
ble.mesh.
|
|
113
|
+
ble.mesh.delNodeByName(device.address.replace(":",""))
|
|
114
114
|
device.uuid = ble.mesh.uuidFromService(service).toString()
|
|
115
115
|
device.provisioned = false
|
|
116
116
|
|
|
@@ -134,7 +134,10 @@ class BleManager {
|
|
|
134
134
|
|
|
135
135
|
synchronized(ble.devices) {
|
|
136
136
|
val service = getService(result, MeshManagerApi.MESH_PROXY_UUID) ?: return
|
|
137
|
-
if (!ble.mesh.isProvisionedByService(service))
|
|
137
|
+
if (!ble.mesh.isProvisionedByService(service)) {
|
|
138
|
+
ble.mesh.delNodeByName(device.address.replace("",""))
|
|
139
|
+
return
|
|
140
|
+
}
|
|
138
141
|
|
|
139
142
|
device.provisioned = true
|
|
140
143
|
|
|
@@ -171,7 +171,7 @@ class MeshManager {
|
|
|
171
171
|
address
|
|
172
172
|
)
|
|
173
173
|
|
|
174
|
-
is SensorStatus-> mesh.async.emit(
|
|
174
|
+
is SensorStatus -> mesh.async.emit(
|
|
175
175
|
mesh.formatter.toJSON(msg),
|
|
176
176
|
msg.opCode,
|
|
177
177
|
address
|
|
@@ -237,10 +237,10 @@ class MeshManager {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
meshNode!!.nodeName=meshNode
|
|
240
|
+
meshNode!!.nodeName = meshNode
|
|
241
241
|
.uuid
|
|
242
|
-
.replace("-","")
|
|
243
|
-
.substring(8,20)
|
|
242
|
+
.replace("-", "")
|
|
243
|
+
.substring(8, 20)
|
|
244
244
|
|
|
245
245
|
mesh.async.emit(JSObject().apply {
|
|
246
246
|
put("completed", true)
|
|
@@ -448,16 +448,15 @@ class MeshManager {
|
|
|
448
448
|
return api.getDeviceUuid(service)
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
fun
|
|
452
|
-
api.meshNetwork?.nodes?.
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
451
|
+
fun delNodeByName(name: String) {
|
|
452
|
+
api.meshNetwork?.nodes?.filter { node ->
|
|
453
|
+
node.nodeName.equals(name, true)
|
|
454
|
+
}?.forEach { node ->
|
|
455
|
+
api.meshNetwork?.deleteNode(node)
|
|
456
|
+
notify.notifyListeners("node", JSObject().apply {
|
|
457
|
+
put("action", "del")
|
|
458
|
+
put("unicastAddress", node.unicastAddress)
|
|
459
|
+
})
|
|
461
460
|
}
|
|
462
461
|
}
|
|
463
462
|
|