@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,470 @@
|
|
|
1
|
+
package com.glassly.bluetoothsdk.sgcs
|
|
2
|
+
|
|
3
|
+
import com.glassly.bluetoothsdk.BluetoothSdkDefaults
|
|
4
|
+
import com.glassly.bluetoothsdk.Bridge
|
|
5
|
+
import com.glassly.bluetoothsdk.DeviceStore
|
|
6
|
+
import com.glassly.bluetoothsdk.PhotoRequest
|
|
7
|
+
import com.glassly.bluetoothsdk.utils.ConnTypes
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* One element of a scene frame (display.render()). Geometry is raw pixels on
|
|
11
|
+
* the device's drawable canvas; `change` is the host differ's annotation
|
|
12
|
+
* against the previous frame sent to this device.
|
|
13
|
+
*/
|
|
14
|
+
data class SceneElement(
|
|
15
|
+
val id: String,
|
|
16
|
+
val type: String, // "text" | "rect" | "image"
|
|
17
|
+
val x: Int,
|
|
18
|
+
val y: Int,
|
|
19
|
+
val w: Int,
|
|
20
|
+
val h: Int,
|
|
21
|
+
val text: String?,
|
|
22
|
+
val data: String?, // base64 image pixels (SGC decodes → re-encodes to wire format)
|
|
23
|
+
val border: Int,
|
|
24
|
+
val radius: Int,
|
|
25
|
+
val change: String, // "created" | "updated" | "moved" | "unchanged"
|
|
26
|
+
val contentHash: String,
|
|
27
|
+
/** "mono" is fixed-pitch at [fontSize] px; other values use the default face. */
|
|
28
|
+
val font: String = "default",
|
|
29
|
+
val fontSize: Int = 0,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A whole scene from the host pipeline — the full frame plus per-element change
|
|
34
|
+
* annotations and host-computed removes. Full-frame consumers can serialize
|
|
35
|
+
* `elements` and ignore the annotations; per-element consumers walk them.
|
|
36
|
+
*/
|
|
37
|
+
data class SceneFrame(
|
|
38
|
+
val appId: String,
|
|
39
|
+
val epoch: Int,
|
|
40
|
+
val replay: Boolean,
|
|
41
|
+
val elements: List<SceneElement>,
|
|
42
|
+
val removed: List<String>,
|
|
43
|
+
val canvasWidth: Int = DEFAULT_CANVAS_WIDTH,
|
|
44
|
+
val canvasHeight: Int = DEFAULT_CANVAS_HEIGHT,
|
|
45
|
+
) {
|
|
46
|
+
companion object {
|
|
47
|
+
const val DEFAULT_CANVAS_WIDTH = 576
|
|
48
|
+
const val DEFAULT_CANVAS_HEIGHT = 288
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
abstract class SGCManager {
|
|
53
|
+
// Hard coded device properties:
|
|
54
|
+
@JvmField var type: String = ""
|
|
55
|
+
@JvmField var hasMic: Boolean = false
|
|
56
|
+
|
|
57
|
+
// Audio Control
|
|
58
|
+
abstract fun setMicEnabled(enabled: Boolean)
|
|
59
|
+
open val isMicSuspendedForAudio: Boolean
|
|
60
|
+
get() = false
|
|
61
|
+
abstract fun sortMicRanking(list: MutableList<String>): MutableList<String>
|
|
62
|
+
|
|
63
|
+
// Camera & Media
|
|
64
|
+
abstract fun requestPhoto(request: PhotoRequest)
|
|
65
|
+
abstract fun startStream(message: MutableMap<String, Any>)
|
|
66
|
+
abstract fun stopStream()
|
|
67
|
+
abstract fun sendStreamKeepAlive(message: MutableMap<String, Any>)
|
|
68
|
+
abstract fun startVideoRecording(requestId: String, save: Boolean, sound: Boolean)
|
|
69
|
+
open fun queryVideoRecordingStatus(requestId: String) {
|
|
70
|
+
Bridge.log("SGC: queryVideoRecordingStatus operation not supported")
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Start video recording with optional per-recording resolution/fps. A width,
|
|
75
|
+
* height, or fps of 0 means "use the device's saved button-video default".
|
|
76
|
+
* The base implementation ignores the settings and delegates to the default
|
|
77
|
+
* recording path; devices that support custom settings (e.g. Mentra Live)
|
|
78
|
+
* override this.
|
|
79
|
+
*/
|
|
80
|
+
open fun startVideoRecording(
|
|
81
|
+
requestId: String,
|
|
82
|
+
save: Boolean,
|
|
83
|
+
sound: Boolean,
|
|
84
|
+
width: Int,
|
|
85
|
+
height: Int,
|
|
86
|
+
fps: Int,
|
|
87
|
+
maxRecordingTimeMinutes: Int,
|
|
88
|
+
) {
|
|
89
|
+
startVideoRecording(requestId, save, sound)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
abstract fun stopVideoRecording(requestId: String)
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Stop recording and upload the result to [webhookUrl] (multipart) using
|
|
96
|
+
* [authToken]. These are supplied at stop time so the token is fresh when
|
|
97
|
+
* the upload runs. The base implementation ignores the upload target and
|
|
98
|
+
* just stops; devices that support webhook upload (e.g. Mentra Live)
|
|
99
|
+
* override this. An empty/null [webhookUrl] means "keep the video on device".
|
|
100
|
+
*/
|
|
101
|
+
open fun stopVideoRecording(requestId: String, webhookUrl: String?, authToken: String?) {
|
|
102
|
+
stopVideoRecording(requestId)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Button Settings
|
|
106
|
+
abstract fun sendButtonPhotoSettings()
|
|
107
|
+
abstract fun sendButtonVideoRecordingSettings()
|
|
108
|
+
abstract fun sendButtonMaxRecordingTime()
|
|
109
|
+
abstract fun sendCameraFovSetting()
|
|
110
|
+
|
|
111
|
+
// Display Control
|
|
112
|
+
/**
|
|
113
|
+
* Block (bounded) until the device's firmware identity is classified, so
|
|
114
|
+
* display traffic sent right after connect routes down its final render
|
|
115
|
+
* path. Default no-op; only G2 has a stock-vs-CFW split. Call off the main
|
|
116
|
+
* thread.
|
|
117
|
+
*/
|
|
118
|
+
open fun awaitFirmwareClassification() {}
|
|
119
|
+
abstract fun setBrightness(level: Int, autoMode: Boolean)
|
|
120
|
+
abstract fun clearDisplay()
|
|
121
|
+
abstract fun sendText(text: String)
|
|
122
|
+
abstract fun sendTextWall(text: String)
|
|
123
|
+
abstract fun sendDoubleTextWall(top: String, bottom: String)
|
|
124
|
+
/**
|
|
125
|
+
* Display a bitmap. Optional [x]/[y]/[width]/[height] position and size the target
|
|
126
|
+
* container (used by G2; other SGCs ignore positioning and render the bitmap as before).
|
|
127
|
+
*/
|
|
128
|
+
abstract fun displayBitmap(
|
|
129
|
+
base64ImageData: String,
|
|
130
|
+
x: Int? = null,
|
|
131
|
+
y: Int? = null,
|
|
132
|
+
width: Int? = null,
|
|
133
|
+
height: Int? = null
|
|
134
|
+
): Boolean
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Show text in a positioned container with an optional rounded border.
|
|
138
|
+
* G2-only capability; default no-op so other glasses ignore it.
|
|
139
|
+
*/
|
|
140
|
+
open fun sendPositionedText(
|
|
141
|
+
text: String,
|
|
142
|
+
x: Int,
|
|
143
|
+
y: Int,
|
|
144
|
+
width: Int,
|
|
145
|
+
height: Int,
|
|
146
|
+
borderWidth: Int = 0,
|
|
147
|
+
borderRadius: Int = 0
|
|
148
|
+
) {}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Retained-mode layout element (bitmap). Like [displayBitmap] but tagged with a stable
|
|
152
|
+
* [elementId] within a [layoutId] scene, so an SGC that supports it (Nex) can diff:
|
|
153
|
+
* same id -> update in place, new id -> create, new layoutId -> clear the previous scene.
|
|
154
|
+
* Default: ignore the ids and behave exactly like [displayBitmap].
|
|
155
|
+
*/
|
|
156
|
+
open fun drawLayoutBitmap(
|
|
157
|
+
base64ImageData: String,
|
|
158
|
+
x: Int,
|
|
159
|
+
y: Int,
|
|
160
|
+
width: Int,
|
|
161
|
+
height: Int,
|
|
162
|
+
elementId: String,
|
|
163
|
+
layoutId: String?
|
|
164
|
+
): Boolean = displayBitmap(base64ImageData, x, y, width, height)
|
|
165
|
+
|
|
166
|
+
/** Retained-mode layout element (text). Default: behave like [sendPositionedText]. */
|
|
167
|
+
open fun drawLayoutText(
|
|
168
|
+
text: String,
|
|
169
|
+
x: Int,
|
|
170
|
+
y: Int,
|
|
171
|
+
width: Int,
|
|
172
|
+
height: Int,
|
|
173
|
+
borderWidth: Int,
|
|
174
|
+
borderRadius: Int,
|
|
175
|
+
elementId: String,
|
|
176
|
+
layoutId: String?
|
|
177
|
+
) = sendPositionedText(text, x, y, width, height, borderWidth, borderRadius)
|
|
178
|
+
|
|
179
|
+
/** Remove a retained layout element by id. Default: no-op (SGC doesn't support layouts). */
|
|
180
|
+
open fun removeLayoutElement(elementId: String, layoutId: String?) {}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Apply a whole scene frame from the host pipeline (display.render()).
|
|
184
|
+
*
|
|
185
|
+
* The host has already diffed the scene against what it last sent, so each
|
|
186
|
+
* element arrives annotated (created/updated/moved/unchanged) and `removed`
|
|
187
|
+
* lists what disappeared. This default implementation is fully generic:
|
|
188
|
+
*
|
|
189
|
+
* - PAINT-THEN-SWEEP: creates/updates/moves first (new content lands over
|
|
190
|
+
* or beside old), removes LAST — so a scene transition never shows a
|
|
191
|
+
* blank interval.
|
|
192
|
+
* - "unchanged" elements are skipped entirely (the host diff is the truth;
|
|
193
|
+
* this is also what prevents image re-uploads over BLE).
|
|
194
|
+
* - `replay` frames arrive all-"created" after a reconnect/recovery —
|
|
195
|
+
* [onSceneReplay] lets an SGC reset its component registry first so
|
|
196
|
+
* creates take the create path (updates to dead firmware ids are dropped
|
|
197
|
+
* silently by hardware).
|
|
198
|
+
* - rects compile to empty bordered text boxes (no shape primitive on
|
|
199
|
+
* current targets); a rect always gets a visible border.
|
|
200
|
+
*
|
|
201
|
+
* SGCs with per-element verbs (G2, Mentra Display) just implement
|
|
202
|
+
* [drawLayoutText]/[drawLayoutBitmap]/[removeLayoutElement]. A full-frame
|
|
203
|
+
* device (e.g. NIMO-style) overrides this whole method instead and
|
|
204
|
+
* serializes [SceneFrame.elements], ignoring the annotations.
|
|
205
|
+
*/
|
|
206
|
+
open fun applySceneFrame(frame: SceneFrame) {
|
|
207
|
+
if (frame.replay) {
|
|
208
|
+
onSceneReplay(frame.appId)
|
|
209
|
+
}
|
|
210
|
+
// An id in `removed` that ALSO appears in `elements` is a type change
|
|
211
|
+
// (the differ keys matches by type:id). Its removal must run BEFORE the
|
|
212
|
+
// paint — registries key by id, so a post-paint sweep would delete the
|
|
213
|
+
// just-painted replacement.
|
|
214
|
+
val paintedIds = frame.elements.mapTo(HashSet()) { it.id }
|
|
215
|
+
for (id in frame.removed) {
|
|
216
|
+
if (id in paintedIds) removeLayoutElement(id, frame.appId)
|
|
217
|
+
}
|
|
218
|
+
for (el in frame.elements) {
|
|
219
|
+
if (!frame.replay && el.change == "unchanged") continue
|
|
220
|
+
when (el.type) {
|
|
221
|
+
"text" ->
|
|
222
|
+
drawLayoutText(el.text ?: "", el.x, el.y, el.w, el.h, el.border, el.radius, el.id, frame.appId)
|
|
223
|
+
"rect" ->
|
|
224
|
+
drawLayoutText("", el.x, el.y, el.w, el.h, maxOf(1, el.border), el.radius, el.id, frame.appId)
|
|
225
|
+
"image" ->
|
|
226
|
+
el.data?.let { drawLayoutBitmap(it, el.x, el.y, el.w, el.h, el.id, frame.appId) }
|
|
227
|
+
else -> Bridge.log("SGC: applySceneFrame: unknown element type ${el.type}")
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
for (id in frame.removed) {
|
|
231
|
+
if (id !in paintedIds) removeLayoutElement(id, frame.appId)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* A replay frame is about to repaint from scratch — forget any retained
|
|
237
|
+
* component bookkeeping for [appId] so "created" elements take the create
|
|
238
|
+
* path. Default: no-op.
|
|
239
|
+
*/
|
|
240
|
+
open fun onSceneReplay(appId: String) {}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Remove a set of scene elements (scene→legacy handoff: a legacy layout is
|
|
244
|
+
* about to draw and the previous scene's elements must not linger under it).
|
|
245
|
+
*/
|
|
246
|
+
open fun clearSceneElements(elementIds: List<String>) {
|
|
247
|
+
for (id in elementIds) removeLayoutElement(id, null)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
abstract fun showDashboard()
|
|
251
|
+
abstract fun setDashboardPosition(height: Int, depth: Int)
|
|
252
|
+
|
|
253
|
+
/** Default: full [setDashboardPosition] (e.g. G1 single command). Nex overrides to height protobuf only. */
|
|
254
|
+
open fun setDashboardHeightOnly(height: Int) {
|
|
255
|
+
val depth = (DeviceStore.store.get("bluetooth", "dashboard_depth") as? Number)?.toInt() ?: 2
|
|
256
|
+
setDashboardPosition(height, depth)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Default: full [setDashboardPosition]. Nex overrides to display_distance only. */
|
|
260
|
+
open fun setDashboardDepthOnly(depth: Int) {
|
|
261
|
+
val height = (DeviceStore.store.get("bluetooth", "dashboard_height") as? Number)?.toInt() ?: 4
|
|
262
|
+
setDashboardPosition(height, depth)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Live cfw_scene_renderer switch (only the G2 CFW has one): swap the
|
|
267
|
+
* on-glass surface between the CFW carrier and a blank stock page.
|
|
268
|
+
*/
|
|
269
|
+
open suspend fun cfwSceneRendererToggled(enabled: Boolean) {}
|
|
270
|
+
|
|
271
|
+
// Dashboard Menu (default no-op — only G2 supports this)
|
|
272
|
+
open fun setDashboardMenu(items: List<Map<String, Any>>) {}
|
|
273
|
+
|
|
274
|
+
// Calendar Events (default no-op — only G2 supports this)
|
|
275
|
+
open fun sendCalendarEvents(events: List<Map<String, Any>>) {}
|
|
276
|
+
|
|
277
|
+
// Dashboard display settings (default no-op — only G2 supports this)
|
|
278
|
+
open fun sendDashboardDisplaySettings() {}
|
|
279
|
+
|
|
280
|
+
// Notification Panel (default no-op — only G2 supports this)
|
|
281
|
+
open suspend fun showNotificationsPanel() {}
|
|
282
|
+
|
|
283
|
+
// Controller bridging (default no-op — only G2 supports pairing with a ring controller)
|
|
284
|
+
open fun connectController() {}
|
|
285
|
+
open fun disconnectController() {}
|
|
286
|
+
|
|
287
|
+
// Native navigation mode (glasses-rendered nav UI — G2 service 0x08 today).
|
|
288
|
+
// Default no-ops so devices without a firmware nav UI accept the calls; the JS layer
|
|
289
|
+
// feature-detects via capabilities + the exported module functions.
|
|
290
|
+
open fun enterNavigationMode() {}
|
|
291
|
+
open fun exitNavigationMode(arrived: Boolean) {}
|
|
292
|
+
open fun sendNavigationInfo(
|
|
293
|
+
directionIcon: Int,
|
|
294
|
+
distance: String,
|
|
295
|
+
roadName: String,
|
|
296
|
+
spendTime: String,
|
|
297
|
+
remainDistance: String,
|
|
298
|
+
etaTime: String,
|
|
299
|
+
speed: String
|
|
300
|
+
) {}
|
|
301
|
+
open fun sendNavigationMiniMap(base64ImageData: String, rotationDeg: Int, borderEnabled: Boolean) {}
|
|
302
|
+
open fun sendNavigationOverviewMap(base64ImageData: String) {}
|
|
303
|
+
|
|
304
|
+
// Device Control
|
|
305
|
+
abstract fun setHeadUpAngle(angle: Int)
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Enable/disable raw accelerometer (IMU) reporting from the glasses.
|
|
309
|
+
* Default no-op for devices without IMU support. G2 (both iOS and Android) overrides this to
|
|
310
|
+
* stream IMU data; other devices accept the call so the cross-platform JS API stays uniform.
|
|
311
|
+
*/
|
|
312
|
+
open suspend fun setImuEnabled(enabled: Boolean) {
|
|
313
|
+
Bridge.log("SGC: setImuEnabled not supported")
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
abstract fun getBatteryStatus()
|
|
317
|
+
abstract fun setSilentMode(enabled: Boolean)
|
|
318
|
+
abstract fun exit()
|
|
319
|
+
abstract fun sendShutdown()
|
|
320
|
+
abstract fun sendReboot()
|
|
321
|
+
abstract fun sendRgbLedControl(
|
|
322
|
+
requestId: String,
|
|
323
|
+
packageName: String?,
|
|
324
|
+
action: String,
|
|
325
|
+
color: String?,
|
|
326
|
+
onDurationMs: Int,
|
|
327
|
+
offDurationMs: Int,
|
|
328
|
+
count: Int
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
// Connection Management
|
|
332
|
+
abstract fun disconnect()
|
|
333
|
+
abstract fun forget()
|
|
334
|
+
abstract fun findCompatibleDevices()
|
|
335
|
+
abstract fun stopScan()
|
|
336
|
+
abstract fun connectById(id: String)
|
|
337
|
+
abstract fun getConnectedBluetoothName(): String
|
|
338
|
+
abstract fun cleanup()
|
|
339
|
+
abstract fun ping()
|
|
340
|
+
abstract fun dbg1()
|
|
341
|
+
abstract fun dbg2()
|
|
342
|
+
|
|
343
|
+
// Network Management
|
|
344
|
+
abstract fun requestWifiScan(scanId: String?)
|
|
345
|
+
abstract fun sendWifiCredentials(ssid: String, password: String)
|
|
346
|
+
abstract fun forgetWifiNetwork(ssid: String)
|
|
347
|
+
abstract fun sendHotspotState(enabled: Boolean)
|
|
348
|
+
|
|
349
|
+
/** Set glasses system clock (Mentra Live and G2; no-op on other devices). */
|
|
350
|
+
open fun sendSetSystemTime(timestampMs: Long) {
|
|
351
|
+
Bridge.log("SGC: sendSetSystemTime not supported on $type")
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Enable/disable Wi-Fi ADB on Mentra Live (no-op on other devices). */
|
|
355
|
+
open fun sendWifiAdbState(enabled: Boolean) {
|
|
356
|
+
Bridge.log("SGC: sendWifiAdbState not supported on $type")
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// User Context (for crash reporting)
|
|
360
|
+
abstract fun sendUserEmailToGlasses(email: String)
|
|
361
|
+
|
|
362
|
+
// Incident Reporting
|
|
363
|
+
abstract fun sendIncidentId(incidentId: String, apiBaseUrl: String? = null)
|
|
364
|
+
|
|
365
|
+
// Gallery
|
|
366
|
+
abstract fun queryGalleryStatus()
|
|
367
|
+
abstract fun sendGalleryMode()
|
|
368
|
+
|
|
369
|
+
// Voice Activity Detection
|
|
370
|
+
open fun sendVoiceActivityDetectionSetting() {}
|
|
371
|
+
|
|
372
|
+
// Mentra Live center-mic loudness / Barrier gate
|
|
373
|
+
open fun sendLoudnessGateSetting() {}
|
|
374
|
+
|
|
375
|
+
// Start/stop LC3 audio playback from glasses based on the nex_lc3_audio_playback flag.
|
|
376
|
+
open fun applyNexAudioPlaybackSetting() {}
|
|
377
|
+
|
|
378
|
+
// Version info
|
|
379
|
+
abstract fun requestVersionInfo()
|
|
380
|
+
|
|
381
|
+
// DeviceStore-backed read-only getters for convenience
|
|
382
|
+
val fullyBooted: Boolean
|
|
383
|
+
get() = DeviceStore.get("glasses", "fullyBooted") as? Boolean ?: false
|
|
384
|
+
|
|
385
|
+
val connected: Boolean
|
|
386
|
+
get() = DeviceStore.get("glasses", "connected") as? Boolean ?: false
|
|
387
|
+
|
|
388
|
+
val connectionState: String
|
|
389
|
+
get() = DeviceStore.get("glasses", "connectionState") as? String ?: ConnTypes.DISCONNECTED
|
|
390
|
+
|
|
391
|
+
val appVersion: String
|
|
392
|
+
get() = DeviceStore.get("glasses", "appVersion") as? String ?: ""
|
|
393
|
+
|
|
394
|
+
val buildNumber: String
|
|
395
|
+
get() = DeviceStore.get("glasses", "buildNumber") as? String ?: ""
|
|
396
|
+
|
|
397
|
+
val deviceModel: String
|
|
398
|
+
get() = DeviceStore.get("glasses", "deviceModel") as? String ?: ""
|
|
399
|
+
|
|
400
|
+
val androidVersion: String
|
|
401
|
+
get() = DeviceStore.get("glasses", "androidVersion") as? String ?: ""
|
|
402
|
+
|
|
403
|
+
val otaVersionUrl: String
|
|
404
|
+
get() = DeviceStore.get("glasses", "otaVersionUrl") as? String ?: ""
|
|
405
|
+
|
|
406
|
+
val firmwareVersion: String
|
|
407
|
+
get() = DeviceStore.get("glasses", "firmwareVersion") as? String ?: ""
|
|
408
|
+
|
|
409
|
+
val bluetoothMacAddress: String
|
|
410
|
+
get() = DeviceStore.get("glasses", "bluetoothMacAddress") as? String ?: ""
|
|
411
|
+
|
|
412
|
+
val serialNumber: String
|
|
413
|
+
get() = DeviceStore.get("glasses", "serialNumber") as? String ?: ""
|
|
414
|
+
|
|
415
|
+
val style: String
|
|
416
|
+
get() = DeviceStore.get("glasses", "style") as? String ?: ""
|
|
417
|
+
|
|
418
|
+
val color: String
|
|
419
|
+
get() = DeviceStore.get("glasses", "color") as? String ?: ""
|
|
420
|
+
|
|
421
|
+
val micEnabled: Boolean
|
|
422
|
+
get() = DeviceStore.get("glasses", "micEnabled") as? Boolean ?: false
|
|
423
|
+
|
|
424
|
+
val voiceActivityDetectionEnabled: Boolean
|
|
425
|
+
get() =
|
|
426
|
+
DeviceStore.get("glasses", "voiceActivityDetectionEnabled") as? Boolean
|
|
427
|
+
?: BluetoothSdkDefaults.VOICE_ACTIVITY_DETECTION_ENABLED
|
|
428
|
+
|
|
429
|
+
val batteryLevel: Int
|
|
430
|
+
get() = DeviceStore.get("glasses", "batteryLevel") as? Int ?: -1
|
|
431
|
+
|
|
432
|
+
val headUp: Boolean
|
|
433
|
+
get() = DeviceStore.get("glasses", "headUp") as? Boolean ?: false
|
|
434
|
+
|
|
435
|
+
val charging: Boolean
|
|
436
|
+
get() = DeviceStore.get("glasses", "charging") as? Boolean ?: false
|
|
437
|
+
|
|
438
|
+
val caseOpen: Boolean
|
|
439
|
+
get() = DeviceStore.get("glasses", "caseOpen") as? Boolean ?: true
|
|
440
|
+
|
|
441
|
+
val caseRemoved: Boolean
|
|
442
|
+
get() = DeviceStore.get("glasses", "caseRemoved") as? Boolean ?: true
|
|
443
|
+
|
|
444
|
+
val caseCharging: Boolean
|
|
445
|
+
get() = DeviceStore.get("glasses", "caseCharging") as? Boolean ?: false
|
|
446
|
+
|
|
447
|
+
val caseBatteryLevel: Int
|
|
448
|
+
get() = DeviceStore.get("glasses", "caseBatteryLevel") as? Int ?: -1
|
|
449
|
+
|
|
450
|
+
val wifiSsid: String
|
|
451
|
+
get() = DeviceStore.get("glasses", "wifiSsid") as? String ?: ""
|
|
452
|
+
|
|
453
|
+
val wifiConnected: Boolean
|
|
454
|
+
get() = DeviceStore.get("glasses", "wifiConnected") as? Boolean ?: false
|
|
455
|
+
|
|
456
|
+
val wifiLocalIp: String
|
|
457
|
+
get() = DeviceStore.get("glasses", "wifiLocalIp") as? String ?: ""
|
|
458
|
+
|
|
459
|
+
val hotspotEnabled: Boolean
|
|
460
|
+
get() = DeviceStore.get("glasses", "hotspotEnabled") as? Boolean ?: false
|
|
461
|
+
|
|
462
|
+
val hotspotSsid: String
|
|
463
|
+
get() = DeviceStore.get("glasses", "hotspotSsid") as? String ?: ""
|
|
464
|
+
|
|
465
|
+
val hotspotPassword: String
|
|
466
|
+
get() = DeviceStore.get("glasses", "hotspotPassword") as? String ?: ""
|
|
467
|
+
|
|
468
|
+
val hotspotGatewayIp: String
|
|
469
|
+
get() = DeviceStore.get("glasses", "hotspotGatewayIp") as? String ?: ""
|
|
470
|
+
}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
package com.glassly.bluetoothsdk.sgcs
|
|
2
|
+
|
|
3
|
+
import com.glassly.bluetoothsdk.BluetoothSdkDefaults
|
|
4
|
+
import com.glassly.bluetoothsdk.Bridge
|
|
5
|
+
import com.glassly.bluetoothsdk.DeviceManager
|
|
6
|
+
import com.glassly.bluetoothsdk.PhotoRequest
|
|
7
|
+
import com.glassly.bluetoothsdk.DeviceStore
|
|
8
|
+
import com.glassly.bluetoothsdk.utils.ConnTypes
|
|
9
|
+
import com.glassly.bluetoothsdk.utils.DeviceTypes
|
|
10
|
+
|
|
11
|
+
class Simulated : SGCManager() {
|
|
12
|
+
|
|
13
|
+
init {
|
|
14
|
+
type = DeviceTypes.SIMULATED
|
|
15
|
+
DeviceStore.apply("glasses", "fullyBooted", true)
|
|
16
|
+
DeviceStore.apply("glasses", "connected", true)
|
|
17
|
+
DeviceStore.apply("glasses", "connectionState", ConnTypes.CONNECTED)
|
|
18
|
+
DeviceStore.apply("glasses", "micEnabled", false)
|
|
19
|
+
DeviceStore.apply(
|
|
20
|
+
"glasses",
|
|
21
|
+
"voiceActivityDetectionEnabled",
|
|
22
|
+
BluetoothSdkDefaults.VOICE_ACTIVITY_DETECTION_ENABLED
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Audio Control
|
|
27
|
+
override fun setMicEnabled(enabled: Boolean) {
|
|
28
|
+
Bridge.log("setMicEnabled")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun sortMicRanking(list: MutableList<String>): MutableList<String> {
|
|
32
|
+
return list
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Camera & Media
|
|
36
|
+
override fun requestPhoto(request: PhotoRequest) {
|
|
37
|
+
Bridge.log("requestPhoto save=${request.save}, sound=${request.sound}")
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
override fun startStream(message: MutableMap<String, Any>) {
|
|
41
|
+
Bridge.log("startStream")
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
override fun stopStream() {
|
|
45
|
+
Bridge.log("stopStream")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
override fun sendStreamKeepAlive(message: MutableMap<String, Any>) {
|
|
49
|
+
Bridge.log("sendStreamKeepAlive")
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
override fun startVideoRecording(requestId: String, save: Boolean, sound: Boolean) {
|
|
53
|
+
Bridge.log("startVideoRecording sound=$sound")
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
override fun stopVideoRecording(requestId: String) {
|
|
57
|
+
Bridge.log("stopVideoRecording")
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Button Settings
|
|
61
|
+
override fun sendButtonPhotoSettings() {
|
|
62
|
+
Bridge.log("sendButtonPhotoSettings")
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override fun sendButtonVideoRecordingSettings() {
|
|
66
|
+
Bridge.log("sendButtonVideoRecordingSettings")
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
override fun sendButtonMaxRecordingTime() {
|
|
70
|
+
Bridge.log("sendButtonMaxRecordingTime")
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
override fun sendCameraFovSetting() {
|
|
74
|
+
Bridge.log("sendCameraFovSetting")
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Display Control
|
|
78
|
+
override fun setBrightness(level: Int, autoMode: Boolean) {
|
|
79
|
+
Bridge.log("setBrightness")
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
override fun clearDisplay() {
|
|
83
|
+
Bridge.log("clearDisplay")
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
override fun sendText(text: String) {
|
|
87
|
+
Bridge.log("sendText")
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun sendTextWall(text: String) {
|
|
91
|
+
Bridge.log("sendTextWall")
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
override fun sendDoubleTextWall(top: String, bottom: String) {
|
|
95
|
+
Bridge.log("sendDoubleTextWall")
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
override fun displayBitmap(
|
|
99
|
+
base64ImageData: String,
|
|
100
|
+
x: Int?,
|
|
101
|
+
y: Int?,
|
|
102
|
+
width: Int?,
|
|
103
|
+
height: Int?
|
|
104
|
+
): Boolean {
|
|
105
|
+
Bridge.log("displayBitmap")
|
|
106
|
+
return false
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
override fun showDashboard() {
|
|
110
|
+
Bridge.log("showDashboard")
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
override fun setDashboardPosition(height: Int, depth: Int) {
|
|
114
|
+
Bridge.log("setDashboardPosition")
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Device Control
|
|
118
|
+
override fun setHeadUpAngle(angle: Int) {
|
|
119
|
+
Bridge.log("setHeadUpAngle")
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
override fun getBatteryStatus() {
|
|
123
|
+
Bridge.log("getBatteryStatus")
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
override fun setSilentMode(enabled: Boolean) {
|
|
127
|
+
Bridge.log("setSilentMode")
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
override fun exit() {
|
|
131
|
+
Bridge.log("exit")
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
override fun sendShutdown() {
|
|
135
|
+
Bridge.log("sendShutdown - not supported on Simulated")
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
override fun sendReboot() {
|
|
139
|
+
Bridge.log("sendReboot - not supported on Simulated")
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
override fun sendRgbLedControl(
|
|
143
|
+
requestId: String,
|
|
144
|
+
packageName: String?,
|
|
145
|
+
action: String,
|
|
146
|
+
color: String?,
|
|
147
|
+
onDurationMs: Int,
|
|
148
|
+
offDurationMs: Int,
|
|
149
|
+
count: Int
|
|
150
|
+
) {
|
|
151
|
+
Bridge.log("sendRgbLedControl - not supported on Simulated")
|
|
152
|
+
Bridge.sendRgbLedControlResponse(requestId, false, "device_not_supported")
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Connection Management
|
|
156
|
+
override fun disconnect() {
|
|
157
|
+
Bridge.log("disconnect")
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
override fun forget() {
|
|
161
|
+
Bridge.log("forget")
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
override fun findCompatibleDevices() {
|
|
165
|
+
Bridge.log("findCompatibleDevices")
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
override fun stopScan() {
|
|
169
|
+
Bridge.log("stopScan")
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
override fun connectById(id: String) {
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
override fun getConnectedBluetoothName(): String {
|
|
176
|
+
return ""
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
override fun cleanup() {
|
|
180
|
+
Bridge.log("cleanup")
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
override fun ping() {
|
|
184
|
+
Bridge.log("ping")
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
override fun dbg1() {}
|
|
188
|
+
override fun dbg2() {}
|
|
189
|
+
|
|
190
|
+
// Network Management
|
|
191
|
+
override fun requestWifiScan(scanId: String?) {
|
|
192
|
+
Bridge.log("requestWifiScan")
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
override fun sendWifiCredentials(ssid: String, password: String) {
|
|
196
|
+
Bridge.log("sendWifiCredentials")
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
override fun forgetWifiNetwork(ssid: String) {
|
|
200
|
+
Bridge.log("forgetWifiNetwork: $ssid")
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
override fun sendHotspotState(enabled: Boolean) {
|
|
204
|
+
Bridge.log("sendHotspotState")
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
override fun sendUserEmailToGlasses(email: String) {
|
|
208
|
+
Bridge.log("sendUserEmailToGlasses: $email")
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
override fun sendIncidentId(incidentId: String, apiBaseUrl: String?) {
|
|
212
|
+
Bridge.log("sendIncidentId: $incidentId")
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Gallery
|
|
216
|
+
override fun queryGalleryStatus() {
|
|
217
|
+
Bridge.log("queryGalleryStatus")
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
override fun sendGalleryMode() {
|
|
221
|
+
Bridge.log("SIMULATED: 📸 Received gallery mode")
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Version info
|
|
225
|
+
override fun requestVersionInfo() {
|
|
226
|
+
Bridge.log("SIMULATED: 📱 Requesting version info (no-op)")
|
|
227
|
+
}
|
|
228
|
+
}
|