kard-network-ble-mesh 1.1.0 → 1.1.1
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.
|
@@ -145,6 +145,14 @@ class BleMeshModule(reactContext: ReactApplicationContext) : ReactContextBaseJav
|
|
|
145
145
|
fun start(nickname: String, promise: Promise) {
|
|
146
146
|
myNickname = nickname
|
|
147
147
|
|
|
148
|
+
// If already running, just update nickname and resolve
|
|
149
|
+
if (isRunning) {
|
|
150
|
+
Log.d(TAG, "Already running, updating nickname to: $nickname")
|
|
151
|
+
sendAnnounce()
|
|
152
|
+
promise.resolve(null)
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
|
|
148
156
|
scope.launch {
|
|
149
157
|
try {
|
|
150
158
|
startBleServices()
|
|
@@ -162,6 +170,13 @@ class BleMeshModule(reactContext: ReactApplicationContext) : ReactContextBaseJav
|
|
|
162
170
|
|
|
163
171
|
@ReactMethod
|
|
164
172
|
fun stop(promise: Promise) {
|
|
173
|
+
// If not running, just resolve
|
|
174
|
+
if (!isRunning) {
|
|
175
|
+
Log.d(TAG, "Already stopped, nothing to do")
|
|
176
|
+
promise.resolve(null)
|
|
177
|
+
return
|
|
178
|
+
}
|
|
179
|
+
|
|
165
180
|
scope.launch {
|
|
166
181
|
try {
|
|
167
182
|
sendLeaveAnnouncement()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kard-network-ble-mesh",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Kard Network BLE Mesh networking library for React Native with seamless permissions",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -49,14 +49,17 @@
|
|
|
49
49
|
],
|
|
50
50
|
"repository": {
|
|
51
51
|
"type": "git",
|
|
52
|
-
"url": "git+https://github.com/
|
|
52
|
+
"url": "git+https://github.com/kard-network/kard-network-ble-mesh.git"
|
|
53
|
+
},
|
|
54
|
+
"author": {
|
|
55
|
+
"name": "rrigoni",
|
|
56
|
+
"email": "rrigoni@gmail.com"
|
|
53
57
|
},
|
|
54
|
-
"author": "Kard Network",
|
|
55
58
|
"license": "MIT",
|
|
56
59
|
"bugs": {
|
|
57
|
-
"url": "https://github.com/
|
|
60
|
+
"url": "https://github.com/kard-network/kard-network-ble-mesh/issues"
|
|
58
61
|
},
|
|
59
|
-
"homepage": "https://github.com/
|
|
62
|
+
"homepage": "https://github.com/kard-network/kard-network-ble-mesh#readme",
|
|
60
63
|
"publishConfig": {
|
|
61
64
|
"registry": "https://registry.npmjs.org/"
|
|
62
65
|
},
|