diff --git a/demos/demo-android/app/build.gradle b/demos/demo-android/app/build.gradle index 2c6d5d5923..75b2417ee4 100755 --- a/demos/demo-android/app/build.gradle +++ b/demos/demo-android/app/build.gradle @@ -73,7 +73,7 @@ dependencies { implementation 'com.jakewharton.timber:timber:5.0.1' implementation 'io.coil-kt:coil-compose:2.2.2' implementation "io.ktor:ktor-client-cio:2.1.3" - implementation "com.ricoh360.thetaclient:theta-client:1.7.0" + implementation "com.ricoh360.thetaclient:theta-client:1.7.1" testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0' testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version" diff --git a/demos/demo-ios/Podfile b/demos/demo-ios/Podfile index 66dee8d40a..6e3f5dd3da 100644 --- a/demos/demo-ios/Podfile +++ b/demos/demo-ios/Podfile @@ -7,5 +7,5 @@ target 'SdkSample' do use_frameworks! # Pods for SdkSample - pod 'THETAClient', '1.7.0' + pod 'THETAClient', '1.7.1' end diff --git a/demos/demo-react-native/package.json b/demos/demo-react-native/package.json index 0b77ca289f..666e08e96f 100644 --- a/demos/demo-react-native/package.json +++ b/demos/demo-react-native/package.json @@ -13,7 +13,7 @@ "dependencies": { "@react-navigation/native": "^6.1.0", "@react-navigation/native-stack": "^6.9.5", - "theta-client-react-native": "1.7.0", + "theta-client-react-native": "1.7.1", "react": "18.2.0", "react-native": "0.71.14", "react-native-safe-area-context": "^4.4.1", diff --git a/docs/tutorial-android.ja.md b/docs/tutorial-android.ja.md index 29ea248c4f..cc87e60242 100644 --- a/docs/tutorial-android.ja.md +++ b/docs/tutorial-android.ja.md @@ -4,7 +4,7 @@ - モジュールの`build.gradle`の`dependencies`に次を追加します。 ``` - implementation "com.ricoh360.thetaclient:theta-client:1.7.0" + implementation "com.ricoh360.thetaclient:theta-client:1.7.1" ``` - 本 SDK を使用したアプリケーションが動作するスマートフォンと THETA を無線 LAN 接続しておきます。 diff --git a/docs/tutorial-android.md b/docs/tutorial-android.md index 15f76617b2..7765cd72fb 100644 --- a/docs/tutorial-android.md +++ b/docs/tutorial-android.md @@ -5,7 +5,7 @@ - Add following descriptions to the `dependencies` of your module's `build.gradle`. ``` - implementation "com.ricoh360.thetaclient:theta-client:1.7.0" + implementation "com.ricoh360.thetaclient:theta-client:1.7.1" ``` - Connect the wireless LAN between THETA and the smartphone that runs on the application using this SDK. diff --git a/flutter/android/build.gradle b/flutter/android/build.gradle index e38b19f974..2dc2ffbc6b 100644 --- a/flutter/android/build.gradle +++ b/flutter/android/build.gradle @@ -53,5 +53,5 @@ dependencies { implementation("io.ktor:ktor-serialization-kotlinx-json:2.1.2") implementation("com.soywiz.korlibs.krypto:krypto:3.4.0") - implementation("com.ricoh360.thetaclient:theta-client:1.7.0") + implementation("com.ricoh360.thetaclient:theta-client:1.7.1") } diff --git a/flutter/ios/theta_client_flutter.podspec b/flutter/ios/theta_client_flutter.podspec index 4328b12c54..1e618d5993 100644 --- a/flutter/ios/theta_client_flutter.podspec +++ b/flutter/ios/theta_client_flutter.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'theta_client_flutter' - s.version = '1.7.0' + s.version = '1.7.1' s.summary = 'theta-client plugin project.' s.description = <<-DESC theta-client Flutter plugin project. @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.dependency 'Flutter' s.platform = :ios, '15.0' - s.dependency 'THETAClient', '1.7.0' + s.dependency 'THETAClient', '1.7.1' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/flutter/lib/theta_client_flutter.dart b/flutter/lib/theta_client_flutter.dart index db2e18cd19..53a36c18fc 100644 --- a/flutter/lib/theta_client_flutter.dart +++ b/flutter/lib/theta_client_flutter.dart @@ -1208,6 +1208,10 @@ enum MicrophoneOptionEnum { /// Camera error enum CameraErrorEnum { + /// Camera error + /// Undefined value + unknown('UNKNOWN'), + /// Camera error /// Insufficient memory noMemory('NO_MEMORY'), diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 6801e0e758..2df5d427d4 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: theta_client_flutter description: THETA Client Flutter plugin project. -version: 1.7.0 +version: 1.7.1 homepage: environment: diff --git a/flutter/test/enum_name_test.dart b/flutter/test/enum_name_test.dart index 2bb2fbbdea..4776601fef 100644 --- a/flutter/test/enum_name_test.dart +++ b/flutter/test/enum_name_test.dart @@ -347,6 +347,7 @@ void main() { test('CameraErrorEnum', () async { List> data = [ + [CameraErrorEnum.unknown, 'UNKNOWN'], [CameraErrorEnum.noMemory, 'NO_MEMORY'], [CameraErrorEnum.fileNumberOver, 'FILE_NUMBER_OVER'], [CameraErrorEnum.noDateSetting, 'NO_DATE_SETTING'], diff --git a/kotlin-multiplatform/build.gradle.kts b/kotlin-multiplatform/build.gradle.kts index 77349d62f8..b98a034f88 100644 --- a/kotlin-multiplatform/build.gradle.kts +++ b/kotlin-multiplatform/build.gradle.kts @@ -17,7 +17,7 @@ dependencies { dokkaPlugin("org.jetbrains.dokka:versioning-plugin:1.9.10") } -val thetaClientVersion = "1.7.0" +val thetaClientVersion = "1.7.1" group = "com.ricoh360.thetaclient" version = thetaClientVersion diff --git a/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/ThetaRepository.kt b/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/ThetaRepository.kt index 398066241e..051799813d 100644 --- a/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/ThetaRepository.kt +++ b/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/ThetaRepository.kt @@ -6181,6 +6181,11 @@ class ThetaRepository internal constructor(val endpoint: String, config: Config? * Camera error */ enum class CameraErrorEnum { + /** + * Undefined value + */ + UNKNOWN, + /** * Camera error * Insufficient memory @@ -6323,6 +6328,7 @@ class ThetaRepository internal constructor(val endpoint: String, config: Config? */ internal fun get(cameraError: CameraError): CameraErrorEnum { return when (cameraError) { + CameraError.UNKNOWN -> UNKNOWN CameraError.NO_MEMORY -> NO_MEMORY CameraError.FILE_NUMBER_OVER -> FILE_NUMBER_OVER CameraError.NO_DATE_SETTING -> NO_DATE_SETTING @@ -6344,7 +6350,7 @@ class ThetaRepository internal constructor(val endpoint: String, config: Config? CameraError.HIGH_TEMPERATURE_WARNING -> HIGH_TEMPERATURE_WARNING CameraError.HIGH_TEMPERATURE -> HIGH_TEMPERATURE CameraError.BATTERY_HIGH_TEMPERATURE -> BATTERY_HIGH_TEMPERATURE - CameraError.COMPASS_CALIBRATION -> COMPASS_CALIBRATION + CameraError.COMPASS_CALIBRATION, CameraError.ELECTRONIC_COMPASS_CALIBRATION -> COMPASS_CALIBRATION } } } diff --git a/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/serializer.kt b/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/serializer.kt index 02a4447afa..620867460b 100644 --- a/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/serializer.kt +++ b/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/serializer.kt @@ -184,3 +184,24 @@ internal object NumbersAsLongsSerializer : KSerializer> { return result } } + +internal abstract class EnumIgnoreUnknownSerializer>( + values: List, + private val defaultValue: T, +) : KSerializer { + override val descriptor: SerialDescriptor = + PrimitiveSerialDescriptor(values.first()::class.qualifiedName!!, PrimitiveKind.STRING) + private val lookup = values.associateBy({ it }, { it.serialName }) + private val revLookup = values.associateBy { it.serialName } + + private val Enum.serialName: String + get() = name + + override fun serialize(encoder: Encoder, value: T) { + encoder.encodeString(lookup.getValue(value)) + } + + override fun deserialize(decoder: Decoder): T { + return revLookup[decoder.decodeString()] ?: defaultValue + } +} diff --git a/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/stateApi.kt b/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/stateApi.kt index 1d966d50d4..39de0c5cb8 100644 --- a/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/stateApi.kt +++ b/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/transferred/stateApi.kt @@ -6,6 +6,7 @@ package com.ricoh360.thetaclient.transferred import io.ktor.http.* import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonNames /** * /osc/state api request @@ -330,11 +331,20 @@ internal enum class StorageOption { SD, } +internal object CameraErrorSerializer : + EnumIgnoreUnknownSerializer(CameraError.entries, CameraError.UNKNOWN) + /** * Camera error */ -@Serializable +@Serializable(with = CameraErrorSerializer::class) internal enum class CameraError { + /** + * Undefined value + */ + @SerialName("UNKNOWN") + UNKNOWN, + /** * RICOH THETA X or later * 0x00000001: Insufficient memory @@ -483,6 +493,14 @@ internal enum class CameraError { @SerialName("COMPASS_CALIBRATION") COMPASS_CALIBRATION, + /** + * 0x00000010: Electronic compass error + * for RICOH THETA X + * Same as COMPASS_CALIBRATION and will be deleted. + */ + @SerialName("ELECTRONIC_COMPASS_CALIBRATION") + ELECTRONIC_COMPASS_CALIBRATION, + // 0x00000800: Plug-in start warning (IoT technical standards // compliance) // PLUGIN_BOOT_ERROR("PLUGIN_BOOT_ERROR"), diff --git a/kotlin-multiplatform/src/commonTest/kotlin/com/ricoh360/thetaclient/repository/GetThetaStateTest.kt b/kotlin-multiplatform/src/commonTest/kotlin/com/ricoh360/thetaclient/repository/GetThetaStateTest.kt index eccc156bd6..3fe62fbf72 100644 --- a/kotlin-multiplatform/src/commonTest/kotlin/com/ricoh360/thetaclient/repository/GetThetaStateTest.kt +++ b/kotlin-multiplatform/src/commonTest/kotlin/com/ricoh360/thetaclient/repository/GetThetaStateTest.kt @@ -103,6 +103,110 @@ class GetThetaStateTest { assertTrue(thetaState.isBatteryInsert!!, "state isBatteryInsert") } + /** + * Camera error of ELECTRONIC_COMPASS_CALIBRATION for THETA X. + */ + @Test + fun electronicCompassCalibrationErrorTest() = runTest { + // setup + val jsonString = + Resource("src/commonTest/resources/state/state_x_electronic_compass_calibration.json").readText() + MockApiClient.onRequest = { request -> + assertEquals(request.url.encodedPath, "/osc/state", "request path") + ByteReadChannel(jsonString) + } + + // test + val thetaRepository = ThetaRepository(endpoint) + val thetaState = thetaRepository.getThetaState() + + // check + assertTrue(thetaState.fingerprint.isNotEmpty(), "state fingerprint") + assertTrue(thetaState.batteryLevel > 0, "state batteryLevel") + assertTrue(thetaState.storageUri!!.startsWith("http://"), "state storageUri") + assertTrue(thetaState.storageID!!.isNotEmpty(), "state storageUri") + assertEquals(thetaState.captureStatus, ThetaRepository.CaptureStatusEnum.IDLE, "state captureStatus") + assertTrue(thetaState.recordedTime >= 0, "state recordedTime") + assertTrue(thetaState.recordableTime >= 0, "state recordableTime") + assertTrue(thetaState.capturedPictures!! >= 0, "state capturedPictures") + assertNull(thetaState.compositeShootingElapsedTime, "compositeShootingElapsedTime") + assertTrue(thetaState.latestFileUrl.startsWith("http://"), "state latestFileUrl") + assertEquals(thetaState.chargingState, ThetaRepository.ChargingStateEnum.NOT_CHARGING, "state chargingState") + assertEquals(thetaState.apiVersion, 2, "state apiVersion") + assertTrue(!thetaState.isPluginRunning!!, "state isPluginRunning") + assertTrue(thetaState.isPluginWebServer!!, "state isPluginWebServer") + assertEquals(thetaState.function, ThetaRepository.ShootingFunctionEnum.NORMAL, "state function") + assertTrue(!thetaState.isMySettingChanged!!, "state isMySettingChanged") + assertEquals(thetaState.currentMicrophone!!, ThetaRepository.MicrophoneOptionEnum.INTERNAL, "state currentMicrophone") + assertTrue(!thetaState.isSdCard, "state isSdCard") + assertEquals( + thetaState.cameraError!![0], + ThetaRepository.CameraErrorEnum.COMPASS_CALIBRATION, + "state cameraError" + ) + assertTrue(thetaState.isBatteryInsert!!, "state isBatteryInsert") + } + + /** + * Camera error of ELECTRONIC_COMPASS_CALIBRATION for THETA X. + */ + @Test + fun unknownErrorTest() = runTest { + // setup + val jsonString = + Resource("src/commonTest/resources/state/state_x_unknown_camera_error.json").readText() + MockApiClient.onRequest = { request -> + assertEquals(request.url.encodedPath, "/osc/state", "request path") + ByteReadChannel(jsonString) + } + + // test + val thetaRepository = ThetaRepository(endpoint) + val thetaState = thetaRepository.getThetaState() + + // check + assertTrue(thetaState.fingerprint.isNotEmpty(), "state fingerprint") + assertTrue(thetaState.batteryLevel > 0, "state batteryLevel") + assertTrue(thetaState.storageUri!!.startsWith("http://"), "state storageUri") + assertTrue(thetaState.storageID!!.isNotEmpty(), "state storageUri") + assertEquals( + thetaState.captureStatus, + ThetaRepository.CaptureStatusEnum.IDLE, + "state captureStatus" + ) + assertTrue(thetaState.recordedTime >= 0, "state recordedTime") + assertTrue(thetaState.recordableTime >= 0, "state recordableTime") + assertTrue(thetaState.capturedPictures!! >= 0, "state capturedPictures") + assertNull(thetaState.compositeShootingElapsedTime, "compositeShootingElapsedTime") + assertTrue(thetaState.latestFileUrl.startsWith("http://"), "state latestFileUrl") + assertEquals( + thetaState.chargingState, + ThetaRepository.ChargingStateEnum.NOT_CHARGING, + "state chargingState" + ) + assertEquals(thetaState.apiVersion, 2, "state apiVersion") + assertTrue(!thetaState.isPluginRunning!!, "state isPluginRunning") + assertTrue(thetaState.isPluginWebServer!!, "state isPluginWebServer") + assertEquals( + thetaState.function, + ThetaRepository.ShootingFunctionEnum.NORMAL, + "state function" + ) + assertTrue(!thetaState.isMySettingChanged!!, "state isMySettingChanged") + assertEquals( + thetaState.currentMicrophone!!, + ThetaRepository.MicrophoneOptionEnum.INTERNAL, + "state currentMicrophone" + ) + assertTrue(!thetaState.isSdCard, "state isSdCard") + assertEquals( + thetaState.cameraError!![0], + ThetaRepository.CameraErrorEnum.UNKNOWN, + "state cameraError" + ) + assertTrue(thetaState.isBatteryInsert!!, "state isBatteryInsert") + } + /** * Check setting of ThetaState. */ diff --git a/kotlin-multiplatform/src/commonTest/resources/state/state_x_electronic_compass_calibration.json b/kotlin-multiplatform/src/commonTest/resources/state/state_x_electronic_compass_calibration.json new file mode 100644 index 0000000000..6b8f31dfe5 --- /dev/null +++ b/kotlin-multiplatform/src/commonTest/resources/state/state_x_electronic_compass_calibration.json @@ -0,0 +1,23 @@ +{ + "fingerprint": "FIG_0001", + "state": { + "_apiVersion": 2, + "_batteryInsert": true, + "batteryLevel": 0.33, + "_batteryState": "disconnect", + "_cameraError": ["ELECTRONIC_COMPASS_CALIBRATION"], + "_captureStatus": "idle", + "_capturedPictures": 0, + "_currentMicrophone": "Internal", + "_currentStorage": "IN", + "_function": "normal", + "_latestFileUrl": "http://192.168.1.1/files/100RICOH/R0010015.JPG", + "_mySettingChanged": false, + "_pluginRunning": false, + "_pluginWebServer": true, + "_recordableTime": 0, + "_recordedTime": 0, + "_storageID": "90014a68423861503e030277e0c2b500", + "storageUri": "http://192.168.1.1/files/" + } +} diff --git a/kotlin-multiplatform/src/commonTest/resources/state/state_x_unknown_camera_error.json b/kotlin-multiplatform/src/commonTest/resources/state/state_x_unknown_camera_error.json new file mode 100644 index 0000000000..59b93729ac --- /dev/null +++ b/kotlin-multiplatform/src/commonTest/resources/state/state_x_unknown_camera_error.json @@ -0,0 +1,23 @@ +{ + "fingerprint": "FIG_0001", + "state": { + "_apiVersion": 2, + "_batteryInsert": true, + "batteryLevel": 0.33, + "_batteryState": "disconnect", + "_cameraError": ["error_unknown"], + "_captureStatus": "idle", + "_capturedPictures": 0, + "_currentMicrophone": "Internal", + "_currentStorage": "IN", + "_function": "normal", + "_latestFileUrl": "http://192.168.1.1/files/100RICOH/R0010015.JPG", + "_mySettingChanged": false, + "_pluginRunning": false, + "_pluginWebServer": true, + "_recordableTime": 0, + "_recordedTime": 0, + "_storageID": "90014a68423861503e030277e0c2b500", + "storageUri": "http://192.168.1.1/files/" + } +} diff --git a/react-native/android/build.gradle b/react-native/android/build.gradle index 02f7d85103..312883bddf 100644 --- a/react-native/android/build.gradle +++ b/react-native/android/build.gradle @@ -135,7 +135,7 @@ dependencies { implementation "com.facebook.react:react-native:+" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" - implementation "com.ricoh360.thetaclient:theta-client:1.7.0" + implementation "com.ricoh360.thetaclient:theta-client:1.7.1" // From node_modules } diff --git a/react-native/package.json b/react-native/package.json index 67a57c7759..b32aa96842 100644 --- a/react-native/package.json +++ b/react-native/package.json @@ -1,6 +1,6 @@ { "name": "theta-client-react-native", - "version": "1.7.0", + "version": "1.7.1", "description": "This library provides a way to control RICOH THETA using.", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/react-native/src/__tests__/theta-repository/theta-state/theta-state-camera-error.test.ts b/react-native/src/__tests__/theta-repository/theta-state/theta-state-camera-error.test.ts new file mode 100644 index 0000000000..ed7bc02e6a --- /dev/null +++ b/react-native/src/__tests__/theta-repository/theta-state/theta-state-camera-error.test.ts @@ -0,0 +1,39 @@ +import { CameraErrorEnum } from '../../../theta-repository'; + +describe('CameraErrorEnum', () => { + const data: [CameraErrorEnum, string][] = [ + [CameraErrorEnum.UNKNOWN, 'UNKNOWN'], + [CameraErrorEnum.NO_MEMORY, 'NO_MEMORY'], + [CameraErrorEnum.FILE_NUMBER_OVER, 'FILE_NUMBER_OVER'], + [CameraErrorEnum.NO_DATE_SETTING, 'NO_DATE_SETTING'], + [CameraErrorEnum.READ_ERROR, 'READ_ERROR'], + [CameraErrorEnum.NOT_SUPPORTED_MEDIA_TYPE, 'NOT_SUPPORTED_MEDIA_TYPE'], + [CameraErrorEnum.NOT_SUPPORTED_FILE_SYSTEM, 'NOT_SUPPORTED_FILE_SYSTEM'], + [CameraErrorEnum.MEDIA_NOT_READY, 'MEDIA_NOT_READY'], + [CameraErrorEnum.NOT_ENOUGH_BATTERY, 'NOT_ENOUGH_BATTERY'], + [CameraErrorEnum.INVALID_FILE, 'INVALID_FILE'], + [CameraErrorEnum.PLUGIN_BOOT_ERROR, 'PLUGIN_BOOT_ERROR'], + [CameraErrorEnum.IN_PROGRESS_ERROR, 'IN_PROGRESS_ERROR'], + [CameraErrorEnum.CANNOT_RECORDING, 'CANNOT_RECORDING'], + [CameraErrorEnum.CANNOT_RECORD_LOWBAT, 'CANNOT_RECORD_LOWBAT'], + [CameraErrorEnum.CAPTURE_HW_FAILED, 'CAPTURE_HW_FAILED'], + [CameraErrorEnum.CAPTURE_SW_FAILED, 'CAPTURE_SW_FAILED'], + [CameraErrorEnum.INTERNAL_MEM_ACCESS_FAIL, 'INTERNAL_MEM_ACCESS_FAIL'], + [CameraErrorEnum.UNEXPECTED_ERROR, 'UNEXPECTED_ERROR'], + [CameraErrorEnum.BATTERY_CHARGE_FAIL, 'BATTERY_CHARGE_FAIL'], + [CameraErrorEnum.HIGH_TEMPERATURE_WARNING, 'HIGH_TEMPERATURE_WARNING'], + [CameraErrorEnum.HIGH_TEMPERATURE, 'HIGH_TEMPERATURE'], + [CameraErrorEnum.BATTERY_HIGH_TEMPERATURE, 'BATTERY_HIGH_TEMPERATURE'], + [CameraErrorEnum.COMPASS_CALIBRATION, 'COMPASS_CALIBRATION'], + ]; + + test('length', () => { + expect(data.length).toBe(Object.keys(CameraErrorEnum).length); + }); + + test('data', () => { + data.forEach((item) => { + expect(item[0]).toBe(item[1]); + }); + }); +}); diff --git a/react-native/src/theta-repository/theta-state/camera-error.ts b/react-native/src/theta-repository/theta-state/camera-error.ts new file mode 100644 index 0000000000..a29120adf2 --- /dev/null +++ b/react-native/src/theta-repository/theta-state/camera-error.ts @@ -0,0 +1,56 @@ +/** Camera error constants */ +export const CameraErrorEnum = { + /** Undefined value */ + UNKNOWN: 'UNKNOWN', + /** Insufficient memory */ + NO_MEMORY: 'NO_MEMORY', + /** Maximum file number exceeded */ + FILE_NUMBER_OVER: 'FILE_NUMBER_OVER', + /** Camera clock not set */ + NO_DATE_SETTING: 'NO_DATE_SETTING', + /** Includes when the card is removed */ + READ_ERROR: 'READ_ERROR', + /** Unsupported media (SDHC, etc.) */ + NOT_SUPPORTED_MEDIA_TYPE: 'NOT_SUPPORTED_MEDIA_TYPE', + /** FAT32, etc. */ + NOT_SUPPORTED_FILE_SYSTEM: 'NOT_SUPPORTED_FILE_SYSTEM', + /** Error warning while mounting */ + MEDIA_NOT_READY: 'MEDIA_NOT_READY', + /** Battery level warning (firmware update) */ + NOT_ENOUGH_BATTERY: 'NOT_ENOUGH_BATTERY', + /** Firmware file mismatch warning */ + INVALID_FILE: 'INVALID_FILE', + /** Plugin start warning (IoT technical standards compliance) */ + PLUGIN_BOOT_ERROR: 'PLUGIN_BOOT_ERROR', + /** + * When performing continuous shooting by operating the camera while executing , + * , or with the WebAPI or MTP. + */ + IN_PROGRESS_ERROR: 'IN_PROGRESS_ERROR', + /** Battery inserted + WLAN ON + Video mode + 4K 60fps / 5.7K 10fps / 5.7K 15fps / 5.7K 30fps / 8K 10fps */ + CANNOT_RECORDING: 'CANNOT_RECORDING', + /** Battery inserted AND Specified battery level or lower + WLAN ON + Video mode + 4K 30fps */ + CANNOT_RECORD_LOWBAT: 'CANNOT_RECORD_LOWBAT', + /** Shooting hardware failure */ + CAPTURE_HW_FAILED: 'CAPTURE_HW_FAILED', + /** Software error */ + CAPTURE_SW_FAILED: 'CAPTURE_SW_FAILED', + /** Internal memory access error */ + INTERNAL_MEM_ACCESS_FAIL: 'INTERNAL_MEM_ACCESS_FAIL', + /** Undefined error */ + UNEXPECTED_ERROR: 'UNEXPECTED_ERROR', + /** Charging error */ + BATTERY_CHARGE_FAIL: 'BATTERY_CHARGE_FAIL', + /** (Board) temperature warning */ + HIGH_TEMPERATURE_WARNING: 'HIGH_TEMPERATURE_WARNING', + /** (Board) temperature error */ + HIGH_TEMPERATURE: 'HIGH_TEMPERATURE', + /** Battery temperature error */ + BATTERY_HIGH_TEMPERATURE: 'BATTERY_HIGH_TEMPERATURE', + /** Electronic compass error */ + COMPASS_CALIBRATION: 'COMPASS_CALIBRATION', +} as const; + +/** type definition of CameraErrorEnum */ +export type CameraErrorEnum = + (typeof CameraErrorEnum)[keyof typeof CameraErrorEnum]; diff --git a/react-native/src/theta-repository/theta-state/index.ts b/react-native/src/theta-repository/theta-state/index.ts new file mode 100644 index 0000000000..a2b21ead27 --- /dev/null +++ b/react-native/src/theta-repository/theta-state/index.ts @@ -0,0 +1,2 @@ +export * from './camera-error'; +export * from './theta-state'; diff --git a/react-native/src/theta-repository/theta-state.ts b/react-native/src/theta-repository/theta-state/theta-state.ts similarity index 58% rename from react-native/src/theta-repository/theta-state.ts rename to react-native/src/theta-repository/theta-state/theta-state.ts index 1ee615b12e..b9534ef796 100644 --- a/react-native/src/theta-repository/theta-state.ts +++ b/react-native/src/theta-repository/theta-state/theta-state.ts @@ -1,4 +1,5 @@ -import type { ShootingFunctionEnum } from './options/option-function'; +import type { ShootingFunctionEnum } from '../options/option-function'; +import type { CameraErrorEnum } from './camera-error'; /** Battery charging state constants */ export const ChargingStateEnum = { @@ -52,61 +53,6 @@ export const MicrophoneOptionEnum = { export type MicrophoneOptionEnum = (typeof MicrophoneOptionEnum)[keyof typeof MicrophoneOptionEnum]; -/** Camera error constants */ -export const CameraErrorEnum = { - /** Insufficient memory */ - NO_MEMORY: 'NO_MEMORY', - /** Maximum file number exceeded */ - FILE_NUMBER_OVER: 'FILE_NUMBER_OVER', - /** Camera clock not set */ - NO_DATA_SETTING: 'NO_DATE_SETTING', - /** Includes when the card is removed */ - READ_ERROR: 'READ_ERROR', - /** Unsupported media (SDHC, etc.) */ - NOT_SUPPORTED_MEDIA_TYPE: 'NOT_SUPPORTED_MEDIA_TYPE', - /** FAT32, etc. */ - NOT_SUPPORTED_FILE_SYSTEM: 'NOT_SUPPORTED_FILE_SYSTEM', - /** Error warning while mounting */ - MEDIA_NOT_READY: 'MEDIA_NOT_READY', - /** Battery level warning (firmware update) */ - NOT_ENOUGH_BATTERY: 'NOT_ENOUGH_BATTERY', - /** Firmware file mismatch warning */ - INVALID_FILE: 'INVALID_FILE', - /** Plugin start warning (IoT technical standards compliance) */ - PLUGIN_BOOT_ERROR: 'PLUGIN_BOOT_ERROR', - /** - * When performing continuous shooting by operating the camera while executing , - * , or with the WebAPI or MTP. - */ - IN_PROGRESS_ERROR: 'IN_PROGRESS_ERROR', - /** Battery inserted + WLAN ON + Video mode + 4K 60fps / 5.7K 10fps / 5.7K 15fps / 5.7K 30fps / 8K 10fps */ - CANNOT_RECORDING: 'CANNOT_RECORDING', - /** Battery inserted AND Specified battery level or lower + WLAN ON + Video mode + 4K 30fps */ - CANNOT_RECORD_LOWBAT: 'CANNOT_RECORD_LOWBAT', - /** Shooting hardware failure */ - CAPTURE_HW_FAILED: 'CAPTURE_HW_FAILED', - /** Software error */ - CAPTURE_SW_FAILED: 'CAPTURE_SW_FAILED', - /** Internal memory access error */ - INTERNAL_MEM_ACCESS_FAIL: 'INTERNAL_MEM_ACCESS_FAIL', - /** Undefined error */ - UNEXPECTED_ERROR: 'UNEXPECTED_ERROR', - /** Charging error */ - BATTERY_CHARGE_FAIL: 'BATTERY_CHARGE_FAIL', - /** (Board) temperature warning */ - HIGH_TEMPERATURE_WARNING: 'HIGH_TEMPERATURE_WARNING', - /** (Board) temperature error */ - HIGH_TEMPERATURE: 'HIGH_TEMPERATURE', - /** Battery temperature error */ - BATTERY_HIGH_TEMPERATURE: 'BATTERY_HIGH_TEMPERATURE', - /** Electronic compass error */ - COMPASS_CALIBRATION: 'COMPASS_CALIBRATION', -} as const; - -/** type definition of CameraErrorEnum */ -export type CameraErrorEnum = - (typeof CameraErrorEnum)[keyof typeof CameraErrorEnum]; - /** Mutable values representing Theta status. */ export type ThetaState = { /** Fingerprint (unique identifier) of the current camera state */ diff --git a/react-native/theta-client-react-native.podspec b/react-native/theta-client-react-native.podspec index ed9dbe29b2..049c6ccf09 100644 --- a/react-native/theta-client-react-native.podspec +++ b/react-native/theta-client-react-native.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}" s.dependency "React-Core" - s.dependency "THETAClient", "1.7.0" + s.dependency "THETAClient", "1.7.1" # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then