@mentra/bluetooth-sdk 3.4.0-dev.999 → 3.5.0-dev.1238
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/README.md +33 -11
- package/android/build.gradle +60 -51
- package/android/gradle.properties +3 -0
- package/android/settings.gradle +47 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/BesCrashReportWaiters.kt +68 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkDefaults.kt +5 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +76 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +27 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +98 -120
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedChangelogCatalog.kt +2 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +6 -6
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +24 -9
- package/android/src/main/java/com/mentra/bluetoothsdk/events/BluetoothEvents.kt +16 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +170 -23
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Nimo.kt +13 -316
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCoordinator.kt +0 -35
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasSession.kt +2 -10
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +6 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/BoundedAudioQueue.kt +92 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/OnDeviceRecognizerHost.kt +169 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/STTTools.kt +74 -115
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +348 -357
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SpeechActivityDetector.kt +211 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SpeechActivityEngine.kt +137 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SttTextFormatter.kt +52 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/WakeWordDetector.kt +235 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AvifExifStripper.java +2 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +3 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +11 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/AudioRouteWatcher.kt +120 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PcmStreamPlayer.kt +181 -16
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PcmUrlPlayback.kt +177 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/BesCrashReportWaitersTest.kt +112 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveGlassesReadyBurstTest.kt +141 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveIncidentDispatchTest.kt +183 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveRgbLedResponseTest.kt +76 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCoordinatorTest.kt +1 -56
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasSessionTest.kt +0 -22
- package/android/src/test/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNamingTest.kt +23 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/BoundedAudioQueueTest.kt +81 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/OnDeviceRecognizerHostTest.kt +216 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/STTToolsExtractionTest.kt +108 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/SpeechActivityDetectorTest.kt +126 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/SpeechActivityEngineTest.kt +245 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/SttTextFormatterTest.kt +67 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/utils/audio/PcmUrlPlaybackTest.kt +76 -0
- package/build/BluetoothSdk.types.d.ts +98 -1
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts +42 -7
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js +1 -0
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/generated/changelogCatalog.d.ts +4 -1
- package/build/generated/changelogCatalog.d.ts.map +1 -1
- package/build/generated/changelogCatalog.js +5 -1
- package/build/generated/changelogCatalog.js.map +1 -1
- package/build/generated/releaseMetadata.js +6 -6
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/ios/BluetoothSdkModule.swift +66 -14
- package/ios/MentraBluetoothSDK.podspec +4 -0
- package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +23 -5
- package/ios/Resources/SileroVad/silero_vad.onnx +0 -0
- package/ios/Source/BesCrashReportWaiters.swift +64 -0
- package/ios/Source/BluetoothSdkDefaults.swift +2 -2
- package/ios/Source/DeviceManager.swift +43 -22
- package/ios/Source/GeneratedChangelogCatalog.swift +2 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +6 -6
- package/ios/Source/MentraBluetoothSDK.swift +27 -15
- package/ios/Source/audio/PcmStreamPlayer.swift +290 -57
- package/ios/Source/audio/PcmUrlPlayback.swift +231 -0
- package/ios/Source/audio/SpeechActivity.swift +277 -0
- package/ios/Source/events/BluetoothEvents.swift +41 -0
- package/ios/Source/internal/BluetoothAvailability.swift +15 -5
- package/ios/Source/sgcs/GlassesAudioSetupPolicy.swift +5 -0
- package/ios/Source/sgcs/MentraLive.swift +173 -42
- package/ios/Source/sgcs/Nimo.swift +39 -272
- package/ios/Source/sgcs/NimoCanvasCoordinator.swift +9 -38
- package/ios/Source/sgcs/NimoCanvasSession.swift +0 -1
- package/ios/Source/sgcs/SGCManager.swift +6 -0
- package/ios/Source/stt/STTTools.swift +13 -31
- package/ios/Source/stt/SherpaOnnxTranscriber.swift +204 -162
- package/ios/Source/stt/SileroSpeechActivity.swift +87 -0
- package/ios/Source/stt/WakeWordDetector.swift +145 -0
- package/ios/Source/utils/BoundedWait.swift +44 -0
- package/ios/Source/utils/DemandDrivenAudioWorker.swift +79 -0
- package/ios/Source/utils/SttModelTraits.swift +62 -0
- package/ios/Tests/BesCrashReportTests.swift +142 -0
- package/ios/Tests/DemandDrivenAudioWorkerTests.swift +171 -0
- package/ios/Tests/DeviceManagerReconnectTests.swift +0 -71
- package/ios/Tests/GlassesAudioSetupPolicyTests.swift +9 -3
- package/ios/Tests/IncidentLogDispatchTests.swift +158 -0
- package/ios/Tests/MentraLiveAudioSetupTests.swift +6 -12
- package/ios/Tests/MentraLiveCommandQueueTests.swift +35 -0
- package/ios/Tests/MentraLiveSessionReadinessTests.swift +179 -10
- package/ios/Tests/NimoCanvasTransportTests.swift +0 -89
- package/ios/Tests/PcmStreamTests.swift +299 -0
- package/ios/Tests/SpeechActivityTests.swift +238 -0
- package/ios/Tests/SttModelTraitsTests.swift +62 -0
- package/package.json +2 -2
- package/plugin/build/withAndroid.js +9 -11
- package/plugin/build/withKotlinVersion.d.ts +2 -0
- package/plugin/build/withKotlinVersion.js +46 -0
- package/src/BluetoothSdk.types.ts +102 -1
- package/src/_private/BluetoothSdkModule.ts +45 -7
- package/src/generated/changelogCatalog.ts +5 -1
- package/src/generated/releaseMetadata.ts +6 -6
- package/src/index.ts +12 -0
- package/android/silero/LICENSE.md +0 -17
- package/android/silero/build.gradle +0 -50
- package/android/silero/proguard-rules.pro +0 -24
- package/android/silero/src/androidTest/assets/hello.wav +0 -0
- package/android/silero/src/androidTest/java/com/konovalov/vad/silero/VadSileroTest.kt +0 -79
- package/android/silero/src/main/java/com/konovalov/vad/silero/Vad.kt +0 -160
- package/android/silero/src/main/java/com/konovalov/vad/silero/VadSilero.kt +0 -449
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/FrameSize.kt +0 -15
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/Mode.kt +0 -14
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/SampleRate.kt +0 -12
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/AudioUtils.kt +0 -47
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/TensorMap.kt +0 -41
- package/android/silero/src/test/java/com/konovalov/vad/silero/utils/AudioUtilsTest.kt +0 -44
- package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnostics.kt +0 -368
- package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoFramebufferProtocol.kt +0 -156
- package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoResourceDiagnostics.kt +0 -274
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/VadGateSpeechPolicy.kt +0 -229
- package/android/src/release/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnostics.kt +0 -20
- package/android/src/release/java/com/mentra/bluetoothsdk/sgcs/NimoResourceDiagnostics.kt +0 -16
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnosticsTest.kt +0 -287
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoFramebufferProtocolTest.kt +0 -127
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoLifecycleTest.kt +0 -851
- package/ios/Source/sgcs/NimoMacResourceTransport.swift +0 -217
- package/ios/Source/sgcs/NimoResourceFixture.swift +0 -384
- package/ios/Source/sgcs/NimoResourceSession.swift +0 -406
- package/ios/Tests/NimoResourceSessionTests.swift +0 -476
- /package/android/{silero/src/main/assets/LICENSE → src/main/assets/vad/LICENSE.silero_vad} +0 -0
- /package/android/{silero/src/main/assets → src/main/assets/vad}/silero_vad.onnx +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
package com.mentra.bluetoothsdk.sgcs
|
|
2
|
-
|
|
3
|
-
import android.content.BroadcastReceiver
|
|
4
|
-
import android.content.Context
|
|
5
|
-
import android.content.Intent
|
|
6
|
-
import android.content.IntentFilter
|
|
7
|
-
import android.os.Build
|
|
8
|
-
import android.os.Handler
|
|
9
|
-
import android.os.Looper
|
|
10
|
-
import android.os.Process
|
|
11
|
-
import android.os.SystemClock
|
|
12
|
-
import com.mentra.bluetoothsdk.BuildConfig
|
|
13
|
-
import com.mentra.bluetoothsdk.DeviceManager
|
|
14
|
-
import org.json.JSONObject
|
|
15
|
-
import java.io.File
|
|
16
|
-
import java.lang.ref.WeakReference
|
|
17
|
-
import java.util.UUID
|
|
18
|
-
|
|
19
|
-
/** Fixed, DUMP-protected debug commands. Expected address is comparison-only, never a connection target.
|
|
20
|
-
* No packet, device-command, caller path, reset, bond or radio inputs are accepted. */
|
|
21
|
-
internal object NimoResourceDiagnostics {
|
|
22
|
-
const val CLOCK_PROTOCOL = "nimo-monotonic-receipt-v1"
|
|
23
|
-
const val ACTION = "com.mentra.bluetoothsdk.NIMO_RESOURCE_LIFECYCLE"
|
|
24
|
-
private val main = Handler(Looper.getMainLooper())
|
|
25
|
-
private val processInstanceId = UUID.randomUUID().toString()
|
|
26
|
-
private data class Observed(val instance: WeakReference<Nimo>, var tombstone: JSONObject)
|
|
27
|
-
private val sessions = linkedMapOf<String, Observed>()
|
|
28
|
-
private var registered = false
|
|
29
|
-
private var application: Context? = null
|
|
30
|
-
private val requests = linkedSetOf<String>()
|
|
31
|
-
private data class Capture(val nonce: String, val name: String, val address: String,
|
|
32
|
-
var instance: Nimo? = null, var cancelled: Boolean = false, var connectStarted: Boolean = false,
|
|
33
|
-
var transportStarted: Boolean = false, val armedElapsedMs: Long,
|
|
34
|
-
var admittedElapsedMs: Long? = null)
|
|
35
|
-
// One diagnostic attempt per app process. Cancellation is a process-lifetime fence.
|
|
36
|
-
@Volatile private var capture: Capture? = null
|
|
37
|
-
internal fun preArmCaptureRequired(buildType: String = BuildConfig.BUILD_TYPE): Boolean = buildType == "nimoDiagnostic"
|
|
38
|
-
internal fun allowUnarmedWearable(buildType: String, wearable: String): Boolean =
|
|
39
|
-
!preArmCaptureRequired(buildType) || !wearable.contains("NIMO", ignoreCase = true)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/** Debug entries share the main admission queue even before arm, so a call that
|
|
43
|
-
* starts just before arm cannot resume effects past it. Release builds are no-op.
|
|
44
|
-
* Queued calls re-enter current capture guards before any connection effect. */
|
|
45
|
-
fun dispatchCapturedEntry(entry: () -> Unit): Boolean {
|
|
46
|
-
if (!preArmCaptureRequired() && capture == null) return false
|
|
47
|
-
if (Looper.myLooper() == main.looper) return false
|
|
48
|
-
val task = java.util.concurrent.FutureTask<Unit> { entry() }
|
|
49
|
-
main.post(task)
|
|
50
|
-
try {
|
|
51
|
-
task.get()
|
|
52
|
-
} catch (error: java.util.concurrent.ExecutionException) {
|
|
53
|
-
throw (error.cause ?: error)
|
|
54
|
-
} catch (error: InterruptedException) {
|
|
55
|
-
// A queued entry must not run later after its original caller abandoned it.
|
|
56
|
-
task.cancel(false)
|
|
57
|
-
Thread.currentThread().interrupt()
|
|
58
|
-
throw error
|
|
59
|
-
}
|
|
60
|
-
return true
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@Synchronized
|
|
64
|
-
fun allowManagerConnect(wearable: String, name: String? = null): Boolean {
|
|
65
|
-
val owned = capture ?: return allowUnarmedWearable(BuildConfig.BUILD_TYPE, wearable)
|
|
66
|
-
if (Looper.myLooper() != main.looper) return false
|
|
67
|
-
if (!wearable.contains("NIMO", ignoreCase = true)) return true
|
|
68
|
-
val current = DeviceManager.getInstance().sgc
|
|
69
|
-
return !owned.cancelled && (name == null || !owned.connectStarted && name == owned.name) &&
|
|
70
|
-
(current == null || current is Nimo && (owned.instance === current ||
|
|
71
|
-
owned.instance == null && current.resourceCaptureEligible()))
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** Scan-to-connect is one captured attempt: never destroy or transfer its instance. */
|
|
75
|
-
@Synchronized
|
|
76
|
-
fun preserveCapturedScan(wearable: String, name: String): Boolean {
|
|
77
|
-
val owned = capture ?: return false
|
|
78
|
-
if (Looper.myLooper() != main.looper || !wearable.contains("NIMO", ignoreCase = true) ||
|
|
79
|
-
owned.cancelled || owned.connectStarted || name != owned.name) return false
|
|
80
|
-
val original = owned.instance ?: return false
|
|
81
|
-
return DeviceManager.getInstance().sgc === original &&
|
|
82
|
-
original.resourceSnapshot().getLong("sessionGeneration") == 0L
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@Synchronized
|
|
86
|
-
fun admit(instance: Nimo, name: String?, connect: Boolean): Boolean {
|
|
87
|
-
val owned = capture ?: return !preArmCaptureRequired()
|
|
88
|
-
if (Looper.myLooper() != main.looper) return false
|
|
89
|
-
if (!allowManagerConnect("NIMO", name) || DeviceManager.getInstance().sgc !== instance ||
|
|
90
|
-
owned.instance != null && owned.instance !== instance || owned.connectStarted) return false
|
|
91
|
-
if (owned.instance == null) {
|
|
92
|
-
if (!instance.resourceCaptureEligible()) return false
|
|
93
|
-
val candidateAdmittedElapsedMs = SystemClock.elapsedRealtime()
|
|
94
|
-
owned.instance = instance
|
|
95
|
-
// Immutable admission survives a setup timeout before any GATT session exists.
|
|
96
|
-
val app = application ?: run { owned.cancelled = true; return false }
|
|
97
|
-
val root = File(app.filesDir, "nimo-lifecycle")
|
|
98
|
-
val target = File(root, "${owned.nonce}.admission.json")
|
|
99
|
-
if (target.exists()) { owned.cancelled = true; return false }
|
|
100
|
-
val pending = File(root, "${owned.nonce}.admission.tmp")
|
|
101
|
-
try {
|
|
102
|
-
pending.outputStream().use { it.write(captureSnapshot(owned, candidateAdmittedElapsedMs).toString().toByteArray(Charsets.UTF_8)); it.flush() }
|
|
103
|
-
check(pending.renameTo(target))
|
|
104
|
-
// Durable admission is authoritative; no live clock may claim it
|
|
105
|
-
// before the original immutable receipt is safely committed.
|
|
106
|
-
instance.resourceCaptureAdmission(owned.nonce, owned.armedElapsedMs, candidateAdmittedElapsedMs)
|
|
107
|
-
owned.admittedElapsedMs = candidateAdmittedElapsedMs
|
|
108
|
-
} catch (_: Exception) {
|
|
109
|
-
owned.cancelled = true
|
|
110
|
-
return false
|
|
111
|
-
} finally { pending.delete() }
|
|
112
|
-
}
|
|
113
|
-
if (connect) owned.connectStarted = true
|
|
114
|
-
return true
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@Synchronized
|
|
118
|
-
fun allowPeer(instance: Nimo, address: String, bonded: Boolean): Boolean {
|
|
119
|
-
val owned = capture ?: return !preArmCaptureRequired()
|
|
120
|
-
if (Looper.myLooper() != main.looper) return false
|
|
121
|
-
return !owned.cancelled && owned.instance === instance && address == owned.address && bonded &&
|
|
122
|
-
DeviceManager.getInstance().sgc === instance
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@Synchronized
|
|
126
|
-
fun beginTransport(instance: Nimo, address: String, bonded: Boolean): Boolean {
|
|
127
|
-
val owned = capture ?: return !preArmCaptureRequired()
|
|
128
|
-
if (Looper.myLooper() != main.looper) return false
|
|
129
|
-
if (!allowPeer(instance, address, bonded) || owned.transportStarted) return false
|
|
130
|
-
owned.transportStarted = true
|
|
131
|
-
return true
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
@Synchronized
|
|
135
|
-
private fun captureSnapshot(owned: Capture, admittedElapsedMs: Long? = owned.admittedElapsedMs): JSONObject = JSONObject()
|
|
136
|
-
.put("clockProtocol", CLOCK_PROTOCOL)
|
|
137
|
-
.put("clock", JSONObject().put("kind", "android-elapsed-realtime-v1").put("armedElapsedMs", owned.armedElapsedMs)
|
|
138
|
-
.put("admittedElapsedMs", admittedElapsedMs ?: JSONObject.NULL).put("observedElapsedMs", SystemClock.elapsedRealtime()))
|
|
139
|
-
.put("version", "nimo-preconnect-capture-v1").put("nonce", owned.nonce)
|
|
140
|
-
.put("captureRequiredBeforeArm", preArmCaptureRequired())
|
|
141
|
-
.put("expectedPair", JSONObject().put("name", owned.name).put("bluetoothAddress", owned.address))
|
|
142
|
-
.put("instanceId", owned.instance?.resourceInstanceId ?: JSONObject.NULL)
|
|
143
|
-
.put("sessionGeneration", owned.instance?.resourceSnapshot()?.getLong("sessionGeneration") ?: JSONObject.NULL)
|
|
144
|
-
.put("observedPair", if (owned.transportStarted) owned.instance?.resourceSnapshot()?.getJSONObject("pair") ?: JSONObject.NULL else JSONObject.NULL)
|
|
145
|
-
.put("cancelled", owned.cancelled).put("connectStarted", owned.connectStarted)
|
|
146
|
-
.put("transportStarted", owned.transportStarted)
|
|
147
|
-
.put("appPid", Process.myPid()).put("processInstanceId", processInstanceId)
|
|
148
|
-
.put("observedAtEpochMs", System.currentTimeMillis())
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
fun start(context: Context) {
|
|
152
|
-
if (Looper.myLooper() != main.looper) { main.post { start(context) }; return }
|
|
153
|
-
if (registered) return
|
|
154
|
-
val app = context.applicationContext
|
|
155
|
-
val filter = IntentFilter(ACTION)
|
|
156
|
-
if (Build.VERSION.SDK_INT >= 33) app.registerReceiver(receiver, filter, "android.permission.DUMP", main, Context.RECEIVER_EXPORTED)
|
|
157
|
-
else { @Suppress("DEPRECATION") app.registerReceiver(receiver, filter, "android.permission.DUMP", main) }
|
|
158
|
-
application = app
|
|
159
|
-
registered = true
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
fun track(instance: Nimo) {
|
|
163
|
-
check(Looper.myLooper() == main.looper)
|
|
164
|
-
val snapshot = instance.resourceSnapshot()
|
|
165
|
-
sessions["${instance.resourceInstanceId}:${snapshot.getLong("sessionGeneration")}"] = Observed(WeakReference(instance), snapshot)
|
|
166
|
-
while (sessions.size > 8) sessions.remove(sessions.keys.first())
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
private val receiver = object : BroadcastReceiver() {
|
|
170
|
-
override fun onReceive(context: Context?, intent: Intent?) {
|
|
171
|
-
if (intent?.action != ACTION) return
|
|
172
|
-
try { execute(intent) } catch (_: Exception) { /* No receipt means unknown; never crash the product app. */ }
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/** Separate from BroadcastReceiver for source tests; no exported unrestricted app API. */
|
|
177
|
-
@Synchronized
|
|
178
|
-
internal fun execute(intent: Intent) {
|
|
179
|
-
check(Looper.myLooper() == main.looper)
|
|
180
|
-
val requestReceivedElapsedMs = SystemClock.elapsedRealtime()
|
|
181
|
-
val nonce = intent.getStringExtra("nonce") ?: return
|
|
182
|
-
if (!uuid(nonce) || nonce in requests) return
|
|
183
|
-
val app = application ?: return
|
|
184
|
-
val root = File(app.filesDir, "nimo-lifecycle")
|
|
185
|
-
if ((!root.isDirectory && !root.mkdir()) || File(root, "$nonce.json").exists()) return
|
|
186
|
-
requests.add(nonce)
|
|
187
|
-
while (requests.size > 128) requests.remove(requests.first())
|
|
188
|
-
val mode = intent.getStringExtra("mode") ?: "status"
|
|
189
|
-
val address = intent.getStringExtra("expectedAddress") ?: ""
|
|
190
|
-
val instanceId = intent.getStringExtra("instanceId")
|
|
191
|
-
val generation = intent.getLongExtra("sessionGeneration", -1)
|
|
192
|
-
val request = JSONObject().put("nonce", nonce).put("mode", mode).put("expectedAddress", address)
|
|
193
|
-
.put("instanceId", instanceId ?: JSONObject.NULL).put("sessionGeneration", if (generation >= 0) generation else JSONObject.NULL)
|
|
194
|
-
fun save(session: JSONObject?, error: String? = null): Boolean {
|
|
195
|
-
val current = DeviceManager.getInstance().sgc
|
|
196
|
-
val receipt = JSONObject().put("clockProtocol", CLOCK_PROTOCOL)
|
|
197
|
-
.put("clock", JSONObject().put("kind", "android-elapsed-realtime-v1").put("requestReceivedElapsedMs", requestReceivedElapsedMs).put("observedElapsedMs", SystemClock.elapsedRealtime()))
|
|
198
|
-
.put("schemaVersion", 1).put("request", request).put("observedAtEpochMs", System.currentTimeMillis())
|
|
199
|
-
.put("appPid", Process.myPid()).put("processInstanceId", processInstanceId)
|
|
200
|
-
.put("currentManager", JSONObject().put("type", current?.type ?: JSONObject.NULL)
|
|
201
|
-
.put("instanceId", (current as? Nimo)?.resourceInstanceId ?: JSONObject.NULL))
|
|
202
|
-
.put("session", session ?: JSONObject.NULL).put("error", error ?: JSONObject.NULL)
|
|
203
|
-
val pending = File(root, "$nonce.tmp")
|
|
204
|
-
try {
|
|
205
|
-
pending.outputStream().use { it.write(receipt.toString().toByteArray(Charsets.UTF_8)); it.flush() }
|
|
206
|
-
check(pending.renameTo(File(root, "$nonce.json")))
|
|
207
|
-
return true
|
|
208
|
-
} catch (_: Exception) { return false /* Absent receipt is unknown. */ } finally { pending.delete() }
|
|
209
|
-
}
|
|
210
|
-
if (mode in listOf("arm-capture", "capture-status", "cancel-capture")) {
|
|
211
|
-
val expectedName = intent.getStringExtra("expectedName")
|
|
212
|
-
val captureNonce = intent.getStringExtra("captureNonce")
|
|
213
|
-
request.remove("instanceId"); request.remove("sessionGeneration")
|
|
214
|
-
request.put("expectedName", expectedName ?: JSONObject.NULL).put("captureNonce", captureNonce ?: JSONObject.NULL)
|
|
215
|
-
if (!Regex("^[0-9A-F]{2}(:[0-9A-F]{2}){5}$").matches(address) ||
|
|
216
|
-
intent.extras?.keySet()?.any { it !in setOf("nonce", "mode", "expectedAddress", "expectedName", "captureNonce") } == true ||
|
|
217
|
-
expectedName == null || !Regex("^Nimo-[A-Za-z0-9]{1,32}$").matches(expectedName) ||
|
|
218
|
-
captureNonce == null || !uuid(captureNonce)) { save(null, "invalid-fixed-capture-request"); return }
|
|
219
|
-
if (mode == "arm-capture") {
|
|
220
|
-
val manager = DeviceManager.getInstance().sgc
|
|
221
|
-
if (capture != null || captureNonce != nonce || manager != null) {
|
|
222
|
-
save(null, "capture-arm-refused-existing-owner"); return
|
|
223
|
-
}
|
|
224
|
-
capture = Capture(captureNonce, expectedName, address, armedElapsedMs = requestReceivedElapsedMs)
|
|
225
|
-
}
|
|
226
|
-
val owned = capture
|
|
227
|
-
if (owned == null || owned.nonce != captureNonce || owned.name != expectedName || owned.address != address) {
|
|
228
|
-
save(null, "capture-not-original"); return
|
|
229
|
-
}
|
|
230
|
-
fun captureReceipt(session: JSONObject? = null, error: String? = null): Boolean {
|
|
231
|
-
return save(JSONObject().put("capture", captureSnapshot(owned)).put("originalSession", session ?: JSONObject.NULL), error)
|
|
232
|
-
}
|
|
233
|
-
if (mode != "cancel-capture") {
|
|
234
|
-
if (!captureReceipt(owned.instance?.resourceSnapshot()) && mode == "arm-capture") owned.cancelled = true
|
|
235
|
-
return
|
|
236
|
-
}
|
|
237
|
-
owned.cancelled = true // fence before draining or emitting a no-admission receipt
|
|
238
|
-
val original = owned.instance
|
|
239
|
-
if (original == null) { captureReceipt(); return }
|
|
240
|
-
if (DeviceManager.getInstance().sgc !== original) { captureReceipt(original.resourceSnapshot(), "capture-cancel-refused-replacement"); return }
|
|
241
|
-
original.releaseCapturedResource({ DeviceManager.getInstance().sgc === original }, { result -> captureReceipt(result) }, nonce, requestReceivedElapsedMs)
|
|
242
|
-
return
|
|
243
|
-
}
|
|
244
|
-
if (mode !in listOf("status", "release") || !Regex("^[0-9A-F]{2}(:[0-9A-F]{2}){5}$").matches(address) ||
|
|
245
|
-
instanceId != null && !uuid(instanceId) || intent.extras?.keySet()?.any { it !in setOf("nonce", "mode", "expectedAddress", "instanceId", "sessionGeneration") } == true) {
|
|
246
|
-
save(null, "invalid-fixed-request"); return
|
|
247
|
-
}
|
|
248
|
-
val current = DeviceManager.getInstance().sgc as? Nimo
|
|
249
|
-
current?.let { track(it) }
|
|
250
|
-
val selected = if (instanceId != null) sessions["$instanceId:$generation"] else sessions.values.lastOrNull {
|
|
251
|
-
it.tombstone.getJSONObject("pair").optString("bluetoothAddress") == address
|
|
252
|
-
}
|
|
253
|
-
val candidate = selected?.instance?.get()
|
|
254
|
-
val live = candidate?.resourceSnapshot()
|
|
255
|
-
val instance = candidate?.takeIf { live?.optLong("sessionGeneration") == selected?.tombstone?.optLong("sessionGeneration") }
|
|
256
|
-
val snapshot = if (instance != null) live else selected?.tombstone
|
|
257
|
-
if (snapshot == null || snapshot.getJSONObject("pair").optString("bluetoothAddress") != address ||
|
|
258
|
-
generation >= 0 && snapshot.optLong("sessionGeneration", -1) != generation) {
|
|
259
|
-
save(null, "target-not-observed-or-generation-mismatch"); return
|
|
260
|
-
}
|
|
261
|
-
if (mode == "status") {
|
|
262
|
-
save(JSONObject(snapshot.toString()).put("sessionObservationCurrent", instance != null).put("source", if (instance != null) "live-original-instance" else "retained-tombstone")); return
|
|
263
|
-
}
|
|
264
|
-
if (instanceId == null || generation < 1 || instance == null || instance !== current) {
|
|
265
|
-
save(snapshot, "release-refused-replaced-or-unowned-target"); return
|
|
266
|
-
}
|
|
267
|
-
instance.releaseResource(generation, { DeviceManager.getInstance().sgc === instance }, { result ->
|
|
268
|
-
track(instance)
|
|
269
|
-
if (result.has("error")) save(instance.resourceSnapshot(), result.getString("error")) else save(result)
|
|
270
|
-
}, nonce, requestReceivedElapsedMs)
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
private fun uuid(value: String): Boolean = try { UUID.fromString(value).toString() == value } catch (_: IllegalArgumentException) { false }
|
|
274
|
-
}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
package com.mentra.bluetoothsdk.stt
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import com.mentra.bluetoothsdk.utils.NativeLog as Log
|
|
5
|
-
import com.konovalov.vad.silero.Vad
|
|
6
|
-
import com.konovalov.vad.silero.VadSilero
|
|
7
|
-
import com.konovalov.vad.silero.config.FrameSize
|
|
8
|
-
import com.konovalov.vad.silero.config.Mode
|
|
9
|
-
import com.konovalov.vad.silero.config.SampleRate
|
|
10
|
-
import java.nio.ByteBuffer
|
|
11
|
-
import java.nio.ByteOrder
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* VadGateSpeechPolicy handles Voice Activity Detection using Silero VAD.
|
|
15
|
-
*
|
|
16
|
-
* Features:
|
|
17
|
-
* - Dynamic VAD check throttling (adjusts frequency based on silence duration)
|
|
18
|
-
* - 8-second silence timeout before declaring "not speaking"
|
|
19
|
-
* - Bypass modes for debugging and PCM streaming
|
|
20
|
-
* - 512-sample frame size (matches Sherpa-ONNX requirements)
|
|
21
|
-
*
|
|
22
|
-
* Ported from android_core VadGateSpeechPolicy.java
|
|
23
|
-
*/
|
|
24
|
-
class VadGateSpeechPolicy(private val context: Context) {
|
|
25
|
-
companion object {
|
|
26
|
-
private const val TAG = "VadGateSpeechPolicy"
|
|
27
|
-
|
|
28
|
-
// Total required silence duration
|
|
29
|
-
private const val REQUIRED_SILENCE_DURATION_MS = 8000L
|
|
30
|
-
|
|
31
|
-
// Dynamic VAD check intervals
|
|
32
|
-
private const val INITIAL_SILENCE_VAD_INTERVAL_MS = 50L // Check frequently at first
|
|
33
|
-
private const val MEDIUM_SILENCE_VAD_INTERVAL_MS = 100L // Medium frequency after some time
|
|
34
|
-
private const val LONG_SILENCE_VAD_INTERVAL_MS =
|
|
35
|
-
200L // Less frequent after extended silence
|
|
36
|
-
|
|
37
|
-
// Thresholds for switching intervals
|
|
38
|
-
private const val MEDIUM_SILENCE_THRESHOLD_MS =
|
|
39
|
-
20000L // Switch to medium interval after 20s
|
|
40
|
-
private const val LONG_SILENCE_THRESHOLD_MS = 60000L // Switch to long interval after 60s
|
|
41
|
-
|
|
42
|
-
private const val FRAME_SIZE = 512
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
private var vad: VadSilero? = null
|
|
46
|
-
private var isCurrentlySpeech = false
|
|
47
|
-
private var bypassVadForDebugging = false
|
|
48
|
-
private var bypassVadForPCM = false
|
|
49
|
-
|
|
50
|
-
/** Notified whenever the speech/silence state actually flips. */
|
|
51
|
-
var onSpeechStateChanged: ((Boolean) -> Unit)? = null
|
|
52
|
-
|
|
53
|
-
// Timestamp of the last detected speech
|
|
54
|
-
private var lastSpeechDetectedTime = 0L
|
|
55
|
-
// Throttle timer for silence VAD checks
|
|
56
|
-
private var lastVadCheckTime = 0L
|
|
57
|
-
|
|
58
|
-
/** Initialize the Silero VAD model */
|
|
59
|
-
fun init(blockSizeSamples: Int) {
|
|
60
|
-
startVad()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private fun startVad() {
|
|
64
|
-
try {
|
|
65
|
-
// Set internal silence duration very low; external logic manages the full required
|
|
66
|
-
// silence duration
|
|
67
|
-
vad =
|
|
68
|
-
Vad.builder()
|
|
69
|
-
.setContext(context)
|
|
70
|
-
.setSampleRate(SampleRate.SAMPLE_RATE_16K)
|
|
71
|
-
.setFrameSize(FrameSize.FRAME_SIZE_512)
|
|
72
|
-
.setMode(Mode.NORMAL)
|
|
73
|
-
.setSilenceDurationMs(50)
|
|
74
|
-
.setSpeechDurationMs(50)
|
|
75
|
-
.build()
|
|
76
|
-
|
|
77
|
-
Log.d(TAG, "VAD initialized successfully")
|
|
78
|
-
} catch (e: Exception) {
|
|
79
|
-
Log.e(TAG, "Failed to initialize VAD", e)
|
|
80
|
-
vad = null
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Check if audio should be passed to the recognizer based on VAD state */
|
|
85
|
-
fun shouldPassAudioToRecognizer(): Boolean {
|
|
86
|
-
// CRITICAL: Handle VAD null case
|
|
87
|
-
if (vad == null) {
|
|
88
|
-
return bypassVadForDebugging || bypassVadForPCM || true
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return bypassVadForDebugging || bypassVadForPCM || isCurrentlySpeech
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** Process audio bytes through VAD to detect speech */
|
|
95
|
-
fun processAudioBytes(bytes: ByteArray, offset: Int, length: Int) {
|
|
96
|
-
val now = System.currentTimeMillis()
|
|
97
|
-
|
|
98
|
-
// If in speech state and it hasn't been 8 seconds since the last speech was detected, skip
|
|
99
|
-
// processing
|
|
100
|
-
if (isCurrentlySpeech && (now - lastSpeechDetectedTime < REQUIRED_SILENCE_DURATION_MS)) {
|
|
101
|
-
return
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Calculate silence duration
|
|
105
|
-
val silenceDuration = now - lastSpeechDetectedTime
|
|
106
|
-
|
|
107
|
-
// Determine which VAD interval to use based on silence duration
|
|
108
|
-
val currentVadInterval =
|
|
109
|
-
when {
|
|
110
|
-
silenceDuration < MEDIUM_SILENCE_THRESHOLD_MS -> INITIAL_SILENCE_VAD_INTERVAL_MS
|
|
111
|
-
silenceDuration < LONG_SILENCE_THRESHOLD_MS -> MEDIUM_SILENCE_VAD_INTERVAL_MS
|
|
112
|
-
else -> LONG_SILENCE_VAD_INTERVAL_MS
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// During silence, throttle VAD checks based on the dynamic interval
|
|
116
|
-
if (!isCurrentlySpeech && (now - lastVadCheckTime < currentVadInterval)) {
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
lastVadCheckTime = now
|
|
120
|
-
|
|
121
|
-
val audioBytesFull = bytesToShort(bytes)
|
|
122
|
-
val totalSamples = audioBytesFull.size
|
|
123
|
-
|
|
124
|
-
if (totalSamples % FRAME_SIZE != 0) {
|
|
125
|
-
Log.e(
|
|
126
|
-
TAG,
|
|
127
|
-
"Invalid audio frame size: $totalSamples samples. Needs to be multiple of $FRAME_SIZE."
|
|
128
|
-
)
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
val currentVad =
|
|
133
|
-
vad
|
|
134
|
-
?: run {
|
|
135
|
-
Log.w(TAG, "VAD not initialized, skipping audio processing")
|
|
136
|
-
return
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
var previousSpeechState = isCurrentlySpeech
|
|
140
|
-
|
|
141
|
-
// Process each 512-sample frame
|
|
142
|
-
val numFrames = totalSamples / FRAME_SIZE
|
|
143
|
-
for (i in 0 until numFrames) {
|
|
144
|
-
val currentTime = System.currentTimeMillis()
|
|
145
|
-
val startIdx = i * FRAME_SIZE
|
|
146
|
-
val audioFrame = audioBytesFull.copyOfRange(startIdx, startIdx + FRAME_SIZE)
|
|
147
|
-
val detectedSpeech = currentVad.isSpeech(audioFrame)
|
|
148
|
-
|
|
149
|
-
if (detectedSpeech) {
|
|
150
|
-
isCurrentlySpeech = true
|
|
151
|
-
// Update the last speech detection timestamp
|
|
152
|
-
lastSpeechDetectedTime = currentTime
|
|
153
|
-
} else {
|
|
154
|
-
// If no speech detected, and 8 seconds have elapsed since the last speech, mark as
|
|
155
|
-
// silence
|
|
156
|
-
if (currentTime - lastSpeechDetectedTime >= REQUIRED_SILENCE_DURATION_MS) {
|
|
157
|
-
isCurrentlySpeech = false
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (isCurrentlySpeech != previousSpeechState) {
|
|
162
|
-
Log.d(
|
|
163
|
-
TAG,
|
|
164
|
-
"Speech detection changed to: ${if (isCurrentlySpeech) "SPEECH" else "SILENCE"}"
|
|
165
|
-
)
|
|
166
|
-
previousSpeechState = isCurrentlySpeech
|
|
167
|
-
onSpeechStateChanged?.invoke(isCurrentlySpeech)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/** Convert byte array (PCM16LE) to short array */
|
|
173
|
-
private fun bytesToShort(bytes: ByteArray): ShortArray {
|
|
174
|
-
val shorts = ShortArray(bytes.size / 2)
|
|
175
|
-
ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(shorts)
|
|
176
|
-
return shorts
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/** Stop VAD and release resources */
|
|
180
|
-
fun stop() {
|
|
181
|
-
try {
|
|
182
|
-
vad?.close()
|
|
183
|
-
vad = null
|
|
184
|
-
Log.d(TAG, "VAD stopped and resources released")
|
|
185
|
-
} catch (e: Exception) {
|
|
186
|
-
Log.e(TAG, "Error stopping VAD", e)
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/** Reset VAD state */
|
|
191
|
-
fun reset() {
|
|
192
|
-
val wasSpeaking = isCurrentlySpeech
|
|
193
|
-
isCurrentlySpeech = false
|
|
194
|
-
lastSpeechDetectedTime = 0
|
|
195
|
-
lastVadCheckTime = 0
|
|
196
|
-
if (wasSpeaking) onSpeechStateChanged?.invoke(false)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/** Change bypass VAD for debugging state */
|
|
200
|
-
fun changeBypassVadForDebugging(bypass: Boolean) {
|
|
201
|
-
bypassVadForDebugging = bypass
|
|
202
|
-
Log.d(TAG, "Bypass VAD for debugging: $bypass")
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/** Change bypass VAD for PCM streaming state */
|
|
206
|
-
fun changeBypassVadForPCM(bypass: Boolean) {
|
|
207
|
-
Log.d(TAG, "VAD PCM Bypass State Change: $bypassVadForPCM -> $bypass")
|
|
208
|
-
bypassVadForPCM = bypass
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/** Handle microphone state changes */
|
|
212
|
-
fun microphoneStateChanged(state: Boolean) {
|
|
213
|
-
if (!state) {
|
|
214
|
-
// Microphone turned off: force immediate silence
|
|
215
|
-
val wasSpeaking = isCurrentlySpeech
|
|
216
|
-
isCurrentlySpeech = false
|
|
217
|
-
lastSpeechDetectedTime = 0
|
|
218
|
-
lastVadCheckTime = 0
|
|
219
|
-
|
|
220
|
-
// Optionally flush the VAD's internal state by processing a silent frame
|
|
221
|
-
vad?.let { vadInstance ->
|
|
222
|
-
val silentFrame = ShortArray(FRAME_SIZE)
|
|
223
|
-
vadInstance.isSpeech(silentFrame)
|
|
224
|
-
}
|
|
225
|
-
Log.d(TAG, "Microphone turned off; forced state to SILENCE.")
|
|
226
|
-
if (wasSpeaking) onSpeechStateChanged?.invoke(false)
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
package com.mentra.bluetoothsdk.sgcs
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import android.os.Handler
|
|
5
|
-
|
|
6
|
-
/** No diagnostic receiver, commands, or screen capture in release builds. */
|
|
7
|
-
@Suppress("UNUSED_PARAMETER")
|
|
8
|
-
internal class NimoDiagnostics(
|
|
9
|
-
context: Context,
|
|
10
|
-
handler: Handler,
|
|
11
|
-
send: (ByteArray, () -> Unit) -> Boolean,
|
|
12
|
-
requestCanvasHold: ((() -> Unit) -> Unit) = { _ -> },
|
|
13
|
-
releaseCanvasHold: (resume: Boolean) -> Unit = { _ -> },
|
|
14
|
-
) {
|
|
15
|
-
fun connected(maxWriteBytes: Int) {}
|
|
16
|
-
fun disconnected() {}
|
|
17
|
-
fun close() {}
|
|
18
|
-
fun onPacket(packet: ByteArray): Boolean = false
|
|
19
|
-
fun cancelHeldCapture(reason: String, resumeCanvas: Boolean = false) {}
|
|
20
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
package com.mentra.bluetoothsdk.sgcs
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
|
|
5
|
-
/** Release builds register no receiver and expose no lifecycle control surface. */
|
|
6
|
-
@Suppress("UNUSED_PARAMETER")
|
|
7
|
-
internal object NimoResourceDiagnostics {
|
|
8
|
-
fun start(context: Context) {}
|
|
9
|
-
fun track(instance: Nimo) {}
|
|
10
|
-
fun dispatchCapturedEntry(entry: () -> Unit) = false
|
|
11
|
-
fun allowManagerConnect(wearable: String, name: String? = null) = true
|
|
12
|
-
fun preserveCapturedScan(wearable: String, name: String) = false
|
|
13
|
-
fun admit(instance: Nimo, name: String?, connect: Boolean) = true
|
|
14
|
-
fun allowPeer(instance: Nimo, address: String, bonded: Boolean) = true
|
|
15
|
-
fun beginTransport(instance: Nimo, address: String, bonded: Boolean) = true
|
|
16
|
-
}
|