@mentra/bluetooth-sdk 0.1.0
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 +278 -0
- package/android/build.gradle +167 -0
- package/android/lc3Lib/CMakeLists.txt +6 -0
- package/android/lc3Lib/build.gradle +109 -0
- package/android/lc3Lib/proguard-rules.pro +33 -0
- package/android/lc3Lib/src/main/AndroidManifest.xml +2 -0
- package/android/lc3Lib/src/main/cpp/CMakeLists.txt +8 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/CMakeLists.txt +30 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/CMakeLists.txt +7 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.cc +96 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.h +53 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/Makefile.am +6 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h +26 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h.in +26 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/ogg.h +209 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/os_types.h +158 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus.h +981 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_custom.h +342 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_defines.h +799 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_multistream.h +660 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_projection.h +568 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_types.h +166 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.cc +268 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.h +115 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/opus_tools/opus_header.h +59 -0
- package/android/lc3Lib/src/main/cpp/liblc3/CMakeLists.txt +38 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/lc3.h +309 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/lc3_private.h +162 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/rnnoise.h +114 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/CMakeLists.txt +19 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.c +92 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.h +44 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.c +375 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.h +315 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.c +129 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.h +69 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/common.h +148 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.c +70 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.h +43 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/fastmath.h +158 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/lc3.c +702 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.c +893 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.h +111 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_arm.h +506 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_neon.h +281 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/makefile.mk +35 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.c +452 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.h +57 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct_neon.h +296 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/meson.build +46 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.c +61 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.h +57 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.c +880 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.h +103 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.c +904 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.h +119 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.c +3457 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.h +94 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.c +457 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.h +99 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3.cpp +159 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/_kiss_fft_guts.h +182 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/arch.h +261 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.c +279 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.h +59 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/common.h +48 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/compile.sh +3 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/denoise.c +646 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.c +601 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.h +203 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/opus_types.h +159 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.c +526 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.h +149 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.c +178 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.h +69 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.c +11051 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.h +34 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_reader.c +168 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_train.py +66 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/tansig_table.h +45 -0
- package/android/lc3Lib/src/main/java/com/mentra/lc3Lib/Lc3Cpp.java +38 -0
- package/android/lc3Lib/third_party/CMakeLists.txt +23 -0
- package/android/lc3Lib/third_party/CMakeLists_libogg.txt +18 -0
- package/android/lc3Lib/third_party/CMakeLists_libopus.txt +18 -0
- package/android/lc3Lib/third_party/CMakeLists_opus-tools.txt +23 -0
- package/android/lc3Lib/third_party/opus_tools/src/AUTHORS +5 -0
- package/android/lc3Lib/third_party/opus_tools/src/CMakeLists.txt +4 -0
- package/android/lc3Lib/third_party/opus_tools/src/COPYING +371 -0
- package/android/lc3Lib/third_party/opus_tools/src/ChangeLog +3 -0
- package/android/lc3Lib/third_party/opus_tools/src/Makefile.am +42 -0
- package/android/lc3Lib/third_party/opus_tools/src/Makefile.unix +23 -0
- package/android/lc3Lib/third_party/opus_tools/src/NEWS +0 -0
- package/android/lc3Lib/third_party/opus_tools/src/README +0 -0
- package/android/lc3Lib/third_party/opus_tools/src/autogen.sh +115 -0
- package/android/lc3Lib/third_party/opus_tools/src/configure.ac +293 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/arch.h +239 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/audio-in.c +1046 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.c +245 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.h +28 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.c +320 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.h +51 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/lpc.c +157 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/lpc.h +27 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.c +286 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.h +59 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusdec.c +884 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.c +1021 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.h +101 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.c +639 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.h +51 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/os_support.h +167 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/resample.c +1137 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/speex_resampler.h +344 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/stack_alloc.h +115 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.c +125 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.h +62 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.c +223 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.h +60 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +40 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +528 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +610 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +1616 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +314 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothModels.kt +1710 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +554 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/ObservableStore.kt +68 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/controllers/ControllerManager.kt +158 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/controllers/R1.kt +934 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/services/Foreground.kt +175 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/services/PhoneMic.kt +1109 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G1.java +3974 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +3551 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Mach1.java +1327 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.java +6959 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraNex.kt +1655 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraosBle.java +53675 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +202 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Simulated.kt +224 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/STTTools.kt +340 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +465 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/VadGateSpeechPolicy.kt +221 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AES.java +106 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AudioSessionMonitor.kt +189 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BitmapJavaUtils.java +169 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +179 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/Constants.kt +44 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/G1Text.kt +436 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +29 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleUploadService.java +76 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/K900ProtocolUtils.java +791 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/MessageChunker.java +186 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/NexSGCUtils.kt +589 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/PhoneAudioMonitor.kt +303 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/SmartGlassesConnectionState.java +9 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/ByteUtilAudioPlayer.java +655 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/Lc3Player.java +441 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PCMAudioPlayer.java +431 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/app.plugin.js +1 -0
- package/build/BluetoothSdk.types.d.ts +498 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -0
- package/build/BluetoothSdk.types.js +23 -0
- package/build/BluetoothSdk.types.js.map +1 -0
- package/build/BluetoothSdkModule.d.ts +71 -0
- package/build/BluetoothSdkModule.d.ts.map +1 -0
- package/build/BluetoothSdkModule.js +106 -0
- package/build/BluetoothSdkModule.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +5 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/BluetoothSdkModule.swift +665 -0
- package/ios/MentraBluetoothSDK.podspec +77 -0
- package/ios/Packages/CoreObjC/CoreObjC.xcodeproj/project.pbxproj +213 -0
- package/ios/Packages/CoreObjC/PcmConverter.h +22 -0
- package/ios/Packages/CoreObjC/PcmConverter.m +266 -0
- package/ios/Packages/CoreObjC/attdet.c +92 -0
- package/ios/Packages/CoreObjC/attdet.h +44 -0
- package/ios/Packages/CoreObjC/bits.c +375 -0
- package/ios/Packages/CoreObjC/bits.h +315 -0
- package/ios/Packages/CoreObjC/bwdet.c +129 -0
- package/ios/Packages/CoreObjC/bwdet.h +69 -0
- package/ios/Packages/CoreObjC/common.h +151 -0
- package/ios/Packages/CoreObjC/energy.c +70 -0
- package/ios/Packages/CoreObjC/energy.h +43 -0
- package/ios/Packages/CoreObjC/fastmath.h +158 -0
- package/ios/Packages/CoreObjC/lc3.c +704 -0
- package/ios/Packages/CoreObjC/lc3.h +313 -0
- package/ios/Packages/CoreObjC/lc3_cpp.h +283 -0
- package/ios/Packages/CoreObjC/lc3_private.h +163 -0
- package/ios/Packages/CoreObjC/ltpf.c +905 -0
- package/ios/Packages/CoreObjC/ltpf.h +111 -0
- package/ios/Packages/CoreObjC/ltpf_arm.h +506 -0
- package/ios/Packages/CoreObjC/ltpf_neon.h +281 -0
- package/ios/Packages/CoreObjC/makefile.mk +35 -0
- package/ios/Packages/CoreObjC/mdct.c +469 -0
- package/ios/Packages/CoreObjC/mdct.h +57 -0
- package/ios/Packages/CoreObjC/mdct_neon.h +296 -0
- package/ios/Packages/CoreObjC/meson.build +61 -0
- package/ios/Packages/CoreObjC/plc.c +61 -0
- package/ios/Packages/CoreObjC/plc.h +57 -0
- package/ios/Packages/CoreObjC/rnnoise.h +114 -0
- package/ios/Packages/CoreObjC/sns.c +880 -0
- package/ios/Packages/CoreObjC/sns.h +103 -0
- package/ios/Packages/CoreObjC/spec.c +907 -0
- package/ios/Packages/CoreObjC/spec.h +119 -0
- package/ios/Packages/CoreObjC/tables.c +3457 -0
- package/ios/Packages/CoreObjC/tables.h +94 -0
- package/ios/Packages/CoreObjC/tns.c +457 -0
- package/ios/Packages/CoreObjC/tns.h +99 -0
- package/ios/Packages/SherpaOnnx/Model/joiner.onnx +0 -0
- package/ios/Packages/SherpaOnnx/Model/tokens.txt +502 -0
- package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +1659 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/cargs.h +162 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/sherpa-onnx/c-api/c-api.h +1852 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/sherpa-onnx/c-api/cxx-api.h +674 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Info.plist +44 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/sherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/sherpa-onnx.a +0 -0
- package/ios/Packages/VAD/Common/VAD/VADQuality.swift +41 -0
- package/ios/Packages/VAD/Common/VAD/VADState.swift +26 -0
- package/ios/Packages/VAD/Common/VAD/VADStrategy.swift +29 -0
- package/ios/Packages/VAD/Common/VAD/VADType.swift +14 -0
- package/ios/Packages/VAD/Data/Configuration.swift +68 -0
- package/ios/Packages/VAD/Data/FrameSize.swift +39 -0
- package/ios/Packages/VAD/Data/Record.swift +13 -0
- package/ios/Packages/VAD/Data/Result.swift +22 -0
- package/ios/Packages/VAD/Data/SampleRate.swift +48 -0
- package/ios/Packages/VAD/Silero/Model/silero_vad.onnx +0 -0
- package/ios/Packages/VAD/Silero/SileroVAD.swift +284 -0
- package/ios/Packages/VAD/Silero/SileroVADStrategy.swift +64 -0
- package/ios/Packages/libbz2/module.modulemap +5 -0
- package/ios/Packages/libbz2/shim.h +1 -0
- package/ios/Source/Bridge.swift +353 -0
- package/ios/Source/Bridging-Header.h +16 -0
- package/ios/Source/DeviceManager.swift +1478 -0
- package/ios/Source/DeviceStore.swift +295 -0
- package/ios/Source/MentraBluetoothSDK.swift +2439 -0
- package/ios/Source/ObservableStore.swift +88 -0
- package/ios/Source/PrivacyInfo.xcprivacy +23 -0
- package/ios/Source/controllers/ControllerManager.swift +187 -0
- package/ios/Source/controllers/R1.swift +827 -0
- package/ios/Source/services/PhoneMic.swift +662 -0
- package/ios/Source/sgcs/Frame.swift +651 -0
- package/ios/Source/sgcs/G1.swift +2505 -0
- package/ios/Source/sgcs/G2.swift +3730 -0
- package/ios/Source/sgcs/Mach1.swift +543 -0
- package/ios/Source/sgcs/MentraLive.swift +4708 -0
- package/ios/Source/sgcs/MentraNex.swift +2479 -0
- package/ios/Source/sgcs/SGCManager.swift +243 -0
- package/ios/Source/sgcs/Simulated.swift +270 -0
- package/ios/Source/sgcs/mentraos_ble.pb.swift +3811 -0
- package/ios/Source/stt/STTTools.swift +154 -0
- package/ios/Source/stt/SherpaOnnxTranscriber.swift +401 -0
- package/ios/Source/utils/AudioSessionMonitor.swift +283 -0
- package/ios/Source/utils/Constants.swift +74 -0
- package/ios/Source/utils/Enums.swift +95 -0
- package/ios/Source/utils/G1Text.swift +2067 -0
- package/ios/Source/utils/JSCExperiment.swift +241 -0
- package/ios/Source/utils/MemoryMonitor.swift +44 -0
- package/ios/Source/utils/MessageChunker.swift +164 -0
- package/ios/Source/utils/Models.swift +135 -0
- package/ios/Source/utils/PhoneAudioMonitor.swift +226 -0
- package/ios/Source/utils/TarBz2Extractor.swift +206 -0
- package/package.json +78 -0
- package/plugin/build/index.d.ts +6 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/withAndroid.d.ts +4 -0
- package/plugin/build/withAndroid.js +80 -0
- package/plugin/build/withIos.d.ts +4 -0
- package/plugin/build/withIos.js +64 -0
- package/src/BluetoothSdk.types.ts +581 -0
- package/src/BluetoothSdkModule.ts +259 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
// Bluetooth SDK Event Types
|
|
2
|
+
export type GlassesNotReadyEvent = {
|
|
3
|
+
type: "glasses_not_ready"
|
|
4
|
+
message: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type ButtonPressEvent = {
|
|
8
|
+
type: "button_press"
|
|
9
|
+
buttonId: string
|
|
10
|
+
pressType: "long" | "short"
|
|
11
|
+
timestamp: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TouchEvent = {
|
|
15
|
+
type: "touch_event"
|
|
16
|
+
device_model?: string
|
|
17
|
+
gesture_name?: string
|
|
18
|
+
timestamp: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type HeadUpEvent = {
|
|
22
|
+
up: boolean
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type VadStatusEvent = {
|
|
26
|
+
type: "vad_status"
|
|
27
|
+
status: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type BatteryStatusEvent = {
|
|
31
|
+
type: "battery_status"
|
|
32
|
+
level: number
|
|
33
|
+
charging: boolean
|
|
34
|
+
timestamp: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type GlassesConnectionStatus =
|
|
38
|
+
| {state: 'disconnected'}
|
|
39
|
+
| {state: 'scanning'}
|
|
40
|
+
| {state: 'connecting'}
|
|
41
|
+
| {state: 'bonding'}
|
|
42
|
+
| {state: 'connected'; fullyBooted: boolean}
|
|
43
|
+
|
|
44
|
+
export type ConnectedGlassesConnectionStatus = Extract<GlassesConnectionStatus, {state: 'connected'}>
|
|
45
|
+
|
|
46
|
+
export function isConnectedGlassesConnectionStatus(
|
|
47
|
+
status: GlassesConnectionStatus,
|
|
48
|
+
): status is ConnectedGlassesConnectionStatus {
|
|
49
|
+
return status.state === 'connected'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function isReadyGlassesConnectionStatus(status: GlassesConnectionStatus): boolean {
|
|
53
|
+
return status.state === 'connected' && status.fullyBooted
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function isBusyGlassesConnectionStatus(status: GlassesConnectionStatus): boolean {
|
|
57
|
+
return status.state === 'scanning' || status.state === 'connecting' || status.state === 'bonding'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function createDisconnectedGlassesStatus(): Partial<GlassesStatus> {
|
|
61
|
+
return {
|
|
62
|
+
connection: {state: 'disconnected'},
|
|
63
|
+
hotspot: {state: 'disabled'},
|
|
64
|
+
wifi: {state: 'disconnected'},
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** K900 `sr_getvol` response (Mentra Live glasses media step volume 0–15). */
|
|
69
|
+
export type GlassesMediaVolumeGetResult = {
|
|
70
|
+
vol: number
|
|
71
|
+
statusCode: number
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** K900 `sr_vol` acknowledgment. */
|
|
75
|
+
export type GlassesMediaVolumeSetResult = {
|
|
76
|
+
statusCode: number
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type LocalTranscriptionEvent = {
|
|
80
|
+
text: string
|
|
81
|
+
isFinal?: boolean
|
|
82
|
+
transcribeLanguage?: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type LogEvent = {
|
|
86
|
+
message: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type WifiStatus = {state: 'disconnected'} | {state: 'connected'; ssid: string; localIp?: string}
|
|
90
|
+
|
|
91
|
+
export type ConnectedWifiStatus = Extract<WifiStatus, {state: 'connected'}>
|
|
92
|
+
|
|
93
|
+
export function isConnectedWifiStatus(status: WifiStatus): status is ConnectedWifiStatus {
|
|
94
|
+
return status.state === 'connected'
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type WifiStatusChangeEvent = WifiStatus & {
|
|
98
|
+
type: "wifi_status_change"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type HotspotStatus = {state: 'disabled'} | {state: 'enabled'; ssid: string; password: string; localIp: string}
|
|
102
|
+
|
|
103
|
+
export type EnabledHotspotStatus = Extract<HotspotStatus, {state: 'enabled'}>
|
|
104
|
+
|
|
105
|
+
export function isEnabledHotspotStatus(status: HotspotStatus): status is EnabledHotspotStatus {
|
|
106
|
+
return status.state === 'enabled'
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type HotspotStatusChangeEvent = HotspotStatus & {
|
|
110
|
+
type: "hotspot_status_change"
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type HotspotErrorEvent = {
|
|
114
|
+
type: "hotspot_error"
|
|
115
|
+
error_message: string
|
|
116
|
+
timestamp: number
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type PhotoResponseEvent =
|
|
120
|
+
| {
|
|
121
|
+
type: "photo_response"
|
|
122
|
+
state: "success"
|
|
123
|
+
requestId: string
|
|
124
|
+
photoUrl: string
|
|
125
|
+
timestamp: number
|
|
126
|
+
}
|
|
127
|
+
| {
|
|
128
|
+
type: "photo_response"
|
|
129
|
+
state: "error"
|
|
130
|
+
requestId: string
|
|
131
|
+
timestamp: number
|
|
132
|
+
errorCode?: string
|
|
133
|
+
errorMessage: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type GalleryStatusEvent = {
|
|
137
|
+
type: "gallery_status"
|
|
138
|
+
photos: number
|
|
139
|
+
videos: number
|
|
140
|
+
total: number
|
|
141
|
+
has_content: boolean
|
|
142
|
+
camera_busy: boolean
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type CompatibleGlassesSearchStopEvent = {
|
|
146
|
+
type: "compatible_glasses_search_stop"
|
|
147
|
+
device_model: string
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type HeartbeatSentEvent = {
|
|
151
|
+
type: "heartbeat_sent"
|
|
152
|
+
heartbeat_sent: {
|
|
153
|
+
timestamp: number
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type HeartbeatReceivedEvent = {
|
|
158
|
+
type: "heartbeat_received"
|
|
159
|
+
heartbeat_received: {
|
|
160
|
+
timestamp: number
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export type SwipeVolumeStatusEvent = {
|
|
165
|
+
type: "swipe_volume_status"
|
|
166
|
+
enabled: boolean
|
|
167
|
+
timestamp: number
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type SwitchStatusEvent = {
|
|
171
|
+
type: "switch_status"
|
|
172
|
+
switch_type?: number
|
|
173
|
+
switchType?: number
|
|
174
|
+
switch_value?: number
|
|
175
|
+
switchValue?: number
|
|
176
|
+
timestamp: number
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type RgbLedControlResponseEvent =
|
|
180
|
+
| {
|
|
181
|
+
type: "rgb_led_control_response"
|
|
182
|
+
state: "success"
|
|
183
|
+
requestId: string
|
|
184
|
+
}
|
|
185
|
+
| {
|
|
186
|
+
type: "rgb_led_control_response"
|
|
187
|
+
state: "error"
|
|
188
|
+
requestId: string
|
|
189
|
+
errorCode: string
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type RgbLedAction = "on" | "off"
|
|
193
|
+
export type RgbLedColor = "red" | "green" | "blue" | "orange" | "white"
|
|
194
|
+
/** `"auto"` enables local button photo/video capture; `"manual"` reports button events without local gallery capture. */
|
|
195
|
+
export type GalleryMode = "auto" | "manual"
|
|
196
|
+
export type PhotoSize = "small" | "medium" | "large" | "full"
|
|
197
|
+
export type ButtonPhotoSize = "small" | "medium" | "large"
|
|
198
|
+
export type PhotoCompression = "none" | "medium" | "heavy"
|
|
199
|
+
|
|
200
|
+
export type StreamVideoConfig = {
|
|
201
|
+
width?: number
|
|
202
|
+
height?: number
|
|
203
|
+
bitrate?: number
|
|
204
|
+
frameRate?: number
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type StreamAudioConfig = {
|
|
208
|
+
bitrate?: number
|
|
209
|
+
sampleRate?: number
|
|
210
|
+
echoCancellation?: boolean
|
|
211
|
+
noiseSuppression?: boolean
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export type StreamStartRequest = {
|
|
215
|
+
type?: "start_stream"
|
|
216
|
+
streamUrl: string
|
|
217
|
+
streamId?: string
|
|
218
|
+
keepAlive?: boolean
|
|
219
|
+
keepAliveIntervalSeconds?: number
|
|
220
|
+
flash?: boolean
|
|
221
|
+
sound?: boolean
|
|
222
|
+
video?: StreamVideoConfig
|
|
223
|
+
audio?: StreamAudioConfig
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export type StreamKeepAliveRequest = {
|
|
227
|
+
type?: "keep_stream_alive"
|
|
228
|
+
streamId: string
|
|
229
|
+
ackId: string
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type PairFailureEvent = {
|
|
233
|
+
type: "pair_failure"
|
|
234
|
+
error: string
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export type AudioPairingNeededEvent = {
|
|
238
|
+
type: "audio_pairing_needed"
|
|
239
|
+
device_name: string
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export type AudioConnectedEvent = {
|
|
243
|
+
type: "audio_connected"
|
|
244
|
+
device_name: string
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export type AudioDisconnectedEvent = {
|
|
248
|
+
type: "audio_disconnected"
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export type SaveSettingEvent = {
|
|
252
|
+
type: "save_setting"
|
|
253
|
+
key: string
|
|
254
|
+
value: any
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export type WsTextEvent = {
|
|
258
|
+
type: "ws_text"
|
|
259
|
+
text: string
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export type WsBinEvent = {
|
|
263
|
+
type: "ws_bin"
|
|
264
|
+
base64: string
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export type MicPcmEvent = {
|
|
268
|
+
type: "mic_pcm"
|
|
269
|
+
pcm: ArrayBuffer
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export type MicLc3Event = {
|
|
273
|
+
type: "mic_lc3"
|
|
274
|
+
lc3: ArrayBuffer
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export type StreamStatusLifecycleState = "initializing" | "streaming" | "stopping" | "stopped"
|
|
278
|
+
export type StreamStatusReconnectState = "reconnecting" | "reconnected" | "reconnect_failed"
|
|
279
|
+
export type StreamStatusState = StreamStatusLifecycleState | StreamStatusReconnectState | "error"
|
|
280
|
+
|
|
281
|
+
export type StreamStatusEvent =
|
|
282
|
+
| {
|
|
283
|
+
type: "stream_status"
|
|
284
|
+
kind: "lifecycle"
|
|
285
|
+
status: StreamStatusLifecycleState
|
|
286
|
+
streamId?: string
|
|
287
|
+
timestamp?: number
|
|
288
|
+
}
|
|
289
|
+
| {
|
|
290
|
+
type: "stream_status"
|
|
291
|
+
kind: "reconnect"
|
|
292
|
+
status: "reconnecting"
|
|
293
|
+
streamId?: string
|
|
294
|
+
attempt: number
|
|
295
|
+
maxAttempts: number
|
|
296
|
+
reason: string
|
|
297
|
+
timestamp?: number
|
|
298
|
+
}
|
|
299
|
+
| {
|
|
300
|
+
type: "stream_status"
|
|
301
|
+
kind: "reconnect"
|
|
302
|
+
status: "reconnected"
|
|
303
|
+
streamId?: string
|
|
304
|
+
attempt: number
|
|
305
|
+
timestamp?: number
|
|
306
|
+
}
|
|
307
|
+
| {
|
|
308
|
+
type: "stream_status"
|
|
309
|
+
kind: "reconnect"
|
|
310
|
+
status: "reconnect_failed"
|
|
311
|
+
streamId?: string
|
|
312
|
+
maxAttempts: number
|
|
313
|
+
timestamp?: number
|
|
314
|
+
}
|
|
315
|
+
| {
|
|
316
|
+
type: "stream_status"
|
|
317
|
+
kind: "error"
|
|
318
|
+
status: "error"
|
|
319
|
+
streamId?: string
|
|
320
|
+
errorDetails: string
|
|
321
|
+
timestamp?: number
|
|
322
|
+
}
|
|
323
|
+
| {
|
|
324
|
+
type: "stream_status"
|
|
325
|
+
kind: "snapshot"
|
|
326
|
+
status: "streaming" | "reconnecting" | "stopped"
|
|
327
|
+
streaming: boolean
|
|
328
|
+
reconnecting: boolean
|
|
329
|
+
streamId?: string
|
|
330
|
+
attempt?: number
|
|
331
|
+
timestamp?: number
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export type KeepAliveAckEvent = {
|
|
335
|
+
type: "keep_alive_ack"
|
|
336
|
+
streamId: string
|
|
337
|
+
ackId: string
|
|
338
|
+
timestamp?: number
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export type MtkUpdateCompleteEvent = {
|
|
342
|
+
type: "mtk_update_complete"
|
|
343
|
+
message: string
|
|
344
|
+
timestamp: number
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export type OtaUpdateAvailableEvent = {
|
|
348
|
+
type: "ota_update_available"
|
|
349
|
+
version_code?: number
|
|
350
|
+
version_name?: string
|
|
351
|
+
updates?: string[]
|
|
352
|
+
total_size?: number
|
|
353
|
+
cache_ready?: boolean
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** @deprecated Glasses no longer emit ota_progress; use {@link OtaStatusEvent} and legacy store mapping. */
|
|
357
|
+
export type OtaProgressEvent = {
|
|
358
|
+
type: "ota_progress"
|
|
359
|
+
stage?: OtaStage
|
|
360
|
+
status?: OtaProgressStatus
|
|
361
|
+
progress?: number
|
|
362
|
+
bytes_downloaded?: number
|
|
363
|
+
total_bytes?: number
|
|
364
|
+
current_update?: string
|
|
365
|
+
error_message?: string
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export type OtaStartAckEvent = {
|
|
369
|
+
type: "ota_start_ack"
|
|
370
|
+
timestamp: number
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export type OtaStatusEvent = {
|
|
374
|
+
type: "ota_status"
|
|
375
|
+
session_id: string
|
|
376
|
+
total_steps: number
|
|
377
|
+
current_step: number
|
|
378
|
+
step_type: 'apk' | 'mtk' | 'bes'
|
|
379
|
+
phase: 'download' | 'install'
|
|
380
|
+
step_percent: number
|
|
381
|
+
overall_percent: number
|
|
382
|
+
status: 'in_progress' | 'step_complete' | 'complete' | 'failed' | 'idle'
|
|
383
|
+
error_message?: string
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Nex BLE protobuf trace (NexEventUtils); payload matches native Map keys. */
|
|
387
|
+
export type BleCommandTraceEvent = {
|
|
388
|
+
command: string
|
|
389
|
+
commandText: string
|
|
390
|
+
timestamp: number
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export type MiniappSelectedEvent = {
|
|
394
|
+
type: "miniapp_selected"
|
|
395
|
+
packageName: string
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Union type of all Bluetooth SDK events
|
|
399
|
+
export type BluetoothSdkEvent = Parameters<BluetoothSdkModuleEvents[keyof BluetoothSdkModuleEvents]>[0]
|
|
400
|
+
|
|
401
|
+
export type BluetoothSdkModuleEvents = {
|
|
402
|
+
glasses_status: (changed: Partial<GlassesStatus>) => void
|
|
403
|
+
bluetooth_status: (changed: Partial<BluetoothStatus>) => void
|
|
404
|
+
log: (event: LogEvent) => void
|
|
405
|
+
device_discovered: (device: Device) => void
|
|
406
|
+
default_device_changed: (event: {device?: Device}) => void
|
|
407
|
+
// Individual event handlers
|
|
408
|
+
glasses_not_ready: (event: GlassesNotReadyEvent) => void
|
|
409
|
+
button_press: (event: ButtonPressEvent) => void
|
|
410
|
+
touch_event: (event: TouchEvent) => void
|
|
411
|
+
head_up: (event: HeadUpEvent) => void
|
|
412
|
+
vad_status: (event: VadStatusEvent) => void
|
|
413
|
+
battery_status: (event: BatteryStatusEvent) => void
|
|
414
|
+
local_transcription: (event: LocalTranscriptionEvent) => void
|
|
415
|
+
wifi_status_change: (event: WifiStatusChangeEvent) => void
|
|
416
|
+
hotspot_status_change: (event: HotspotStatusChangeEvent) => void
|
|
417
|
+
hotspot_error: (event: HotspotErrorEvent) => void
|
|
418
|
+
photo_response: (event: PhotoResponseEvent) => void
|
|
419
|
+
gallery_status: (event: GalleryStatusEvent) => void
|
|
420
|
+
compatible_glasses_search_stop: (event: CompatibleGlassesSearchStopEvent) => void
|
|
421
|
+
heartbeat_sent: (event: HeartbeatSentEvent) => void
|
|
422
|
+
heartbeat_received: (event: HeartbeatReceivedEvent) => void
|
|
423
|
+
swipe_volume_status: (event: SwipeVolumeStatusEvent) => void
|
|
424
|
+
switch_status: (event: SwitchStatusEvent) => void
|
|
425
|
+
rgb_led_control_response: (event: RgbLedControlResponseEvent) => void
|
|
426
|
+
pair_failure: (event: PairFailureEvent) => void
|
|
427
|
+
audio_pairing_needed: (event: AudioPairingNeededEvent) => void
|
|
428
|
+
audio_connected: (event: AudioConnectedEvent) => void
|
|
429
|
+
audio_disconnected: (event: AudioDisconnectedEvent) => void
|
|
430
|
+
save_setting: (event: SaveSettingEvent) => void
|
|
431
|
+
ws_text: (event: WsTextEvent) => void
|
|
432
|
+
ws_bin: (event: WsBinEvent) => void
|
|
433
|
+
mic_pcm: (event: MicPcmEvent) => void
|
|
434
|
+
mic_lc3: (event: MicLc3Event) => void
|
|
435
|
+
stream_status: (event: StreamStatusEvent) => void
|
|
436
|
+
keep_alive_ack: (event: KeepAliveAckEvent) => void
|
|
437
|
+
mtk_update_complete: (event: MtkUpdateCompleteEvent) => void
|
|
438
|
+
ota_update_available: (event: OtaUpdateAvailableEvent) => void
|
|
439
|
+
ota_start_ack: (event: OtaStartAckEvent) => void
|
|
440
|
+
ota_status: (event: OtaStatusEvent) => void
|
|
441
|
+
send_command_to_ble: (event: BleCommandTraceEvent) => void
|
|
442
|
+
receive_command_from_ble: (event: BleCommandTraceEvent) => void
|
|
443
|
+
miniapp_selected: (event: MiniappSelectedEvent) => void
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// OTA update status types
|
|
447
|
+
export type OtaStage = "download" | "install"
|
|
448
|
+
export type OtaProgressStatus = "STARTED" | "PROGRESS" | "FINISHED" | "FAILED"
|
|
449
|
+
|
|
450
|
+
export interface OtaStatus {
|
|
451
|
+
sessionId: string
|
|
452
|
+
totalSteps: number
|
|
453
|
+
currentStep: number
|
|
454
|
+
stepType: 'apk' | 'mtk' | 'bes'
|
|
455
|
+
phase: 'download' | 'install'
|
|
456
|
+
stepPercent: number
|
|
457
|
+
overallPercent: number
|
|
458
|
+
status: 'in_progress' | 'step_complete' | 'complete' | 'failed' | 'idle'
|
|
459
|
+
error?: string
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface OtaUpdateInfo {
|
|
463
|
+
available: boolean
|
|
464
|
+
versionCode: number
|
|
465
|
+
versionName: string
|
|
466
|
+
updates: string[] // ["apk", "mtk", "bes"]
|
|
467
|
+
totalSize: number
|
|
468
|
+
cacheReady?: boolean
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export interface OtaProgress {
|
|
472
|
+
stage: OtaStage
|
|
473
|
+
status: OtaProgressStatus
|
|
474
|
+
progress: number
|
|
475
|
+
bytesDownloaded: number
|
|
476
|
+
totalBytes: number
|
|
477
|
+
currentUpdate: string
|
|
478
|
+
errorMessage?: string
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface GlassesStatus {
|
|
482
|
+
// state:
|
|
483
|
+
connection: GlassesConnectionStatus
|
|
484
|
+
micEnabled: boolean
|
|
485
|
+
btcConnected: boolean
|
|
486
|
+
signalStrength: number
|
|
487
|
+
/** Milliseconds since epoch when signalStrength was last refreshed by the phone BLE stack. */
|
|
488
|
+
signalStrengthUpdatedAt: number
|
|
489
|
+
// device info
|
|
490
|
+
deviceModel: string
|
|
491
|
+
androidVersion: string
|
|
492
|
+
fwVersion: string
|
|
493
|
+
besFwVersion: string
|
|
494
|
+
mtkFwVersion: string
|
|
495
|
+
btMacAddress: string
|
|
496
|
+
leftMacAddress: string
|
|
497
|
+
rightMacAddress: string
|
|
498
|
+
buildNumber: string
|
|
499
|
+
otaVersionUrl: string
|
|
500
|
+
appVersion: string
|
|
501
|
+
bluetoothName: string
|
|
502
|
+
serialNumber: string
|
|
503
|
+
style: string
|
|
504
|
+
color: string
|
|
505
|
+
// wifi info
|
|
506
|
+
wifi: WifiStatus
|
|
507
|
+
// battery info
|
|
508
|
+
batteryLevel: number
|
|
509
|
+
charging: boolean
|
|
510
|
+
caseBatteryLevel: number
|
|
511
|
+
caseCharging: boolean
|
|
512
|
+
caseOpen: boolean
|
|
513
|
+
caseRemoved: boolean
|
|
514
|
+
// hotspot info
|
|
515
|
+
hotspot: HotspotStatus
|
|
516
|
+
// OTA update info
|
|
517
|
+
otaUpdateAvailable: OtaUpdateInfo | null
|
|
518
|
+
otaProgress: OtaProgress | null
|
|
519
|
+
otaInProgress: boolean
|
|
520
|
+
// ring info
|
|
521
|
+
controllerConnected: boolean
|
|
522
|
+
controllerFullyBooted: boolean
|
|
523
|
+
controllerMacAddress: string
|
|
524
|
+
controllerBatteryLevel: number
|
|
525
|
+
controllerSignalStrength: number
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
interface DashboardMenuItem {
|
|
529
|
+
name: string
|
|
530
|
+
packageName: string
|
|
531
|
+
running: boolean
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export interface CoreSettings {
|
|
535
|
+
menu_apps: DashboardMenuItem[]
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export type MicRanking = "auto" | "phone" | "glasses" | "bluetooth"
|
|
539
|
+
|
|
540
|
+
export interface Device {
|
|
541
|
+
id: string
|
|
542
|
+
model: string
|
|
543
|
+
name: string
|
|
544
|
+
address?: string
|
|
545
|
+
rssi?: number
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export interface DeviceScanRequest {
|
|
549
|
+
model: string
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export interface ConnectOptions {
|
|
553
|
+
saveAsDefault?: boolean
|
|
554
|
+
cancelExistingConnectionAttempt?: boolean
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export interface WifiSearchResult {
|
|
558
|
+
ssid: string
|
|
559
|
+
requiresPassword: boolean
|
|
560
|
+
signalStrength: number
|
|
561
|
+
/** Frequency in MHz (from glasses scan). 5 GHz band is typically 5170–5825. Omitted if unknown. */
|
|
562
|
+
frequency?: number
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export interface BluetoothStatus {
|
|
566
|
+
// state:
|
|
567
|
+
searching: boolean
|
|
568
|
+
searchingController: boolean
|
|
569
|
+
default_wearable?: string
|
|
570
|
+
device_name?: string
|
|
571
|
+
device_address?: string
|
|
572
|
+
systemMicUnavailable: boolean
|
|
573
|
+
micRanking: MicRanking[]
|
|
574
|
+
currentMic: MicRanking | null
|
|
575
|
+
searchResults: Device[]
|
|
576
|
+
wifiScanResults: WifiSearchResult[]
|
|
577
|
+
lastLog: string[]
|
|
578
|
+
otherBtConnected: boolean
|
|
579
|
+
// desired settings the SDK sends to compatible connected glasses:
|
|
580
|
+
gallery_mode: boolean
|
|
581
|
+
}
|