@glassly/bluetooth-sdk 0.1.0-dev.26
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 +563 -0
- package/android/build.gradle +450 -0
- package/android/gradle.properties.example +9 -0
- package/android/lc3Lib/CMakeLists.txt +6 -0
- package/android/lc3Lib/build.gradle +212 -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/glassly/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 +4 -0
- package/android/silero/LICENSE.md +17 -0
- package/android/silero/build.gradle +50 -0
- package/android/silero/proguard-rules.pro +24 -0
- package/android/silero/src/androidTest/assets/hello.wav +0 -0
- package/android/silero/src/androidTest/java/com/konovalov/vad/silero/VadSileroTest.kt +79 -0
- package/android/silero/src/main/assets/LICENSE +21 -0
- package/android/silero/src/main/assets/silero_vad.onnx +0 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/Vad.kt +160 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/VadSilero.kt +449 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/FrameSize.kt +15 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/Mode.kt +14 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/SampleRate.kt +12 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/AudioUtils.kt +47 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/TensorMap.kt +41 -0
- package/android/silero/src/test/java/com/konovalov/vad/silero/utils/AudioUtilsTest.kt +44 -0
- package/android/src/main/AndroidManifest.xml +42 -0
- package/android/src/main/assets/G2Firmware/README.md +11 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdk.kt +2325 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkAnalytics.kt +216 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkDebug.kt +14 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkDefaults.kt +7 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkModule.kt +1088 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/Bridge.kt +953 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/DeviceManager.kt +2528 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/DeviceStore.kt +360 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedChangelogCatalog.kt +8 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedReleaseMetadata.kt +11 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/LocalNetworkModule.kt +414 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/ObservableStore.kt +88 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/OtaManifest.kt +191 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/ReleaseChangelog.kt +61 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/ScopedNetworkReadiness.kt +17 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/audio/AudioModels.kt +144 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/camera/CameraModels.kt +486 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/connection/ConnectionModels.kt +78 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/controllers/ControllerManager.kt +158 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/controllers/R1.kt +937 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/debug/BleTraceLogger.kt +165 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/events/BluetoothEvents.kt +178 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/internal/MapParsing.kt +140 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/net/LocalIpv4.kt +57 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/otaserver/LocalOtaServer.kt +304 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/otaserver/OtaServerModule.kt +120 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoReceiverRegistry.java +108 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoUploadServer.kt +622 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/PhotoReceiverModule.kt +156 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/requests/DisplayRequests.kt +56 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/services/Foreground.kt +272 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/services/PhoneMic.kt +1195 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Ar99.java +2653 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/BesOtaHeartbeatGuard.kt +49 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/BesOtaProgressMapper.kt +27 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1.kt +3878 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizer.kt +38 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2.kt +6428 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwClassification.kt +49 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwRenderer.kt +1241 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwTextureCache.kt +270 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2FlashProtocol.kt +291 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2Flasher.kt +411 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/GlasslyBle.java +43189 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Mach1.kt +1280 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLive.kt +10817 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLiveL2capChannel.kt +274 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLivePairingAdvertisement.kt +54 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraNex.kt +2011 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Nimo.kt +2532 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/SGCManager.kt +470 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Simulated.kt +228 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/Ar99OtaManager.java +566 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaByteUtils.java +18 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaCommandConstants.java +35 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaCrc32Util.java +13 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaGattTransport.java +11 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaProtocol.java +92 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/speakerid/SpeakerIdEngine.kt +525 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/status/DeviceStatus.kt +669 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/status/RuntimeState.kt +201 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/status/WifiHotspotStatus.kt +189 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/streaming/StreamModels.kt +518 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/stt/STTTools.kt +391 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +518 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/stt/VadGateSpeechPolicy.kt +229 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/tts/TTSTools.kt +248 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/types/DeviceModels.kt +96 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/AES.java +106 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/AudioSessionMonitor.kt +189 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/AvifExifStripper.java +573 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BitmapJavaUtils.java +169 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BleJsonCompact.java +496 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BlePhotoUploadService.java +677 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BleWireProtocol.java +108 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/Constants.kt +46 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/G1Text.kt +436 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/HeifExifTagReader.java +199 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +29 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/IncidentLogBleUploadService.java +77 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/K900LengthCodec.java +115 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtils.java +827 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/MessageChunkReassembler.java +228 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/MessageChunker.java +325 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/NexSGCUtils.kt +698 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/PhoneAudioMonitor.kt +348 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/SmartGlassesConnectionState.java +9 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/Ar99OpusPcmDecoder.java +398 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/ByteUtilAudioPlayer.java +655 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/Lc3Player.java +441 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/PCMAudioPlayer.java +431 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/PcmStreamPlayer.kt +328 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/BluetoothSdkExceptionTest.kt +18 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/OtaManifestDowngradeTest.kt +86 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/OtaStartResponsePolicyTest.kt +30 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/ReleaseChangelogTest.kt +13 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/ScopedNetworkReadinessTest.kt +39 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/StreamStatusEventTest.kt +29 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/camera/PhotoRequestTest.kt +141 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/otaserver/LocalOtaServerTest.kt +82 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoReceiverRegistryTest.java +75 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/services/ForegroundServiceTypeTest.kt +69 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/Ar99AdvertisementMatcherTest.java +22 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/BesOtaHeartbeatGuardTest.kt +73 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/BesOtaProgressMapperTest.kt +67 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/EvenRleTest.kt +63 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizerTest.kt +31 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwClassificationTest.kt +89 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwRendererTest.kt +344 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwTextureCacheTest.kt +200 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2FlashProtocolTest.kt +131 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/MentraLiveGattCharacteristicsTest.kt +39 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/MentraLivePairingAdvertisementParserTest.kt +133 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/NimoProtocolTest.kt +333 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/AvifExifStripperTest.java +46 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/BinaryMessageChunkerTest.java +84 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/BleJsonCompactTest.java +319 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/BlePhotoUploadServiceTest.java +107 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtilsEndiannessTest.java +172 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtilsTest.java +24 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/PhoneAudioMonitorTest.kt +45 -0
- package/android/src/test/resources/avif_with_exif.avif +0 -0
- package/app.plugin.js +3 -0
- package/build/BluetoothSdk.types.d.ts +1354 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -0
- package/build/BluetoothSdk.types.js +41 -0
- package/build/BluetoothSdk.types.js.map +1 -0
- package/build/_internal.d.ts +17 -0
- package/build/_internal.d.ts.map +1 -0
- package/build/_internal.js +16 -0
- package/build/_internal.js.map +1 -0
- package/build/_private/BluetoothSdkModule.d.ts +172 -0
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -0
- package/build/_private/BluetoothSdkModule.js +300 -0
- package/build/_private/BluetoothSdkModule.js.map +1 -0
- package/build/_private/LocalNetworkModule.d.ts +38 -0
- package/build/_private/LocalNetworkModule.d.ts.map +1 -0
- package/build/_private/LocalNetworkModule.js +3 -0
- package/build/_private/LocalNetworkModule.js.map +1 -0
- package/build/_private/cameraRequestPayload.d.ts +4 -0
- package/build/_private/cameraRequestPayload.d.ts.map +1 -0
- package/build/_private/cameraRequestPayload.js +32 -0
- package/build/_private/cameraRequestPayload.js.map +1 -0
- package/build/_private/photoRequestPayload.d.ts +6 -0
- package/build/_private/photoRequestPayload.d.ts.map +1 -0
- package/build/_private/photoRequestPayload.js +86 -0
- package/build/_private/photoRequestPayload.js.map +1 -0
- package/build/_private/sdkOtaManifest.d.ts +11 -0
- package/build/_private/sdkOtaManifest.d.ts.map +1 -0
- package/build/_private/sdkOtaManifest.js +15 -0
- package/build/_private/sdkOtaManifest.js.map +1 -0
- package/build/changelogs.d.ts +7 -0
- package/build/changelogs.d.ts.map +1 -0
- package/build/changelogs.js +46 -0
- package/build/changelogs.js.map +1 -0
- package/build/debug.d.ts +3 -0
- package/build/debug.d.ts.map +1 -0
- package/build/debug.js +8 -0
- package/build/debug.js.map +1 -0
- package/build/generated/changelogCatalog.d.ts +9 -0
- package/build/generated/changelogCatalog.d.ts.map +1 -0
- package/build/generated/changelogCatalog.js +12 -0
- package/build/generated/changelogCatalog.js.map +1 -0
- package/build/generated/releaseMetadata.d.ts +12 -0
- package/build/generated/releaseMetadata.d.ts.map +1 -0
- package/build/generated/releaseMetadata.js +10 -0
- package/build/generated/releaseMetadata.js.map +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +171 -0
- package/build/index.js.map +1 -0
- package/build/ota-server/OtaServer.types.d.ts +14 -0
- package/build/ota-server/OtaServer.types.d.ts.map +1 -0
- package/build/ota-server/OtaServer.types.js +2 -0
- package/build/ota-server/OtaServer.types.js.map +1 -0
- package/build/ota-server/OtaServerModule.d.ts +21 -0
- package/build/ota-server/OtaServerModule.d.ts.map +1 -0
- package/build/ota-server/OtaServerModule.js +3 -0
- package/build/ota-server/OtaServerModule.js.map +1 -0
- package/build/ota-server/OtaServerModule.web.d.ts +10 -0
- package/build/ota-server/OtaServerModule.web.d.ts.map +1 -0
- package/build/ota-server/OtaServerModule.web.js +12 -0
- package/build/ota-server/OtaServerModule.web.js.map +1 -0
- package/build/ota-server/index.d.ts +3 -0
- package/build/ota-server/index.d.ts.map +1 -0
- package/build/ota-server/index.js +3 -0
- package/build/ota-server/index.js.map +1 -0
- package/build/ota-transport/index.d.ts +67 -0
- package/build/ota-transport/index.d.ts.map +1 -0
- package/build/ota-transport/index.js +58 -0
- package/build/ota-transport/index.js.map +1 -0
- package/build/photo-receiver/PhotoReceiver.types.d.ts +18 -0
- package/build/photo-receiver/PhotoReceiver.types.d.ts.map +1 -0
- package/build/photo-receiver/PhotoReceiver.types.js +2 -0
- package/build/photo-receiver/PhotoReceiver.types.js.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.d.ts +10 -0
- package/build/photo-receiver/PhotoReceiverModule.d.ts.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.js +3 -0
- package/build/photo-receiver/PhotoReceiverModule.js.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.web.d.ts +10 -0
- package/build/photo-receiver/PhotoReceiverModule.web.d.ts.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.web.js +12 -0
- package/build/photo-receiver/PhotoReceiverModule.web.js.map +1 -0
- package/build/photo-receiver/index.d.ts +3 -0
- package/build/photo-receiver/index.d.ts.map +1 -0
- package/build/photo-receiver/index.js +3 -0
- package/build/photo-receiver/index.js.map +1 -0
- package/build/react/index.d.ts +5 -0
- package/build/react/index.d.ts.map +1 -0
- package/build/react/index.js +4 -0
- package/build/react/index.js.map +1 -0
- package/build/react/useBluetooth.d.ts +100 -0
- package/build/react/useBluetooth.d.ts.map +1 -0
- package/build/react/useBluetooth.js +167 -0
- package/build/react/useBluetooth.js.map +1 -0
- package/build/react/useBluetoothEvent.d.ts +6 -0
- package/build/react/useBluetoothEvent.d.ts.map +1 -0
- package/build/react/useBluetoothEvent.js +21 -0
- package/build/react/useBluetoothEvent.js.map +1 -0
- package/build/react/useBluetoothScan.d.ts +22 -0
- package/build/react/useBluetoothScan.d.ts.map +1 -0
- package/build/react/useBluetoothScan.js +135 -0
- package/build/react/useBluetoothScan.js.map +1 -0
- package/build/react/useBluetoothStatus.d.ts +16 -0
- package/build/react/useBluetoothStatus.d.ts.map +1 -0
- package/build/react/useBluetoothStatus.js +137 -0
- package/build/react/useBluetoothStatus.js.map +1 -0
- package/build/react/useGlassesConnection.d.ts +29 -0
- package/build/react/useGlassesConnection.d.ts.map +1 -0
- package/build/react/useGlassesConnection.js +153 -0
- package/build/react/useGlassesConnection.js.map +1 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +2 -0
- package/build/types/index.js.map +1 -0
- package/expo-module.config.json +14 -0
- package/ios/BackgroundOtaArtifactDownloader.swift +125 -0
- package/ios/BluetoothSdkModule.swift +1034 -0
- package/ios/GlasslyBluetoothSDK.podspec +106 -0
- package/ios/LocalIPv4.swift +150 -0
- package/ios/LocalOtaServer.swift +309 -0
- package/ios/LocalPhotoUploadServer.swift +754 -0
- package/ios/OtaServerModule.swift +147 -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/include/PcmConverter.h +22 -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 +2383 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Info.plist +48 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/c-api.h +4689 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/cxx-api.h +2036 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/c-api.h +4689 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/cxx-api.h +2036 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +0 -0
- package/ios/Packages/libbz2/module.modulemap +5 -0
- package/ios/Packages/libbz2/shim.h +1 -0
- package/ios/PhotoReceiverModule.swift +129 -0
- package/ios/Source/BluetoothSDK.swift +2303 -0
- package/ios/Source/BluetoothSDKDebug.swift +12 -0
- package/ios/Source/BluetoothSdkDefaults.swift +29 -0
- package/ios/Source/Bridge.swift +708 -0
- package/ios/Source/Bridging-Header.h +16 -0
- package/ios/Source/DeviceManager.swift +2109 -0
- package/ios/Source/DeviceStore.swift +336 -0
- package/ios/Source/GeneratedChangelogCatalog.swift +7 -0
- package/ios/Source/GeneratedReleaseMetadata.swift +11 -0
- package/ios/Source/ObservableStore.swift +118 -0
- package/ios/Source/OtaManifest.swift +211 -0
- package/ios/Source/PrivacyInfo.xcprivacy +23 -0
- package/ios/Source/ReleaseChangelog.swift +65 -0
- package/ios/Source/Resources/G2Firmware/README.md +10 -0
- package/ios/Source/audio/AudioModels.swift +178 -0
- package/ios/Source/audio/PcmStreamPlayer.swift +410 -0
- package/ios/Source/camera/CameraModels.swift +866 -0
- package/ios/Source/connection/ScanSession.swift +27 -0
- package/ios/Source/controllers/ControllerManager.swift +184 -0
- package/ios/Source/controllers/R1.swift +829 -0
- package/ios/Source/errors/BluetoothSdkError.swift +19 -0
- package/ios/Source/events/BluetoothEvents.swift +342 -0
- package/ios/Source/internal/BleTraceLogger.swift +192 -0
- package/ios/Source/internal/BluetoothAvailability.swift +78 -0
- package/ios/Source/internal/BluetoothSdkAnalytics.swift +199 -0
- package/ios/Source/internal/ValueParsing.swift +99 -0
- package/ios/Source/requests/DisplayRequests.swift +82 -0
- package/ios/Source/services/PhoneMic.swift +662 -0
- package/ios/Source/sgcs/Ar99.swift +2451 -0
- package/ios/Source/sgcs/Frame.swift +649 -0
- package/ios/Source/sgcs/G1.swift +2554 -0
- package/ios/Source/sgcs/G2.swift +6887 -0
- package/ios/Source/sgcs/G2CfwClassification.swift +43 -0
- package/ios/Source/sgcs/G2CfwRenderer.swift +1279 -0
- package/ios/Source/sgcs/G2CfwTextureCache.swift +233 -0
- package/ios/Source/sgcs/G2FlashProtocol.swift +312 -0
- package/ios/Source/sgcs/G2Flasher.swift +773 -0
- package/ios/Source/sgcs/Mach1.swift +541 -0
- package/ios/Source/sgcs/MentraLive.swift +7011 -0
- package/ios/Source/sgcs/MentraLiveL2capChannel.swift +183 -0
- package/ios/Source/sgcs/MentraLivePairingAdvertisement.swift +64 -0
- package/ios/Source/sgcs/MentraNex.swift +3221 -0
- package/ios/Source/sgcs/Nimo.swift +1886 -0
- package/ios/Source/sgcs/SGCManager.swift +608 -0
- package/ios/Source/sgcs/Simulated.swift +274 -0
- package/ios/Source/sgcs/ar99/ota/Ar99OtaManager.swift +637 -0
- package/ios/Source/sgcs/glassly_ble.pb.swift +4354 -0
- package/ios/Source/speakerid/SpeakerIdEngine.swift +573 -0
- package/ios/Source/status/DeviceStatus.swift +981 -0
- package/ios/Source/status/RuntimeState.swift +359 -0
- package/ios/Source/status/WifiHotspotStatus.swift +345 -0
- package/ios/Source/streaming/StreamModels.swift +693 -0
- package/ios/Source/stt/STTTools.swift +191 -0
- package/ios/Source/stt/SherpaOnnxTranscriber.swift +466 -0
- package/ios/Source/tts/TTSTools.swift +171 -0
- package/ios/Source/types/DeviceModels.swift +177 -0
- package/ios/Source/utils/AudioSessionMonitor.swift +283 -0
- package/ios/Source/utils/BinaryCodec.swift +61 -0
- package/ios/Source/utils/BleJsonCompact.swift +405 -0
- package/ios/Source/utils/BleWireProtocol.swift +92 -0
- package/ios/Source/utils/Constants.swift +78 -0
- package/ios/Source/utils/Enums.swift +95 -0
- package/ios/Source/utils/G1Text.swift +2096 -0
- package/ios/Source/utils/JSCExperiment.swift +241 -0
- package/ios/Source/utils/MemoryMonitor.swift +44 -0
- package/ios/Source/utils/MessageChunkReassembler.swift +190 -0
- package/ios/Source/utils/MessageChunker.swift +294 -0
- package/ios/Source/utils/Models.swift +135 -0
- package/ios/Source/utils/PhoneAudioMonitor.swift +230 -0
- package/ios/Source/utils/TarBz2Extractor.swift +257 -0
- package/ios/Tests/BluetoothSDKTests/G2CfwClassificationTests.swift +78 -0
- package/ios/Tests/BluetoothSDKTests/G2CfwRendererTests.swift +372 -0
- package/ios/Tests/BluetoothSDKTests/G2CfwTextureCacheTests.swift +162 -0
- package/ios/Tests/BluetoothSDKTests/G2FlashProtocolTests.swift +182 -0
- package/ios/Tests/MentraLivePairingAdvertisementTests.swift +160 -0
- package/ios/Tests/ReleaseChangelogTests.swift +13 -0
- package/package.json +129 -0
- package/plugin/build/index.d.ts +10 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/withAndroid.d.ts +3 -0
- package/plugin/build/withAndroid.js +190 -0
- package/plugin/build/withIos.d.ts +5 -0
- package/plugin/build/withIos.js +108 -0
- package/scripts/inject-ios-sdk-version.mjs +65 -0
- package/scripts/public-ota-api.test.mjs +37 -0
- package/scripts/verify-release-package.mjs +45 -0
- package/scripts/write-release-metadata.mjs +152 -0
- package/scripts/write-release-metadata.test.mjs +37 -0
- package/src/BluetoothSdk.types.ts +1623 -0
- package/src/_internal.ts +16 -0
- package/src/_private/BluetoothSdkModule.ts +684 -0
- package/src/_private/LocalNetworkModule.ts +50 -0
- package/src/_private/cameraRequestPayload.ts +34 -0
- package/src/_private/photoRequestPayload.ts +90 -0
- package/src/_private/sdkOtaManifest.ts +18 -0
- package/src/changelogs.ts +46 -0
- package/src/debug.ts +9 -0
- package/src/generated/changelogCatalog.ts +13 -0
- package/src/generated/releaseMetadata.ts +20 -0
- package/src/index.ts +321 -0
- package/src/ota-server/OtaServer.types.ts +10 -0
- package/src/ota-server/OtaServerModule.ts +23 -0
- package/src/ota-server/OtaServerModule.web.ts +17 -0
- package/src/ota-server/index.ts +2 -0
- package/src/ota-transport/index.ts +116 -0
- package/src/photo-receiver/PhotoReceiver.types.ts +20 -0
- package/src/photo-receiver/PhotoReceiverModule.ts +11 -0
- package/src/photo-receiver/PhotoReceiverModule.web.ts +17 -0
- package/src/photo-receiver/index.ts +2 -0
- package/src/react/index.ts +21 -0
- package/src/react/useBluetooth.ts +309 -0
- package/src/react/useBluetoothEvent.ts +35 -0
- package/src/react/useBluetoothScan.ts +173 -0
- package/src/react/useBluetoothStatus.ts +180 -0
- package/src/react/useGlassesConnection.ts +202 -0
- package/src/types/index.ts +12 -0
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
/// One element of a scene frame (display.render()). Geometry is raw pixels on
|
|
4
|
+
/// the device's drawable canvas; `change` is the host differ's annotation
|
|
5
|
+
/// against the previous frame sent to this device.
|
|
6
|
+
struct SceneElement: Sendable {
|
|
7
|
+
let id: String
|
|
8
|
+
let type: String // "text" | "rect" | "image"
|
|
9
|
+
let x: Int32
|
|
10
|
+
let y: Int32
|
|
11
|
+
let w: Int32
|
|
12
|
+
let h: Int32
|
|
13
|
+
let text: String?
|
|
14
|
+
let data: String? // base64 image pixels (SGC decodes → re-encodes to wire format)
|
|
15
|
+
let border: Int32
|
|
16
|
+
let radius: Int32
|
|
17
|
+
let change: String // "created" | "updated" | "moved" | "unchanged"
|
|
18
|
+
let contentHash: String
|
|
19
|
+
/// Text style: "mono" draws fixed-pitch at `fontSize` px with a fixed 1.2× line
|
|
20
|
+
/// height (grid text); anything else is the default proportional face.
|
|
21
|
+
let font: String
|
|
22
|
+
let fontSize: Int32
|
|
23
|
+
|
|
24
|
+
init(
|
|
25
|
+
id: String, type: String, x: Int32, y: Int32, w: Int32, h: Int32, text: String?, data: String?,
|
|
26
|
+
border: Int32, radius: Int32, change: String, contentHash: String,
|
|
27
|
+
font: String = "default", fontSize: Int32 = 0
|
|
28
|
+
) {
|
|
29
|
+
self.id = id
|
|
30
|
+
self.type = type
|
|
31
|
+
self.x = x
|
|
32
|
+
self.y = y
|
|
33
|
+
self.w = w
|
|
34
|
+
self.h = h
|
|
35
|
+
self.text = text
|
|
36
|
+
self.data = data
|
|
37
|
+
self.border = border
|
|
38
|
+
self.radius = radius
|
|
39
|
+
self.change = change
|
|
40
|
+
self.contentHash = contentHash
|
|
41
|
+
self.font = font
|
|
42
|
+
self.fontSize = fontSize
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
func with(change: String) -> SceneElement {
|
|
46
|
+
SceneElement(
|
|
47
|
+
id: id, type: type, x: x, y: y, w: w, h: h, text: text, data: data,
|
|
48
|
+
border: border, radius: radius, change: change, contentHash: contentHash,
|
|
49
|
+
font: font, fontSize: fontSize
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// A whole scene from the host pipeline — the full frame plus per-element
|
|
55
|
+
/// change annotations and host-computed removes. Full-frame consumers can
|
|
56
|
+
/// serialize `elements` and ignore the annotations; per-element consumers walk
|
|
57
|
+
/// them.
|
|
58
|
+
struct SceneFrame: Sendable {
|
|
59
|
+
/// Public drawable canvas the host laid this frame out against (stock G2: 576×288).
|
|
60
|
+
static let defaultCanvasWidth: Int32 = 576
|
|
61
|
+
static let defaultCanvasHeight: Int32 = 288
|
|
62
|
+
|
|
63
|
+
let appId: String
|
|
64
|
+
let epoch: Int
|
|
65
|
+
let replay: Bool
|
|
66
|
+
let elements: [SceneElement]
|
|
67
|
+
let removed: [String]
|
|
68
|
+
let canvasWidth: Int32
|
|
69
|
+
let canvasHeight: Int32
|
|
70
|
+
|
|
71
|
+
init(
|
|
72
|
+
appId: String, epoch: Int, replay: Bool, elements: [SceneElement], removed: [String],
|
|
73
|
+
canvasWidth: Int32 = SceneFrame.defaultCanvasWidth,
|
|
74
|
+
canvasHeight: Int32 = SceneFrame.defaultCanvasHeight
|
|
75
|
+
) {
|
|
76
|
+
self.appId = appId
|
|
77
|
+
self.epoch = epoch
|
|
78
|
+
self.replay = replay
|
|
79
|
+
self.elements = elements
|
|
80
|
+
self.removed = removed
|
|
81
|
+
self.canvasWidth = canvasWidth > 0 ? canvasWidth : SceneFrame.defaultCanvasWidth
|
|
82
|
+
self.canvasHeight = canvasHeight > 0 ? canvasHeight : SceneFrame.defaultCanvasHeight
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
func asReplay() -> SceneFrame {
|
|
86
|
+
SceneFrame(
|
|
87
|
+
appId: appId, epoch: epoch, replay: true,
|
|
88
|
+
elements: elements.map { $0.with(change: "created") }, removed: removed,
|
|
89
|
+
canvasWidth: canvasWidth, canvasHeight: canvasHeight
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@MainActor
|
|
95
|
+
protocol SGCManager {
|
|
96
|
+
// MARK: - hard coded device properties:
|
|
97
|
+
|
|
98
|
+
var type: String { get set }
|
|
99
|
+
var hasMic: Bool { get }
|
|
100
|
+
|
|
101
|
+
// MARK: - Audio Control
|
|
102
|
+
|
|
103
|
+
func setMicEnabled(_ enabled: Bool)
|
|
104
|
+
var isMicSuspendedForAudio: Bool { get }
|
|
105
|
+
func sortMicRanking(list: [String]) -> [String]
|
|
106
|
+
|
|
107
|
+
// MARK: - Messaging
|
|
108
|
+
|
|
109
|
+
func sendJson(_ jsonOriginal: [String: Any], wakeUp: Bool, requireAck: Bool)
|
|
110
|
+
|
|
111
|
+
// MARK: - Camera & Media
|
|
112
|
+
|
|
113
|
+
func requestPhoto(_ request: PhotoRequest)
|
|
114
|
+
func startStream(_ message: [String: Any])
|
|
115
|
+
func stopStream()
|
|
116
|
+
func sendStreamKeepAlive(_ message: [String: Any])
|
|
117
|
+
func startVideoRecording(requestId: String, save: Bool, sound: Bool)
|
|
118
|
+
func queryVideoRecordingStatus(requestId: String)
|
|
119
|
+
/// Start video recording with optional per-recording resolution/fps. A width,
|
|
120
|
+
/// height, or fps of 0 means "use the device's saved button-video default".
|
|
121
|
+
/// Defaulted in an extension to delegate to the basic recording path; devices
|
|
122
|
+
/// that support custom settings (e.g. Mentra Live) override this.
|
|
123
|
+
func startVideoRecording(
|
|
124
|
+
requestId: String, save: Bool, sound: Bool, width: Int, height: Int, fps: Int,
|
|
125
|
+
maxRecordingTimeMinutes: Int
|
|
126
|
+
)
|
|
127
|
+
func stopVideoRecording(requestId: String)
|
|
128
|
+
/// Stop recording and upload the result to `webhookUrl` (multipart) using
|
|
129
|
+
/// `authToken`. Supplied at stop time so the token is fresh when the upload
|
|
130
|
+
/// runs. Defaulted in an extension to ignore the upload target and just stop;
|
|
131
|
+
/// devices that support webhook upload (e.g. Mentra Live) override this. An
|
|
132
|
+
/// empty/nil `webhookUrl` means "keep the video on device".
|
|
133
|
+
func stopVideoRecording(requestId: String, webhookUrl: String?, authToken: String?)
|
|
134
|
+
|
|
135
|
+
// MARK: - Button Settings
|
|
136
|
+
|
|
137
|
+
func sendButtonPhotoSettings()
|
|
138
|
+
func sendButtonVideoRecordingSettings()
|
|
139
|
+
func sendButtonMaxRecordingTime()
|
|
140
|
+
func sendCameraFovSetting()
|
|
141
|
+
|
|
142
|
+
// MARK: - Display Control
|
|
143
|
+
|
|
144
|
+
/// Suspend until the device's firmware identity is classified, so display
|
|
145
|
+
/// traffic sent right after connect routes down its final render path.
|
|
146
|
+
/// Default no-op (see protocol extension); only G2 has a stock-vs-CFW split.
|
|
147
|
+
func awaitFirmwareClassification() async
|
|
148
|
+
func setBrightness(_ level: Int, autoMode: Bool)
|
|
149
|
+
func clearDisplay()
|
|
150
|
+
func sendText(_ text: String) async
|
|
151
|
+
func sendTextWall(_ text: String) async
|
|
152
|
+
func sendDoubleTextWall(_ top: String, _ bottom: String) async
|
|
153
|
+
/// Display a bitmap. Optional `x`/`y`/`width`/`height` position and size the target
|
|
154
|
+
/// container (used by G2; other SGCs ignore positioning and render the bitmap as before).
|
|
155
|
+
func displayBitmap(base64ImageData: String, x: Int32?, y: Int32?, width: Int32?, height: Int32?) async -> Bool
|
|
156
|
+
/// Show text in a positioned container with an optional rounded border.
|
|
157
|
+
/// G2-only capability; default no-op (see protocol extension) so other glasses ignore it.
|
|
158
|
+
func sendPositionedText(
|
|
159
|
+
_ text: String, x: Int32, y: Int32, width: Int32, height: Int32,
|
|
160
|
+
borderWidth: Int32, borderRadius: Int32
|
|
161
|
+
) async
|
|
162
|
+
|
|
163
|
+
// MARK: - Scene display (display.render() pipeline)
|
|
164
|
+
|
|
165
|
+
/// Retained element verbs — identity is the element id. Defaults delegate
|
|
166
|
+
/// to the positioned/bitmap paths (see extension); SGCs with retained
|
|
167
|
+
/// components (G2 containers, Mentra Display canvas) override for
|
|
168
|
+
/// update-in-place / delete semantics.
|
|
169
|
+
func drawLayoutText(
|
|
170
|
+
_ text: String, x: Int32, y: Int32, width: Int32, height: Int32,
|
|
171
|
+
borderWidth: Int32, borderRadius: Int32, elementId: String, layoutId: String?
|
|
172
|
+
) async
|
|
173
|
+
func drawLayoutBitmap(
|
|
174
|
+
base64ImageData: String, x: Int32, y: Int32, width: Int32, height: Int32,
|
|
175
|
+
elementId: String, layoutId: String?
|
|
176
|
+
) async -> Bool
|
|
177
|
+
func removeLayoutElement(_ elementId: String, layoutId: String?) async
|
|
178
|
+
/// Apply a whole host-diffed scene frame (default: paint-then-sweep over the verbs above).
|
|
179
|
+
func applySceneFrame(_ frame: SceneFrame) async
|
|
180
|
+
/// A replay frame is about to repaint from scratch — reset retained bookkeeping.
|
|
181
|
+
func onSceneReplay(_ appId: String) async
|
|
182
|
+
/// Remove a set of scene elements (scene→legacy handoff sweep).
|
|
183
|
+
func clearSceneElements(_ elementIds: [String]) async
|
|
184
|
+
|
|
185
|
+
// MARK: - Native navigation (glasses-rendered turn-by-turn UI; G2 only today)
|
|
186
|
+
|
|
187
|
+
/// True while the glasses' own modal nav UI owns the display — DeviceManager
|
|
188
|
+
/// suppresses normal display traffic until exit.
|
|
189
|
+
var navigationModeActive: Bool { get }
|
|
190
|
+
func enterNavigationMode()
|
|
191
|
+
/// `arrived` shows the device's "navigation complete" screen before exiting.
|
|
192
|
+
func exitNavigationMode(arrived: Bool)
|
|
193
|
+
/// Turn-by-turn card update; all fields are pre-formatted display strings.
|
|
194
|
+
func sendNavigationInfo(
|
|
195
|
+
directionIcon: Int32, distance: String, roadName: String,
|
|
196
|
+
spendTime: String, remainDistance: String, etaTime: String, speed: String
|
|
197
|
+
)
|
|
198
|
+
/// Live mini map (base64 image, re-encoded by the SGC). Draw north-up with
|
|
199
|
+
/// a centred cursor; the device rotates it by rotationDeg.
|
|
200
|
+
func sendNavigationMiniMap(base64ImageData: String, rotationDeg: Int32, borderEnabled: Bool)
|
|
201
|
+
func sendNavigationOverviewMap(base64ImageData: String)
|
|
202
|
+
|
|
203
|
+
func showDashboard()
|
|
204
|
+
func setDashboardPosition(_ height: Int, _ depth: Int)
|
|
205
|
+
/// Default implementation sends both via [setDashboardPosition]; Nex overrides to one protobuf.
|
|
206
|
+
func setDashboardHeightOnly(_ height: Int)
|
|
207
|
+
func setDashboardDepthOnly(_ depth: Int)
|
|
208
|
+
/// Live cfw_scene_renderer switch (only the G2 CFW has one): swap the
|
|
209
|
+
/// on-glass surface between the CFW carrier and a blank stock page.
|
|
210
|
+
func cfwSceneRendererToggled(_ enabled: Bool) async
|
|
211
|
+
|
|
212
|
+
// MARK: - Dashboard Menu
|
|
213
|
+
|
|
214
|
+
func setDashboardMenu(_ items: [[String: Any]])
|
|
215
|
+
|
|
216
|
+
// MARK: - Notification Panel
|
|
217
|
+
|
|
218
|
+
func showNotificationsPanel() async
|
|
219
|
+
|
|
220
|
+
// MARK: - Calendar Events
|
|
221
|
+
|
|
222
|
+
func sendCalendarEvents(_ events: [[String: Any]])
|
|
223
|
+
|
|
224
|
+
// MARK: - Dashboard Display Settings
|
|
225
|
+
|
|
226
|
+
func sendDashboardDisplaySettings()
|
|
227
|
+
|
|
228
|
+
// MARK: - Device Control
|
|
229
|
+
|
|
230
|
+
func setHeadUpAngle(_ angle: Int)
|
|
231
|
+
/// Enable/disable raw accelerometer (IMU) reporting from the glasses.
|
|
232
|
+
/// Default no-op; only G2 streams IMU data today.
|
|
233
|
+
func setImuEnabled(_ enabled: Bool) async
|
|
234
|
+
func getBatteryStatus()
|
|
235
|
+
func setSilentMode(_ enabled: Bool)
|
|
236
|
+
func exit()
|
|
237
|
+
func sendShutdown()
|
|
238
|
+
func sendReboot()
|
|
239
|
+
func sendRgbLedControl(
|
|
240
|
+
requestId: String, packageName: String?, action: String, color: String?, onDurationMs: Int,
|
|
241
|
+
offDurationMs: Int, count: Int
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
// MARK: - Connection Management
|
|
245
|
+
|
|
246
|
+
func disconnect()
|
|
247
|
+
func forget()
|
|
248
|
+
func findCompatibleDevices()
|
|
249
|
+
func stopScan()
|
|
250
|
+
func connectById(_ id: String)
|
|
251
|
+
func getConnectedBluetoothName() -> String?
|
|
252
|
+
func connectController()
|
|
253
|
+
func disconnectController()
|
|
254
|
+
func cleanup()
|
|
255
|
+
func ping()
|
|
256
|
+
func dbg1()
|
|
257
|
+
func dbg2()
|
|
258
|
+
|
|
259
|
+
// MARK: - Network Management
|
|
260
|
+
|
|
261
|
+
func requestWifiScan(scanId: String?)
|
|
262
|
+
func sendWifiCredentials(_ ssid: String, _ password: String)
|
|
263
|
+
func forgetWifiNetwork(_ ssid: String)
|
|
264
|
+
func sendHotspotState(_ enabled: Bool)
|
|
265
|
+
func sendWifiAdbState(_ enabled: Bool)
|
|
266
|
+
func sendOtaStart(otaVersionUrl: String?)
|
|
267
|
+
func sendOtaQueryStatus()
|
|
268
|
+
func sendSetSystemTime(_ timestampMs: Int64)
|
|
269
|
+
|
|
270
|
+
// MARK: - User Context (for crash reporting)
|
|
271
|
+
|
|
272
|
+
func sendUserEmailToGlasses(_ email: String)
|
|
273
|
+
|
|
274
|
+
// MARK: - Incident Reporting
|
|
275
|
+
|
|
276
|
+
func sendIncidentId(_ incidentId: String, apiBaseUrl: String?)
|
|
277
|
+
|
|
278
|
+
// MARK: - Gallery
|
|
279
|
+
|
|
280
|
+
func queryGalleryStatus()
|
|
281
|
+
func sendGalleryMode()
|
|
282
|
+
|
|
283
|
+
// MARK: - Voice Activity Detection
|
|
284
|
+
|
|
285
|
+
func sendVoiceActivityDetectionSetting()
|
|
286
|
+
|
|
287
|
+
// MARK: - Loudness / Barrier Gate
|
|
288
|
+
|
|
289
|
+
func sendLoudnessGateSetting()
|
|
290
|
+
|
|
291
|
+
// MARK: - Version Info
|
|
292
|
+
|
|
293
|
+
func requestVersionInfo()
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/// doesn't seem to work for concurrency reasons :(
|
|
297
|
+
/// we can make read-only getters for convienence though:
|
|
298
|
+
extension SGCManager {
|
|
299
|
+
var isMicSuspendedForAudio: Bool {
|
|
300
|
+
false
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/// Default: no-op. Only G2 distinguishes stock from Glassly CFW firmware.
|
|
304
|
+
func awaitFirmwareClassification() async {}
|
|
305
|
+
|
|
306
|
+
/// Default: no-op. Only G2 renders positioned text containers; other glasses ignore it.
|
|
307
|
+
func sendPositionedText(
|
|
308
|
+
_: String, x _: Int32, y _: Int32, width _: Int32, height _: Int32,
|
|
309
|
+
borderWidth _: Int32, borderRadius _: Int32
|
|
310
|
+
) async {}
|
|
311
|
+
|
|
312
|
+
// MARK: - Scene display defaults
|
|
313
|
+
|
|
314
|
+
/// Default: ignore the ids and behave like the positioned-text path.
|
|
315
|
+
func drawLayoutText(
|
|
316
|
+
_ text: String, x: Int32, y: Int32, width: Int32, height: Int32,
|
|
317
|
+
borderWidth: Int32, borderRadius: Int32, elementId _: String, layoutId _: String?
|
|
318
|
+
) async {
|
|
319
|
+
await sendPositionedText(
|
|
320
|
+
text, x: x, y: y, width: width, height: height,
|
|
321
|
+
borderWidth: borderWidth, borderRadius: borderRadius
|
|
322
|
+
)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/// Default: ignore the ids and behave like displayBitmap.
|
|
326
|
+
func drawLayoutBitmap(
|
|
327
|
+
base64ImageData: String, x: Int32, y: Int32, width: Int32, height: Int32,
|
|
328
|
+
elementId _: String, layoutId _: String?
|
|
329
|
+
) async -> Bool {
|
|
330
|
+
await displayBitmap(base64ImageData: base64ImageData, x: x, y: y, width: width, height: height)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/// Default: no-op (SGC has no retained elements).
|
|
334
|
+
func removeLayoutElement(_: String, layoutId _: String?) async {}
|
|
335
|
+
|
|
336
|
+
/// Default: no retained bookkeeping to reset.
|
|
337
|
+
func onSceneReplay(_: String) async {}
|
|
338
|
+
|
|
339
|
+
/// Default sweep: remove each element individually.
|
|
340
|
+
func clearSceneElements(_ elementIds: [String]) async {
|
|
341
|
+
for id in elementIds {
|
|
342
|
+
await removeLayoutElement(id, layoutId: nil)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/// Apply a whole scene frame from the host pipeline (display.render()).
|
|
347
|
+
///
|
|
348
|
+
/// The host has already diffed the scene, so each element arrives annotated
|
|
349
|
+
/// and `removed` lists what disappeared. PAINT-THEN-SWEEP: creates/updates/
|
|
350
|
+
/// moves land first, removes go LAST — a scene transition never shows a
|
|
351
|
+
/// blank interval. "unchanged" elements are skipped entirely (this is also
|
|
352
|
+
/// what prevents image re-uploads over BLE). Replay frames arrive
|
|
353
|
+
/// all-"created" and reset retained bookkeeping first, because firmware
|
|
354
|
+
/// silently drops updates to dead component ids. Rects compile to empty
|
|
355
|
+
/// bordered text boxes (no shape primitive on current targets) and always
|
|
356
|
+
/// get a visible border.
|
|
357
|
+
func applySceneFrame(_ frame: SceneFrame) async {
|
|
358
|
+
if frame.replay {
|
|
359
|
+
await onSceneReplay(frame.appId)
|
|
360
|
+
}
|
|
361
|
+
// An id in `removed` that ALSO appears in `elements` is a type change
|
|
362
|
+
// (the differ keys matches by type:id). Its removal must run BEFORE the
|
|
363
|
+
// paint — registries key by id, so a post-paint sweep would delete the
|
|
364
|
+
// just-painted replacement.
|
|
365
|
+
let paintedIds = Set(frame.elements.map { $0.id })
|
|
366
|
+
for id in frame.removed where paintedIds.contains(id) {
|
|
367
|
+
await removeLayoutElement(id, layoutId: frame.appId)
|
|
368
|
+
}
|
|
369
|
+
for el in frame.elements {
|
|
370
|
+
if !frame.replay, el.change == "unchanged" {
|
|
371
|
+
continue
|
|
372
|
+
}
|
|
373
|
+
switch el.type {
|
|
374
|
+
case "text":
|
|
375
|
+
await drawLayoutText(
|
|
376
|
+
el.text ?? "", x: el.x, y: el.y, width: el.w, height: el.h,
|
|
377
|
+
borderWidth: el.border, borderRadius: el.radius,
|
|
378
|
+
elementId: el.id, layoutId: frame.appId
|
|
379
|
+
)
|
|
380
|
+
case "rect":
|
|
381
|
+
await drawLayoutText(
|
|
382
|
+
"", x: el.x, y: el.y, width: el.w, height: el.h,
|
|
383
|
+
borderWidth: max(1, el.border), borderRadius: el.radius,
|
|
384
|
+
elementId: el.id, layoutId: frame.appId
|
|
385
|
+
)
|
|
386
|
+
case "image":
|
|
387
|
+
if let data = el.data {
|
|
388
|
+
_ = await drawLayoutBitmap(
|
|
389
|
+
base64ImageData: data, x: el.x, y: el.y, width: el.w, height: el.h,
|
|
390
|
+
elementId: el.id, layoutId: frame.appId
|
|
391
|
+
)
|
|
392
|
+
}
|
|
393
|
+
default:
|
|
394
|
+
Bridge.log("SGC: applySceneFrame: unknown element type \(el.type)")
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
for id in frame.removed where !paintedIds.contains(id) {
|
|
398
|
+
await removeLayoutElement(id, layoutId: frame.appId)
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// MARK: - Video recording (default: ignore custom settings, use saved defaults)
|
|
403
|
+
|
|
404
|
+
func startVideoRecording(
|
|
405
|
+
requestId: String, save: Bool, sound: Bool, width _: Int, height _: Int,
|
|
406
|
+
fps _: Int, maxRecordingTimeMinutes _: Int
|
|
407
|
+
) {
|
|
408
|
+
startVideoRecording(requestId: requestId, save: save, sound: sound)
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
func queryVideoRecordingStatus(requestId _: String) {
|
|
412
|
+
Bridge.log("SGC: queryVideoRecordingStatus operation not supported")
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
func stopVideoRecording(requestId: String, webhookUrl _: String?, authToken _: String?) {
|
|
416
|
+
stopVideoRecording(requestId: requestId)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// MARK: - Dashboard (default: combined wire format; Nex implements single-field)
|
|
420
|
+
|
|
421
|
+
func setDashboardHeightOnly(_ height: Int) {
|
|
422
|
+
let d = DeviceStore.shared.get("bluetooth", "dashboard_depth") as? Int ?? 2
|
|
423
|
+
setDashboardPosition(height, d)
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
func setDashboardDepthOnly(_ depth: Int) {
|
|
427
|
+
let h = DeviceStore.shared.get("bluetooth", "dashboard_height") as? Int ?? 4
|
|
428
|
+
setDashboardPosition(h, depth)
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
func cfwSceneRendererToggled(_: Bool) async {}
|
|
432
|
+
|
|
433
|
+
// MARK: - Native navigation defaults (only G2 has a glasses-side nav UI)
|
|
434
|
+
|
|
435
|
+
var navigationModeActive: Bool {
|
|
436
|
+
false
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
func enterNavigationMode() {
|
|
440
|
+
Bridge.log("SGC: enterNavigationMode not supported")
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
func exitNavigationMode(arrived _: Bool) {}
|
|
444
|
+
|
|
445
|
+
func sendNavigationInfo(
|
|
446
|
+
directionIcon _: Int32, distance _: String, roadName _: String,
|
|
447
|
+
spendTime _: String, remainDistance _: String, etaTime _: String, speed _: String
|
|
448
|
+
) {}
|
|
449
|
+
|
|
450
|
+
func sendNavigationMiniMap(base64ImageData _: String, rotationDeg _: Int32, borderEnabled _: Bool) {}
|
|
451
|
+
|
|
452
|
+
func sendNavigationOverviewMap(base64ImageData _: String) {}
|
|
453
|
+
|
|
454
|
+
// MARK: - Dashboard Menu (default no-op — only G2 supports this)
|
|
455
|
+
|
|
456
|
+
func setDashboardMenu(_: [[String: Any]]) {}
|
|
457
|
+
|
|
458
|
+
// MARK: - Notification Panel (default no-op — only G2 supports this)
|
|
459
|
+
|
|
460
|
+
func showNotificationsPanel() async {}
|
|
461
|
+
|
|
462
|
+
// MARK: - IMU (default no-op — only G2 streams accelerometer data)
|
|
463
|
+
|
|
464
|
+
func setImuEnabled(_: Bool) async {
|
|
465
|
+
Bridge.log("SGC: setImuEnabled not supported")
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// MARK: - Calendar Events (default no-op — only G2 supports this)
|
|
469
|
+
|
|
470
|
+
func sendCalendarEvents(_: [[String: Any]]) {}
|
|
471
|
+
|
|
472
|
+
// MARK: - Dashboard Display Settings (default no-op — only G2 supports this)
|
|
473
|
+
|
|
474
|
+
func sendDashboardDisplaySettings() {}
|
|
475
|
+
|
|
476
|
+
// MARK: - Voice Activity Detection (default no-op — Mentra Live supports this)
|
|
477
|
+
|
|
478
|
+
func sendVoiceActivityDetectionSetting() {}
|
|
479
|
+
|
|
480
|
+
// MARK: - Loudness / Barrier Gate (default no-op — Mentra Live supports this)
|
|
481
|
+
|
|
482
|
+
func sendLoudnessGateSetting() {}
|
|
483
|
+
|
|
484
|
+
/// Default no-op; Mentra Live and G2 override to handle phone-detected clock skew.
|
|
485
|
+
func sendSetSystemTime(_: Int64) {
|
|
486
|
+
Bridge.log("SGC: sendSetSystemTime not supported")
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/// Default no-op; Mentra Live overrides to enable/disable Wi-Fi ADB.
|
|
490
|
+
func sendWifiAdbState(_: Bool) {
|
|
491
|
+
Bridge.log("SGC: sendWifiAdbState not supported")
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// MARK: - Default DeviceStore-backed property implementations
|
|
495
|
+
|
|
496
|
+
var fullyBooted: Bool {
|
|
497
|
+
DeviceStore.shared.get("glasses", "fullyBooted") as? Bool ?? false
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
var connected: Bool {
|
|
501
|
+
DeviceStore.shared.get("glasses", "connected") as? Bool ?? false
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
var appVersion: String {
|
|
505
|
+
DeviceStore.shared.get("glasses", "appVersion") as? String ?? ""
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
var buildNumber: String {
|
|
509
|
+
DeviceStore.shared.get("glasses", "buildNumber") as? String ?? ""
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
var deviceModel: String {
|
|
513
|
+
DeviceStore.shared.get("glasses", "deviceModel") as? String ?? ""
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
var androidVersion: String {
|
|
517
|
+
DeviceStore.shared.get("glasses", "androidVersion") as? String ?? ""
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
var otaVersionUrl: String {
|
|
521
|
+
DeviceStore.shared.get("glasses", "otaVersionUrl") as? String ?? ""
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
var firmwareVersion: String {
|
|
525
|
+
DeviceStore.shared.get("glasses", "firmwareVersion") as? String ?? ""
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
var bluetoothMacAddress: String {
|
|
529
|
+
DeviceStore.shared.get("glasses", "bluetoothMacAddress") as? String ?? ""
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
var serialNumber: String {
|
|
533
|
+
DeviceStore.shared.get("glasses", "serialNumber") as? String ?? ""
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
var style: String {
|
|
537
|
+
DeviceStore.shared.get("glasses", "style") as? String ?? ""
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
var color: String {
|
|
541
|
+
DeviceStore.shared.get("glasses", "color") as? String ?? ""
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
var micEnabled: Bool {
|
|
545
|
+
DeviceStore.shared.get("glasses", "micEnabled") as? Bool ?? false
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
var voiceActivityDetectionEnabled: Bool {
|
|
549
|
+
DeviceStore.shared.get("glasses", "voiceActivityDetectionEnabled") as? Bool
|
|
550
|
+
?? BluetoothSdkDefaults.voiceActivityDetectionEnabled
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
var batteryLevel: Int {
|
|
554
|
+
DeviceStore.shared.get("glasses", "batteryLevel") as? Int ?? -1
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
var headUp: Bool {
|
|
558
|
+
DeviceStore.shared.get("glasses", "headUp") as? Bool ?? false
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
var charging: Bool {
|
|
562
|
+
DeviceStore.shared.get("glasses", "charging") as? Bool ?? false
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
var caseOpen: Bool {
|
|
566
|
+
DeviceStore.shared.get("glasses", "caseOpen") as? Bool ?? true
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
var caseRemoved: Bool {
|
|
570
|
+
DeviceStore.shared.get("glasses", "caseRemoved") as? Bool ?? true
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
var caseCharging: Bool {
|
|
574
|
+
DeviceStore.shared.get("glasses", "caseCharging") as? Bool ?? false
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
var caseBatteryLevel: Int {
|
|
578
|
+
DeviceStore.shared.get("glasses", "caseBatteryLevel") as? Int ?? -1
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
var wifiSsid: String {
|
|
582
|
+
DeviceStore.shared.get("glasses", "wifiSsid") as? String ?? ""
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
var wifiConnected: Bool {
|
|
586
|
+
DeviceStore.shared.get("glasses", "wifiConnected") as? Bool ?? false
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
var wifiLocalIp: String {
|
|
590
|
+
DeviceStore.shared.get("glasses", "wifiLocalIp") as? String ?? ""
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
var hotspotEnabled: Bool {
|
|
594
|
+
DeviceStore.shared.get("glasses", "hotspotEnabled") as? Bool ?? false
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
var hotspotSsid: String {
|
|
598
|
+
DeviceStore.shared.get("glasses", "hotspotSsid") as? String ?? ""
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
var hotspotPassword: String {
|
|
602
|
+
DeviceStore.shared.get("glasses", "hotspotPassword") as? String ?? ""
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
var hotspotGatewayIp: String {
|
|
606
|
+
DeviceStore.shared.get("glasses", "hotspotGatewayIp") as? String ?? ""
|
|
607
|
+
}
|
|
608
|
+
}
|