theta-client-react-native 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -1
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/Converter.kt +533 -33
- package/android/src/main/java/com/ricoh360/thetaclientreactnative/ThetaClientSdkModule.kt +201 -50
- package/ios/ConvertUtil.swift +573 -105
- package/ios/ThetaClientReactNative.m +25 -15
- package/ios/ThetaClientReactNative.swift +302 -121
- package/lib/commonjs/capture/capture.js +12 -1
- package/lib/commonjs/capture/capture.js.map +1 -1
- package/lib/commonjs/capture/continuous-capture.js +2 -1
- package/lib/commonjs/capture/continuous-capture.js.map +1 -1
- package/lib/commonjs/capture/index.js +11 -0
- package/lib/commonjs/capture/index.js.map +1 -1
- package/lib/commonjs/capture/multi-bracket-capture.js +13 -2
- package/lib/commonjs/capture/multi-bracket-capture.js.map +1 -1
- package/lib/commonjs/capture/time-shift-manual-capture.js +168 -0
- package/lib/commonjs/capture/time-shift-manual-capture.js.map +1 -0
- package/lib/commonjs/theta-repository/access-point.js +5 -1
- package/lib/commonjs/theta-repository/access-point.js.map +1 -1
- package/lib/commonjs/theta-repository/libs/convert-utils.js +22 -0
- package/lib/commonjs/theta-repository/libs/convert-utils.js.map +1 -0
- package/lib/commonjs/theta-repository/libs/index.js +11 -0
- package/lib/commonjs/theta-repository/libs/index.js.map +1 -1
- package/lib/commonjs/theta-repository/notify-controller.js +16 -7
- package/lib/commonjs/theta-repository/notify-controller.js.map +1 -1
- package/lib/commonjs/theta-repository/options/index.js +166 -12
- package/lib/commonjs/theta-repository/options/index.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-access-info.js +30 -0
- package/lib/commonjs/theta-repository/options/option-access-info.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js +2 -0
- package/lib/commonjs/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-aperture.js +24 -0
- package/lib/commonjs/theta-repository/options/option-aperture.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js +2 -0
- package/lib/commonjs/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-camera-lock-config.js +2 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock-config.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock.js +27 -0
- package/lib/commonjs/theta-repository/options/option-camera-lock.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-camera-power.js +3 -0
- package/lib/commonjs/theta-repository/options/option-camera-power.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-compass-direction-ref.js +30 -0
- package/lib/commonjs/theta-repository/options/option-compass-direction-ref.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-exposure-compensation.js +64 -0
- package/lib/commonjs/theta-repository/options/option-exposure-compensation.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-file-format.js +29 -1
- package/lib/commonjs/theta-repository/options/option-file-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-gps-tag-recording.js +18 -0
- package/lib/commonjs/theta-repository/options/option-gps-tag-recording.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-microphone-noise-reduction.js +23 -0
- package/lib/commonjs/theta-repository/options/option-microphone-noise-reduction.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-mobile-network-setting.js +32 -0
- package/lib/commonjs/theta-repository/options/option-mobile-network-setting.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-network-type.js +18 -2
- package/lib/commonjs/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-off-delay-usb.js +61 -0
- package/lib/commonjs/theta-repository/options/option-off-delay-usb.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-preview-format.js +12 -6
- package/lib/commonjs/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation-support.js +6 -0
- package/lib/commonjs/theta-repository/options/option-top-bottom-correction-rotation-support.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-usb-connection.js +23 -0
- package/lib/commonjs/theta-repository/options/option-usb-connection.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-antenna-config.js +20 -0
- package/lib/commonjs/theta-repository/options/option-wlan-antenna-config.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency-cl-mode.js +2 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency-cl-mode.js.map +1 -0
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js +8 -2
- package/lib/commonjs/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/commonjs/theta-repository/options/options.js +44 -62
- package/lib/commonjs/theta-repository/options/options.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-files.js +5 -1
- package/lib/commonjs/theta-repository/theta-files.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-info.js +3 -1
- package/lib/commonjs/theta-repository/theta-info.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-repository.js +116 -17
- package/lib/commonjs/theta-repository/theta-repository.js.map +1 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js +6 -1
- package/lib/commonjs/theta-repository/theta-state/capture-status.js.map +1 -1
- package/lib/module/capture/capture.js +12 -1
- package/lib/module/capture/capture.js.map +1 -1
- package/lib/module/capture/continuous-capture.js +2 -1
- package/lib/module/capture/continuous-capture.js.map +1 -1
- package/lib/module/capture/index.js +1 -0
- package/lib/module/capture/index.js.map +1 -1
- package/lib/module/capture/multi-bracket-capture.js +13 -2
- package/lib/module/capture/multi-bracket-capture.js.map +1 -1
- package/lib/module/capture/time-shift-manual-capture.js +160 -0
- package/lib/module/capture/time-shift-manual-capture.js.map +1 -0
- package/lib/module/theta-repository/access-point.js +5 -1
- package/lib/module/theta-repository/access-point.js.map +1 -1
- package/lib/module/theta-repository/libs/convert-utils.js +16 -0
- package/lib/module/theta-repository/libs/convert-utils.js.map +1 -0
- package/lib/module/theta-repository/libs/index.js +1 -0
- package/lib/module/theta-repository/libs/index.js.map +1 -1
- package/lib/module/theta-repository/notify-controller.js +16 -7
- package/lib/module/theta-repository/notify-controller.js.map +1 -1
- package/lib/module/theta-repository/options/index.js +16 -2
- package/lib/module/theta-repository/options/index.js.map +1 -1
- package/lib/module/theta-repository/options/option-access-info.js +24 -0
- package/lib/module/theta-repository/options/option-access-info.js.map +1 -0
- package/lib/module/theta-repository/options/option-ai-auto-thumbnail.js +2 -0
- package/lib/module/theta-repository/options/option-ai-auto-thumbnail.js.map +1 -1
- package/lib/module/theta-repository/options/option-aperture.js +18 -0
- package/lib/module/theta-repository/options/option-aperture.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-control-source.js +2 -0
- package/lib/module/theta-repository/options/option-camera-control-source.js.map +1 -1
- package/lib/module/theta-repository/options/option-camera-lock-config.js +2 -0
- package/lib/module/theta-repository/options/option-camera-lock-config.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-lock.js +21 -0
- package/lib/module/theta-repository/options/option-camera-lock.js.map +1 -0
- package/lib/module/theta-repository/options/option-camera-power.js +3 -0
- package/lib/module/theta-repository/options/option-camera-power.js.map +1 -1
- package/lib/module/theta-repository/options/option-compass-direction-ref.js +24 -0
- package/lib/module/theta-repository/options/option-compass-direction-ref.js.map +1 -0
- package/lib/module/theta-repository/options/option-exposure-compensation.js +58 -0
- package/lib/module/theta-repository/options/option-exposure-compensation.js.map +1 -0
- package/lib/module/theta-repository/options/option-file-format.js +29 -1
- package/lib/module/theta-repository/options/option-file-format.js.map +1 -1
- package/lib/module/theta-repository/options/option-gps-tag-recording.js +12 -0
- package/lib/module/theta-repository/options/option-gps-tag-recording.js.map +1 -0
- package/lib/module/theta-repository/options/option-microphone-noise-reduction.js +17 -0
- package/lib/module/theta-repository/options/option-microphone-noise-reduction.js.map +1 -0
- package/lib/module/theta-repository/options/option-mobile-network-setting.js +26 -0
- package/lib/module/theta-repository/options/option-mobile-network-setting.js.map +1 -0
- package/lib/module/theta-repository/options/option-network-type.js +18 -2
- package/lib/module/theta-repository/options/option-network-type.js.map +1 -1
- package/lib/module/theta-repository/options/option-off-delay-usb.js +54 -0
- package/lib/module/theta-repository/options/option-off-delay-usb.js.map +1 -0
- package/lib/module/theta-repository/options/option-preview-format.js +12 -6
- package/lib/module/theta-repository/options/option-preview-format.js.map +1 -1
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation-support.js +2 -0
- package/lib/module/theta-repository/options/option-top-bottom-correction-rotation-support.js.map +1 -0
- package/lib/module/theta-repository/options/option-usb-connection.js +17 -0
- package/lib/module/theta-repository/options/option-usb-connection.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-antenna-config.js +14 -0
- package/lib/module/theta-repository/options/option-wlan-antenna-config.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-frequency-cl-mode.js +2 -0
- package/lib/module/theta-repository/options/option-wlan-frequency-cl-mode.js.map +1 -0
- package/lib/module/theta-repository/options/option-wlan-frequency.js +8 -2
- package/lib/module/theta-repository/options/option-wlan-frequency.js.map +1 -1
- package/lib/module/theta-repository/options/options.js +43 -61
- package/lib/module/theta-repository/options/options.js.map +1 -1
- package/lib/module/theta-repository/theta-files.js +5 -1
- package/lib/module/theta-repository/theta-files.js.map +1 -1
- package/lib/module/theta-repository/theta-info.js +3 -1
- package/lib/module/theta-repository/theta-info.js.map +1 -1
- package/lib/module/theta-repository/theta-repository.js +115 -19
- package/lib/module/theta-repository/theta-repository.js.map +1 -1
- package/lib/module/theta-repository/theta-state/capture-status.js +6 -1
- package/lib/module/theta-repository/theta-state/capture-status.js.map +1 -1
- package/lib/typescript/capture/capture.d.ts +11 -0
- package/lib/typescript/capture/capture.d.ts.map +1 -1
- package/lib/typescript/capture/continuous-capture.d.ts.map +1 -1
- package/lib/typescript/capture/index.d.ts +1 -0
- package/lib/typescript/capture/index.d.ts.map +1 -1
- package/lib/typescript/capture/multi-bracket-capture.d.ts +13 -2
- package/lib/typescript/capture/multi-bracket-capture.d.ts.map +1 -1
- package/lib/typescript/capture/time-shift-manual-capture.d.ts +70 -0
- package/lib/typescript/capture/time-shift-manual-capture.d.ts.map +1 -0
- package/lib/typescript/theta-repository/access-point.d.ts +11 -3
- package/lib/typescript/theta-repository/access-point.d.ts.map +1 -1
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts +3 -0
- package/lib/typescript/theta-repository/libs/convert-utils.d.ts.map +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts +1 -0
- package/lib/typescript/theta-repository/libs/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts +3 -1
- package/lib/typescript/theta-repository/notify-controller.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/index.d.ts +16 -2
- package/lib/typescript/theta-repository/options/index.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-access-info.d.ts +91 -0
- package/lib/typescript/theta-repository/options/option-access-info.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-ai-auto-thumbnail.d.ts +2 -0
- package/lib/typescript/theta-repository/options/option-ai-auto-thumbnail.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-aperture.d.ts +18 -0
- package/lib/typescript/theta-repository/options/option-aperture.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts +3 -1
- package/lib/typescript/theta-repository/options/option-auto-bracket.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts +2 -0
- package/lib/typescript/theta-repository/options/option-camera-control-source.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-camera-lock-config.d.ts +26 -0
- package/lib/typescript/theta-repository/options/option-camera-lock-config.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-camera-lock.d.ts +21 -0
- package/lib/typescript/theta-repository/options/option-camera-lock.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-camera-power.d.ts +3 -0
- package/lib/typescript/theta-repository/options/option-camera-power.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-compass-direction-ref.d.ts +24 -0
- package/lib/typescript/theta-repository/options/option-compass-direction-ref.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-ethernet-config.d.ts +8 -4
- package/lib/typescript/theta-repository/options/option-ethernet-config.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-exposure-compensation.d.ts +58 -0
- package/lib/typescript/theta-repository/options/option-exposure-compensation.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-file-format.d.ts +42 -0
- package/lib/typescript/theta-repository/options/option-file-format.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-gps-tag-recording.d.ts +12 -0
- package/lib/typescript/theta-repository/options/option-gps-tag-recording.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-microphone-noise-reduction.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-microphone-noise-reduction.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-mobile-network-setting.d.ts +34 -0
- package/lib/typescript/theta-repository/options/option-mobile-network-setting.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-network-type.d.ts +17 -1
- package/lib/typescript/theta-repository/options/option-network-type.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-off-delay-usb.d.ts +36 -0
- package/lib/typescript/theta-repository/options/option-off-delay-usb.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-preview-format.d.ts +12 -6
- package/lib/typescript/theta-repository/options/option-preview-format.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation-support.d.ts +19 -0
- package/lib/typescript/theta-repository/options/option-top-bottom-correction-rotation-support.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-usb-connection.d.ts +17 -0
- package/lib/typescript/theta-repository/options/option-usb-connection.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-antenna-config.d.ts +14 -0
- package/lib/typescript/theta-repository/options/option-wlan-antenna-config.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency-cl-mode.d.ts +20 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency-cl-mode.d.ts.map +1 -0
- package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts +7 -1
- package/lib/typescript/theta-repository/options/option-wlan-frequency.d.ts.map +1 -1
- package/lib/typescript/theta-repository/options/options.d.ts +131 -63
- package/lib/typescript/theta-repository/options/options.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-files.d.ts +4 -0
- package/lib/typescript/theta-repository/theta-files.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-info.d.ts +9 -1
- package/lib/typescript/theta-repository/theta-info.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-repository.d.ts +54 -13
- package/lib/typescript/theta-repository/theta-repository.d.ts.map +1 -1
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts +5 -0
- package/lib/typescript/theta-repository/theta-state/capture-status.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/capture/capture.ts +11 -0
- package/src/capture/continuous-capture.ts +2 -4
- package/src/capture/index.ts +1 -0
- package/src/capture/multi-bracket-capture.ts +13 -2
- package/src/capture/time-shift-manual-capture.ts +203 -0
- package/src/theta-repository/access-point.ts +11 -3
- package/src/theta-repository/libs/convert-utils.ts +27 -0
- package/src/theta-repository/libs/index.ts +1 -0
- package/src/theta-repository/notify-controller.ts +18 -8
- package/src/theta-repository/options/index.ts +16 -2
- package/src/theta-repository/options/option-access-info.ts +108 -0
- package/src/theta-repository/options/option-ai-auto-thumbnail.ts +2 -0
- package/src/theta-repository/options/option-aperture.ts +18 -0
- package/src/theta-repository/options/option-auto-bracket.ts +3 -7
- package/src/theta-repository/options/option-camera-control-source.ts +3 -0
- package/src/theta-repository/options/option-camera-lock-config.ts +25 -0
- package/src/theta-repository/options/option-camera-lock.ts +22 -0
- package/src/theta-repository/options/option-camera-power.ts +3 -0
- package/src/theta-repository/options/option-compass-direction-ref.ts +25 -0
- package/src/theta-repository/options/option-ethernet-config.ts +8 -4
- package/src/theta-repository/options/option-exposure-compensation.ts +59 -0
- package/src/theta-repository/options/option-file-format.ts +29 -0
- package/src/theta-repository/options/option-gps-tag-recording.ts +13 -0
- package/src/theta-repository/options/option-microphone-noise-reduction.ts +18 -0
- package/src/theta-repository/options/option-mobile-network-setting.ts +38 -0
- package/src/theta-repository/options/option-network-type.ts +17 -1
- package/src/theta-repository/options/option-off-delay-usb.ts +57 -0
- package/src/theta-repository/options/option-preview-format.ts +12 -6
- package/src/theta-repository/options/option-top-bottom-correction-rotation-support.ts +19 -0
- package/src/theta-repository/options/option-usb-connection.ts +18 -0
- package/src/theta-repository/options/option-wlan-antenna-config.ts +15 -0
- package/src/theta-repository/options/option-wlan-frequency-cl-mode.ts +19 -0
- package/src/theta-repository/options/option-wlan-frequency.ts +7 -1
- package/src/theta-repository/options/options.ts +133 -71
- package/src/theta-repository/theta-files.ts +4 -0
- package/src/theta-repository/theta-info.ts +9 -1
- package/src/theta-repository/theta-repository.ts +117 -30
- package/src/theta-repository/theta-state/capture-status.ts +5 -0
- package/theta-client-react-native.podspec +1 -1
|
@@ -10,6 +10,7 @@ import com.ricoh360.thetaclient.DigestAuth
|
|
|
10
10
|
import com.ricoh360.thetaclient.ThetaRepository.*
|
|
11
11
|
import com.ricoh360.thetaclient.capture.*
|
|
12
12
|
import com.ricoh360.thetaclient.websocket.CameraEvent
|
|
13
|
+
import kotlin.reflect.KClass
|
|
13
14
|
|
|
14
15
|
const val KEY_NOTIFY_NAME = "name"
|
|
15
16
|
const val KEY_NOTIFY_PARAMS = "params"
|
|
@@ -23,10 +24,43 @@ const val KEY_STATE_EXTERNAL_GPS_INFO = "externalGpsInfo"
|
|
|
23
24
|
const val KEY_STATE_INTERNAL_GPS_INFO = "internalGpsInfo"
|
|
24
25
|
const val KEY_STATE_BOARD_TEMP = "boardTemp"
|
|
25
26
|
const val KEY_STATE_BATTERY_TEMP = "batteryTemp"
|
|
27
|
+
const val KEY_SSID = "ssid"
|
|
28
|
+
const val KEY_SSID_STEALTH = "ssidStealth"
|
|
29
|
+
const val KEY_AUTH_MODE = "authMode"
|
|
30
|
+
const val KEY_PASSWORD = "password"
|
|
31
|
+
const val KEY_CONNECTION_PRIORITY = "connectionPriority"
|
|
32
|
+
const val KEY_IP_ADDRESS = "ipAddress"
|
|
33
|
+
const val KEY_SUBNET_MASK = "subnetMask"
|
|
34
|
+
const val KEY_DEFAULT_GATEWAY = "defaultGateway"
|
|
35
|
+
const val KEY_PROXY = "proxy"
|
|
36
|
+
const val KEY_MAC_ADDRESS = "macAddress"
|
|
37
|
+
const val KEY_HOST_NAME = "hostName"
|
|
38
|
+
const val KEY_DHCP_LEASE_ADDRESS = "dhcpLeaseAddress"
|
|
39
|
+
const val KEY_TOP_BOTTOM_CORRECTION_ROTATION = "topBottomCorrectionRotation"
|
|
40
|
+
const val KEY_TOP_BOTTOM_CORRECTION_ROTATION_PITCH = "pitch"
|
|
41
|
+
const val KEY_TOP_BOTTOM_CORRECTION_ROTATION_ROLL = "roll"
|
|
42
|
+
const val KEY_TOP_BOTTOM_CORRECTION_ROTATION_YAW = "yaw"
|
|
43
|
+
const val KEY_TOP_BOTTOM_CORRECTION_ROTATION_SUPPORT = "topBottomCorrectionRotationSupport"
|
|
44
|
+
const val KEY_MAX = "max"
|
|
45
|
+
const val KEY_MIN = "min"
|
|
46
|
+
const val KEY_STEP_SIZE = "stepSize"
|
|
47
|
+
const val KEY_GPS_TAG_RECORDING_SUPPORT = "gpsTagRecordingSupport"
|
|
48
|
+
const val KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL_SUPPORT = "compositeShootingOutputIntervalSupport"
|
|
49
|
+
const val KEY_COMPOSITE_SHOOTING_TIME_SUPPORT = "compositeShootingTimeSupport"
|
|
50
|
+
const val KEY_APERTURE_SUPPORT = "apertureSupport"
|
|
51
|
+
const val KEY_WLAN_FREQUENCY_CL_MODE = "wlanFrequencyClMode"
|
|
52
|
+
const val KEY_WLAN_FREQUENCY_CL_MODE_2_4 = "enable2_4"
|
|
53
|
+
const val KEY_WLAN_FREQUENCY_CL_MODE_5_2 = "enable5_2"
|
|
54
|
+
const val KEY_WLAN_FREQUENCY_CL_MODE_5_8 = "enable5_8"
|
|
55
|
+
const val KEY_DNS1 = "dns1"
|
|
56
|
+
const val KEY_DNS2 = "dns2"
|
|
26
57
|
|
|
27
58
|
val optionItemNameToEnum: Map<String, OptionNameEnum> = mutableMapOf(
|
|
59
|
+
"accessInfo" to OptionNameEnum.AccessInfo,
|
|
28
60
|
"aiAutoThumbnail" to OptionNameEnum.AiAutoThumbnail,
|
|
61
|
+
"aiAutoThumbnailSupport" to OptionNameEnum.AiAutoThumbnailSupport,
|
|
29
62
|
"aperture" to OptionNameEnum.Aperture,
|
|
63
|
+
KEY_APERTURE_SUPPORT to OptionNameEnum.ApertureSupport,
|
|
30
64
|
"autoBracket" to OptionNameEnum.AutoBracket,
|
|
31
65
|
"bitrate" to OptionNameEnum.Bitrate,
|
|
32
66
|
"bluetoothPower" to OptionNameEnum.BluetoothPower,
|
|
@@ -34,26 +68,35 @@ val optionItemNameToEnum: Map<String, OptionNameEnum> = mutableMapOf(
|
|
|
34
68
|
"burstMode" to OptionNameEnum.BurstMode,
|
|
35
69
|
"burstOption" to OptionNameEnum.BurstOption,
|
|
36
70
|
"cameraControlSource" to OptionNameEnum.CameraControlSource,
|
|
71
|
+
"cameraControlSourceSupport" to OptionNameEnum.CameraControlSourceSupport,
|
|
72
|
+
"cameraLock" to OptionNameEnum.CameraLock,
|
|
73
|
+
"cameraLockConfig" to OptionNameEnum.CameraLockConfig,
|
|
37
74
|
"cameraMode" to OptionNameEnum.CameraMode,
|
|
38
75
|
"cameraPower" to OptionNameEnum.CameraPower,
|
|
76
|
+
"cameraPowerSupport" to OptionNameEnum.CameraPowerSupport,
|
|
39
77
|
"captureInterval" to OptionNameEnum.CaptureInterval,
|
|
40
78
|
"captureMode" to OptionNameEnum.CaptureMode,
|
|
41
79
|
"captureNumber" to OptionNameEnum.CaptureNumber,
|
|
42
80
|
"colorTemperature" to OptionNameEnum.ColorTemperature,
|
|
81
|
+
"colorTemperatureSupport" to OptionNameEnum.ColorTemperatureSupport,
|
|
82
|
+
"compassDirectionRef" to OptionNameEnum.CompassDirectionRef,
|
|
43
83
|
"compositeShootingOutputInterval" to OptionNameEnum.CompositeShootingOutputInterval,
|
|
84
|
+
KEY_COMPOSITE_SHOOTING_OUTPUT_INTERVAL_SUPPORT to OptionNameEnum.CompositeShootingOutputIntervalSupport,
|
|
44
85
|
"compositeShootingTime" to OptionNameEnum.CompositeShootingTime,
|
|
86
|
+
KEY_COMPOSITE_SHOOTING_TIME_SUPPORT to OptionNameEnum.CompositeShootingTimeSupport,
|
|
45
87
|
"continuousNumber" to OptionNameEnum.ContinuousNumber,
|
|
46
88
|
"dateTimeZone" to OptionNameEnum.DateTimeZone,
|
|
47
89
|
"ethernetConfig" to OptionNameEnum.EthernetConfig,
|
|
48
90
|
"exposureCompensation" to OptionNameEnum.ExposureCompensation,
|
|
49
91
|
"exposureDelay" to OptionNameEnum.ExposureDelay,
|
|
92
|
+
"exposureDelaySupport" to OptionNameEnum.ExposureDelaySupport,
|
|
50
93
|
"exposureProgram" to OptionNameEnum.ExposureProgram,
|
|
51
94
|
"faceDetect" to OptionNameEnum.FaceDetect,
|
|
52
95
|
"fileFormat" to OptionNameEnum.FileFormat,
|
|
53
96
|
"filter" to OptionNameEnum.Filter,
|
|
54
97
|
"function" to OptionNameEnum.Function,
|
|
55
98
|
"gain" to OptionNameEnum.Gain,
|
|
56
|
-
|
|
99
|
+
KEY_GPS_INFO to OptionNameEnum.GpsInfo,
|
|
57
100
|
"imageStitching" to OptionNameEnum.ImageStitching,
|
|
58
101
|
"isGpsOn" to OptionNameEnum.IsGpsOn,
|
|
59
102
|
"iso" to OptionNameEnum.Iso,
|
|
@@ -61,13 +104,17 @@ val optionItemNameToEnum: Map<String, OptionNameEnum> = mutableMapOf(
|
|
|
61
104
|
"language" to OptionNameEnum.Language,
|
|
62
105
|
"latestEnabledExposureDelayTime" to OptionNameEnum.LatestEnabledExposureDelayTime,
|
|
63
106
|
"maxRecordableTime" to OptionNameEnum.MaxRecordableTime,
|
|
107
|
+
"microphoneNoiseReduction" to OptionNameEnum.MicrophoneNoiseReduction,
|
|
108
|
+
"mobileNetworkSetting" to OptionNameEnum.MobileNetworkSetting,
|
|
64
109
|
"networkType" to OptionNameEnum.NetworkType,
|
|
65
110
|
"offDelay" to OptionNameEnum.OffDelay,
|
|
66
|
-
|
|
111
|
+
KEY_GPS_TAG_RECORDING_SUPPORT to OptionNameEnum.GpsTagRecordingSupport,
|
|
112
|
+
"offDelayUsb" to OptionNameEnum.OffDelayUsb,
|
|
113
|
+
KEY_PASSWORD to OptionNameEnum.Password,
|
|
67
114
|
"powerSaving" to OptionNameEnum.PowerSaving,
|
|
68
115
|
"preset" to OptionNameEnum.Preset,
|
|
69
116
|
"previewFormat" to OptionNameEnum.PreviewFormat,
|
|
70
|
-
|
|
117
|
+
KEY_PROXY to OptionNameEnum.Proxy,
|
|
71
118
|
"remainingPictures" to OptionNameEnum.RemainingPictures,
|
|
72
119
|
"remainingVideoSeconds" to OptionNameEnum.RemainingVideoSeconds,
|
|
73
120
|
"remainingSpace" to OptionNameEnum.RemainingSpace,
|
|
@@ -76,13 +123,20 @@ val optionItemNameToEnum: Map<String, OptionNameEnum> = mutableMapOf(
|
|
|
76
123
|
"shutterVolume" to OptionNameEnum.ShutterVolume,
|
|
77
124
|
"sleepDelay" to OptionNameEnum.SleepDelay,
|
|
78
125
|
"timeShift" to OptionNameEnum.TimeShift,
|
|
126
|
+
"topBottomCorrection" to OptionNameEnum.TopBottomCorrection,
|
|
127
|
+
KEY_TOP_BOTTOM_CORRECTION_ROTATION to OptionNameEnum.TopBottomCorrectionRotation,
|
|
128
|
+
KEY_TOP_BOTTOM_CORRECTION_ROTATION_SUPPORT to OptionNameEnum.TopBottomCorrectionRotationSupport,
|
|
79
129
|
"totalSpace" to OptionNameEnum.TotalSpace,
|
|
130
|
+
"usbConnection" to OptionNameEnum.UsbConnection,
|
|
80
131
|
"username" to OptionNameEnum.Username,
|
|
81
132
|
"videoStitching" to OptionNameEnum.VideoStitching,
|
|
82
133
|
"visibilityReduction" to OptionNameEnum.VisibilityReduction,
|
|
83
134
|
"whiteBalance" to OptionNameEnum.WhiteBalance,
|
|
84
135
|
"whiteBalanceAutoStrength" to OptionNameEnum.WhiteBalanceAutoStrength,
|
|
136
|
+
"wlanAntennaConfig" to OptionNameEnum.WlanAntennaConfig,
|
|
85
137
|
"wlanFrequency" to OptionNameEnum.WlanFrequency,
|
|
138
|
+
"wlanFrequencySupport" to OptionNameEnum.WlanFrequencySupport,
|
|
139
|
+
KEY_WLAN_FREQUENCY_CL_MODE to OptionNameEnum.WlanFrequencyClMode,
|
|
86
140
|
)
|
|
87
141
|
|
|
88
142
|
val optionNameEnumToItemName: Map<OptionNameEnum, String> = optionItemNameToEnum.entries.associate { (key, value) -> value to key }
|
|
@@ -154,7 +208,7 @@ fun <T> setCaptureBuilderParams(optionMap: ReadableMap, builder: Capture.Builder
|
|
|
154
208
|
optionMap.getString("exposureProgram")?.let {
|
|
155
209
|
builder.setExposureProgram(ExposureProgramEnum.valueOf(it))
|
|
156
210
|
}
|
|
157
|
-
optionMap.getMap(
|
|
211
|
+
optionMap.getMap(KEY_GPS_INFO)?.let {
|
|
158
212
|
builder.setGpsInfo(toGpsInfo(map = it))
|
|
159
213
|
}
|
|
160
214
|
optionMap.getString("gpsTagRecording")?.let {
|
|
@@ -211,6 +265,27 @@ fun setTimeShiftCaptureBuilderParams(optionMap: ReadableMap, builder: TimeShiftC
|
|
|
211
265
|
}
|
|
212
266
|
}
|
|
213
267
|
|
|
268
|
+
fun setTimeShiftManualCaptureBuilderParams(optionMap: ReadableMap, builder: TimeShiftManualCapture.Builder) {
|
|
269
|
+
val interval = if (optionMap.hasKey("_capture_interval")) optionMap.getInt("_capture_interval") else null
|
|
270
|
+
interval?.let {
|
|
271
|
+
if (it >= 0) {
|
|
272
|
+
builder.setCheckStatusCommandInterval(it.toLong())
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
optionMap.getMap("timeShift")?.let { timeShiftMap ->
|
|
277
|
+
if (timeShiftMap.hasKey("isFrontFirst")) {
|
|
278
|
+
builder.setIsFrontFirst(timeShiftMap.getBoolean("isFrontFirst"))
|
|
279
|
+
}
|
|
280
|
+
timeShiftMap.getString("firstInterval")?.let {
|
|
281
|
+
builder.setFirstInterval(TimeShiftIntervalEnum.valueOf(it))
|
|
282
|
+
}
|
|
283
|
+
timeShiftMap.getString("secondInterval")?.let {
|
|
284
|
+
builder.setSecondInterval(TimeShiftIntervalEnum.valueOf(it))
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
214
289
|
fun setVideoCaptureBuilderParams(optionMap: ReadableMap, builder: VideoCapture.Builder) {
|
|
215
290
|
val interval =
|
|
216
291
|
if (optionMap.hasKey("_capture_interval")) optionMap.getInt("_capture_interval") else null
|
|
@@ -307,14 +382,16 @@ fun setContinuousCaptureBuilderParams(optionMap: ReadableMap, builder: Continuou
|
|
|
307
382
|
fun toGetOptionsParam(optionNames: ReadableArray): MutableList<OptionNameEnum> {
|
|
308
383
|
val optionNameList = mutableListOf<OptionNameEnum>()
|
|
309
384
|
for (index in 0..(optionNames.size() - 1)) {
|
|
310
|
-
|
|
311
|
-
|
|
385
|
+
optionNames.getString(index)?.let {
|
|
386
|
+
optionNameList.add(OptionNameEnum.valueOf(it))
|
|
387
|
+
}
|
|
312
388
|
}
|
|
313
389
|
return optionNameList
|
|
314
390
|
}
|
|
315
391
|
|
|
316
392
|
fun toResult(options: Options): WritableMap {
|
|
317
393
|
val result = Arguments.createMap()
|
|
394
|
+
val jsonResult = Arguments.createMap()
|
|
318
395
|
|
|
319
396
|
val valueOptions = listOf(
|
|
320
397
|
OptionNameEnum.CaptureInterval,
|
|
@@ -332,8 +409,26 @@ fun toResult(options: Options): WritableMap {
|
|
|
332
409
|
OptionNameEnum.ShutterVolume,
|
|
333
410
|
OptionNameEnum.Username
|
|
334
411
|
)
|
|
412
|
+
val supportOptions = mapOf<OptionNameEnum, KClass<*>>(
|
|
413
|
+
OptionNameEnum.AiAutoThumbnailSupport to AiAutoThumbnailEnum::class,
|
|
414
|
+
OptionNameEnum.ApertureSupport to ApertureEnum::class,
|
|
415
|
+
OptionNameEnum.CameraControlSourceSupport to CameraControlSourceEnum::class,
|
|
416
|
+
OptionNameEnum.CameraPowerSupport to CameraPowerEnum::class,
|
|
417
|
+
OptionNameEnum.ExposureDelaySupport to ExposureDelayEnum::class,
|
|
418
|
+
OptionNameEnum.GpsTagRecordingSupport to GpsTagRecordingEnum::class,
|
|
419
|
+
OptionNameEnum.WlanFrequencySupport to WlanFrequencyEnum::class
|
|
420
|
+
)
|
|
421
|
+
val intValueRangeSupportOptions = listOf(
|
|
422
|
+
OptionNameEnum.ColorTemperatureSupport,
|
|
423
|
+
OptionNameEnum.CompositeShootingOutputIntervalSupport,
|
|
424
|
+
OptionNameEnum.CompositeShootingTimeSupport
|
|
425
|
+
)
|
|
335
426
|
OptionNameEnum.values().forEach { name ->
|
|
336
|
-
if (name == OptionNameEnum.
|
|
427
|
+
if (name == OptionNameEnum.AccessInfo) {
|
|
428
|
+
options.accessInfo?.let {
|
|
429
|
+
result.putMap("accessInfo", toResult(accessInfo = it))
|
|
430
|
+
}
|
|
431
|
+
} else if (name == OptionNameEnum.AutoBracket) {
|
|
337
432
|
options.autoBracket?.let {
|
|
338
433
|
result.putArray("autoBracket", toResult(autoBracket = it))
|
|
339
434
|
}
|
|
@@ -353,9 +448,17 @@ fun toResult(options: Options): WritableMap {
|
|
|
353
448
|
options.ethernetConfig?.let {
|
|
354
449
|
result.putMap("ethernetConfig", toResult(ethernetConfig = it))
|
|
355
450
|
}
|
|
451
|
+
} else if (name == OptionNameEnum.CameraLockConfig) {
|
|
452
|
+
options.cameraLockConfig?.let {
|
|
453
|
+
result.putMap("cameraLockConfig", toResult(cameraLockConfig = it))
|
|
454
|
+
}
|
|
356
455
|
} else if (name == OptionNameEnum.GpsInfo) {
|
|
357
456
|
options.gpsInfo?.let {
|
|
358
|
-
result.putMap(
|
|
457
|
+
result.putMap(KEY_GPS_INFO, toResult(gpsInfo = it))
|
|
458
|
+
}
|
|
459
|
+
} else if (name == OptionNameEnum.MobileNetworkSetting) {
|
|
460
|
+
options.mobileNetworkSetting?.let {
|
|
461
|
+
result.putMap("mobileNetworkSetting", toResult(mobileNetworkSetting = it))
|
|
359
462
|
}
|
|
360
463
|
} else if (name == OptionNameEnum.OffDelay) {
|
|
361
464
|
options.offDelay?.let {
|
|
@@ -365,9 +468,17 @@ fun toResult(options: Options): WritableMap {
|
|
|
365
468
|
result.putInt("offDelay", it.sec)
|
|
366
469
|
}
|
|
367
470
|
}
|
|
471
|
+
} else if (name == OptionNameEnum.OffDelayUsb) {
|
|
472
|
+
options.offDelayUsb?.let {
|
|
473
|
+
if (it is OffDelayUsbEnum) {
|
|
474
|
+
result.putString("offDelayUsb", it.name)
|
|
475
|
+
} else if (it is OffDelayUsbSec) {
|
|
476
|
+
result.putInt("offDelayUsb", it.sec)
|
|
477
|
+
}
|
|
478
|
+
}
|
|
368
479
|
} else if (name == OptionNameEnum.Proxy) {
|
|
369
480
|
options.proxy?.let {
|
|
370
|
-
result.putMap(
|
|
481
|
+
result.putMap(KEY_PROXY, toResult(proxy = it))
|
|
371
482
|
}
|
|
372
483
|
} else if (name == OptionNameEnum.SleepDelay) {
|
|
373
484
|
options.sleepDelay?.let {
|
|
@@ -381,13 +492,34 @@ fun toResult(options: Options): WritableMap {
|
|
|
381
492
|
options.timeShift?.let {
|
|
382
493
|
result.putMap("timeShift", toResult(timeShift = it))
|
|
383
494
|
}
|
|
495
|
+
} else if (name == OptionNameEnum.TopBottomCorrectionRotation) {
|
|
496
|
+
options.topBottomCorrectionRotation?.let {
|
|
497
|
+
result.putMap(KEY_TOP_BOTTOM_CORRECTION_ROTATION, toResult(rotation = it))
|
|
498
|
+
}
|
|
499
|
+
} else if (name == OptionNameEnum.TopBottomCorrectionRotationSupport) {
|
|
500
|
+
options.topBottomCorrectionRotationSupport?.let {
|
|
501
|
+
val json = toJson(rotationSupport = it)
|
|
502
|
+
jsonResult.putString(KEY_TOP_BOTTOM_CORRECTION_ROTATION_SUPPORT, json)
|
|
503
|
+
}
|
|
504
|
+
} else if (name == OptionNameEnum.WlanFrequencyClMode) {
|
|
505
|
+
options.wlanFrequencyClMode?.let {
|
|
506
|
+
result.putMap(KEY_WLAN_FREQUENCY_CL_MODE, toResult(wlanFrequencyClMode = it))
|
|
507
|
+
}
|
|
384
508
|
} else if (valueOptions.contains(name)) {
|
|
385
509
|
addOptionsValueToMap<Any>(options, name, result)
|
|
510
|
+
} else if (supportOptions.keys.contains(name)) {
|
|
511
|
+
addSupportOptionsValueToMap(options, name, result, supportOptions[name]!!)
|
|
512
|
+
} else if (intValueRangeSupportOptions.contains(name)) {
|
|
513
|
+
addValueRangeSupportOptionsValueToMap<Int>(options, name, result)
|
|
386
514
|
} else {
|
|
387
515
|
addOptionsEnumToMap(options, name, result)
|
|
388
516
|
}
|
|
389
517
|
}
|
|
390
|
-
|
|
518
|
+
|
|
519
|
+
val response = Arguments.createMap()
|
|
520
|
+
response.putMap("options", result)
|
|
521
|
+
response.putMap("json", jsonResult)
|
|
522
|
+
return response
|
|
391
523
|
}
|
|
392
524
|
|
|
393
525
|
fun <T : Enum<T>> addOptionsEnumToMap(options: Options, name: OptionNameEnum, objects: WritableMap) {
|
|
@@ -398,6 +530,53 @@ fun <T : Enum<T>> addOptionsEnumToMap(options: Options, name: OptionNameEnum, ob
|
|
|
398
530
|
}
|
|
399
531
|
}
|
|
400
532
|
|
|
533
|
+
fun addSupportOptionsValueToMap(
|
|
534
|
+
options: Options,
|
|
535
|
+
name: OptionNameEnum,
|
|
536
|
+
objects: WritableMap,
|
|
537
|
+
valueClazz: KClass<*>
|
|
538
|
+
) {
|
|
539
|
+
val key = optionNameEnumToItemName[name] ?: return
|
|
540
|
+
options.getValue<List<*>>(name)?.let { list ->
|
|
541
|
+
val array = Arguments.createArray()
|
|
542
|
+
for (item in list) {
|
|
543
|
+
when {
|
|
544
|
+
// for enum value
|
|
545
|
+
java.lang.Enum::class.java.isAssignableFrom(valueClazz.java) -> {
|
|
546
|
+
array.pushString(item.toString())
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
objects.putArray(key, array)
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
fun <T : Number> addValueRangeSupportOptionsValueToMap(
|
|
555
|
+
options: Options,
|
|
556
|
+
name: OptionNameEnum,
|
|
557
|
+
objects: WritableMap
|
|
558
|
+
) {
|
|
559
|
+
val key = optionNameEnumToItemName[name] ?: return
|
|
560
|
+
options.getValue<ValueRange<T>>(name)?.let { value ->
|
|
561
|
+
val result = Arguments.createMap()
|
|
562
|
+
when (value.max) {
|
|
563
|
+
is Int -> {
|
|
564
|
+
result.putInt(KEY_MAX, value.max as Int)
|
|
565
|
+
result.putInt(KEY_MIN, value.min as Int)
|
|
566
|
+
result.putInt(KEY_STEP_SIZE, value.stepSize as Int)
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
is Double -> {
|
|
570
|
+
result.putDouble(KEY_MAX, value.max as Double)
|
|
571
|
+
result.putDouble(KEY_MIN, value.min as Double)
|
|
572
|
+
result.putDouble(KEY_STEP_SIZE, value.stepSize as Double)
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
objects.putMap(key, result)
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
|
|
401
580
|
fun <T> addOptionsValueToMap(options: Options, name: OptionNameEnum, objects: WritableMap) {
|
|
402
581
|
val key = optionNameEnumToItemName[name] ?: return
|
|
403
582
|
options.getValue<T>(name)?.let { value ->
|
|
@@ -421,6 +600,45 @@ fun <T> addOptionsValueToMap(options: Options, name: OptionNameEnum, objects: Wr
|
|
|
421
600
|
}
|
|
422
601
|
}
|
|
423
602
|
|
|
603
|
+
fun toResult(accessInfo: AccessInfo): WritableMap {
|
|
604
|
+
val result = Arguments.createMap()
|
|
605
|
+
result.putString(KEY_SSID, accessInfo.ssid)
|
|
606
|
+
result.putString(KEY_IP_ADDRESS, accessInfo.ipAddress)
|
|
607
|
+
result.putString(KEY_SUBNET_MASK, accessInfo.subnetMask)
|
|
608
|
+
result.putString(KEY_DEFAULT_GATEWAY, accessInfo.defaultGateway)
|
|
609
|
+
accessInfo.dns1?.let {
|
|
610
|
+
result.putString(KEY_DNS1, it)
|
|
611
|
+
}
|
|
612
|
+
accessInfo.dns2?.let {
|
|
613
|
+
result.putString(KEY_DNS2, it)
|
|
614
|
+
}
|
|
615
|
+
result.putString("proxyURL", accessInfo.proxyURL)
|
|
616
|
+
result.putString("frequency", accessInfo.frequency.name)
|
|
617
|
+
result.putInt("wlanSignalStrength", accessInfo.wlanSignalStrength)
|
|
618
|
+
result.putInt("wlanSignalLevel", accessInfo.wlanSignalLevel)
|
|
619
|
+
result.putInt("lteSignalStrength", accessInfo.lteSignalStrength)
|
|
620
|
+
result.putInt("lteSignalLevel", accessInfo.lteSignalLevel)
|
|
621
|
+
|
|
622
|
+
accessInfo.dhcpLeaseAddress?.let { list ->
|
|
623
|
+
val array = Arguments.createArray()
|
|
624
|
+
list.forEach {
|
|
625
|
+
array.pushMap(toResult(dhcpLeaseAddress = it))
|
|
626
|
+
}
|
|
627
|
+
if (array.size() > 0) {
|
|
628
|
+
result.putArray(KEY_DHCP_LEASE_ADDRESS, array)
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return result
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
fun toResult(dhcpLeaseAddress: DhcpLeaseAddress): WritableMap {
|
|
635
|
+
val result = Arguments.createMap()
|
|
636
|
+
result.putString(KEY_IP_ADDRESS, dhcpLeaseAddress.ipAddress)
|
|
637
|
+
result.putString(KEY_MAC_ADDRESS, dhcpLeaseAddress.macAddress)
|
|
638
|
+
result.putString(KEY_HOST_NAME, dhcpLeaseAddress.hostName)
|
|
639
|
+
return result
|
|
640
|
+
}
|
|
641
|
+
|
|
424
642
|
fun toResult(autoBracket: BracketSettingList): WritableArray {
|
|
425
643
|
val resultList = Arguments.createArray()
|
|
426
644
|
|
|
@@ -476,6 +694,29 @@ fun toResult(burstOption: BurstOption): WritableMap {
|
|
|
476
694
|
return result
|
|
477
695
|
}
|
|
478
696
|
|
|
697
|
+
fun toResult(cameraLockConfig: CameraLockConfig): WritableMap {
|
|
698
|
+
val result = Arguments.createMap()
|
|
699
|
+
cameraLockConfig.isPowerKeyLocked?.let { isPowerKeyLocked ->
|
|
700
|
+
result.putBoolean("isPowerKeyLocked", isPowerKeyLocked)
|
|
701
|
+
}
|
|
702
|
+
cameraLockConfig.isShutterKeyLocked?.let { isShutterKeyLocked ->
|
|
703
|
+
result.putBoolean("isShutterKeyLocked", isShutterKeyLocked)
|
|
704
|
+
}
|
|
705
|
+
cameraLockConfig.isModeKeyLocked?.let { isModeKeyLocked ->
|
|
706
|
+
result.putBoolean("isModeKeyLocked", isModeKeyLocked)
|
|
707
|
+
}
|
|
708
|
+
cameraLockConfig.isWlanKeyLocked?.let { isWlanKeyLocked ->
|
|
709
|
+
result.putBoolean("isWlanKeyLocked", isWlanKeyLocked)
|
|
710
|
+
}
|
|
711
|
+
cameraLockConfig.isFnKeyLocked?.let { isFnKeyLocked ->
|
|
712
|
+
result.putBoolean("isFnKeyLocked", isFnKeyLocked)
|
|
713
|
+
}
|
|
714
|
+
cameraLockConfig.isPanelLocked?.let { isPanelLocked ->
|
|
715
|
+
result.putBoolean("isPanelLocked", isPanelLocked)
|
|
716
|
+
}
|
|
717
|
+
return result
|
|
718
|
+
}
|
|
719
|
+
|
|
479
720
|
fun toResult(fileInfo: FileInfo): ReadableMap {
|
|
480
721
|
val result = Arguments.createMap()
|
|
481
722
|
result.putString("name", fileInfo.name)
|
|
@@ -544,16 +785,22 @@ fun toResult(ethernetConfig: EthernetConfig): WritableMap {
|
|
|
544
785
|
val result = Arguments.createMap()
|
|
545
786
|
result.putBoolean("usingDhcp", ethernetConfig.usingDhcp)
|
|
546
787
|
ethernetConfig.ipAddress?.let { ipAddress ->
|
|
547
|
-
result.putString(
|
|
788
|
+
result.putString(KEY_IP_ADDRESS, ipAddress)
|
|
548
789
|
}
|
|
549
790
|
ethernetConfig.subnetMask?.let { subnetMask ->
|
|
550
|
-
result.putString(
|
|
791
|
+
result.putString(KEY_SUBNET_MASK, subnetMask)
|
|
551
792
|
}
|
|
552
793
|
ethernetConfig.defaultGateway?.let { defaultGateway ->
|
|
553
|
-
result.putString(
|
|
794
|
+
result.putString(KEY_DEFAULT_GATEWAY, defaultGateway)
|
|
795
|
+
}
|
|
796
|
+
ethernetConfig.dns1?.let { dns1 ->
|
|
797
|
+
result.putString(KEY_DNS1, dns1)
|
|
798
|
+
}
|
|
799
|
+
ethernetConfig.dns2?.let { dns2 ->
|
|
800
|
+
result.putString(KEY_DNS2, dns2)
|
|
554
801
|
}
|
|
555
802
|
ethernetConfig.proxy?.let { proxy ->
|
|
556
|
-
result.putMap(
|
|
803
|
+
result.putMap(KEY_PROXY, toResult(proxy = proxy))
|
|
557
804
|
}
|
|
558
805
|
return result
|
|
559
806
|
}
|
|
@@ -588,7 +835,7 @@ fun toResult(proxy: Proxy): WritableMap {
|
|
|
588
835
|
result.putString("userid", userid)
|
|
589
836
|
}
|
|
590
837
|
proxy.password?.let { password ->
|
|
591
|
-
result.putString(
|
|
838
|
+
result.putString(KEY_PASSWORD, password)
|
|
592
839
|
}
|
|
593
840
|
return result
|
|
594
841
|
}
|
|
@@ -607,6 +854,47 @@ fun toResult(timeShift: TimeShiftSetting): WritableMap {
|
|
|
607
854
|
return result
|
|
608
855
|
}
|
|
609
856
|
|
|
857
|
+
fun toResult(rotation: TopBottomCorrectionRotation): WritableMap {
|
|
858
|
+
val result = Arguments.createMap()
|
|
859
|
+
rotation.pitch?.let { value ->
|
|
860
|
+
result.putDouble(KEY_TOP_BOTTOM_CORRECTION_ROTATION_PITCH, value.toDouble())
|
|
861
|
+
}
|
|
862
|
+
rotation.roll?.let { value ->
|
|
863
|
+
result.putDouble(KEY_TOP_BOTTOM_CORRECTION_ROTATION_ROLL, value.toDouble())
|
|
864
|
+
}
|
|
865
|
+
rotation.yaw?.let { value ->
|
|
866
|
+
result.putDouble(KEY_TOP_BOTTOM_CORRECTION_ROTATION_YAW, value.toDouble())
|
|
867
|
+
}
|
|
868
|
+
return result
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Avoided floating-point errors by converting to JSON string in the bridge,
|
|
873
|
+
* then to object in TypeScript.
|
|
874
|
+
*/
|
|
875
|
+
fun toJson(rotationSupport: TopBottomCorrectionRotationSupport): String {
|
|
876
|
+
val convertJson = """
|
|
877
|
+
{
|
|
878
|
+
"pitch": {
|
|
879
|
+
"max": ${rotationSupport.pitch.max},
|
|
880
|
+
"min": ${rotationSupport.pitch.min},
|
|
881
|
+
"stepSize": ${rotationSupport.pitch.stepSize}
|
|
882
|
+
},
|
|
883
|
+
"roll": {
|
|
884
|
+
"max": ${rotationSupport.roll.max},
|
|
885
|
+
"min": ${rotationSupport.roll.min},
|
|
886
|
+
"stepSize": ${rotationSupport.roll.stepSize}
|
|
887
|
+
},
|
|
888
|
+
"yaw": {
|
|
889
|
+
"max": ${rotationSupport.yaw.max},
|
|
890
|
+
"min": ${rotationSupport.yaw.min},
|
|
891
|
+
"stepSize": ${rotationSupport.yaw.stepSize}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
""".trimIndent()
|
|
895
|
+
return convertJson
|
|
896
|
+
}
|
|
897
|
+
|
|
610
898
|
fun toResult(state: ThetaState): WritableMap {
|
|
611
899
|
val result = Arguments.createMap()
|
|
612
900
|
state.fingerprint?.let {
|
|
@@ -687,7 +975,7 @@ fun toResult(state: ThetaState): WritableMap {
|
|
|
687
975
|
fun toResult(cameraEvent: CameraEvent): WritableMap {
|
|
688
976
|
val result = Arguments.createMap()
|
|
689
977
|
cameraEvent.options?.let {
|
|
690
|
-
result.putMap("options", toResult(it))
|
|
978
|
+
result.putMap("options", toResult(options = it).getMap("options"))
|
|
691
979
|
}
|
|
692
980
|
cameraEvent.state?.let {
|
|
693
981
|
result.putMap("state", toResult(it))
|
|
@@ -695,6 +983,25 @@ fun toResult(cameraEvent: CameraEvent): WritableMap {
|
|
|
695
983
|
return result
|
|
696
984
|
}
|
|
697
985
|
|
|
986
|
+
fun toResult(wlanFrequencyClMode: WlanFrequencyClMode): WritableMap {
|
|
987
|
+
val result = Arguments.createMap()
|
|
988
|
+
result.putBoolean(KEY_WLAN_FREQUENCY_CL_MODE_2_4, wlanFrequencyClMode.enable2_4)
|
|
989
|
+
result.putBoolean(KEY_WLAN_FREQUENCY_CL_MODE_5_2, wlanFrequencyClMode.enable5_2)
|
|
990
|
+
result.putBoolean(KEY_WLAN_FREQUENCY_CL_MODE_5_8, wlanFrequencyClMode.enable5_8)
|
|
991
|
+
return result
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
fun toResult(mobileNetworkSetting: MobileNetworkSetting): WritableMap {
|
|
995
|
+
val result = Arguments.createMap()
|
|
996
|
+
mobileNetworkSetting.roaming?.name?.let { name ->
|
|
997
|
+
result.putString("roaming", name)
|
|
998
|
+
}
|
|
999
|
+
mobileNetworkSetting.plan?.name?.let { name ->
|
|
1000
|
+
result.putString("plan", name)
|
|
1001
|
+
}
|
|
1002
|
+
return result
|
|
1003
|
+
}
|
|
1004
|
+
|
|
698
1005
|
fun toSetOptionsParam(optionsMap: ReadableMap): Options {
|
|
699
1006
|
val result = Options()
|
|
700
1007
|
val iterator = optionsMap.keySetIterator()
|
|
@@ -742,6 +1049,10 @@ fun setOptionValue(options: Options, name: OptionNameEnum, optionsMap: ReadableM
|
|
|
742
1049
|
options.setValue(name, optionsMap.getDouble(key).toLong())
|
|
743
1050
|
} else if (boolOptions.contains(name)) {
|
|
744
1051
|
options.setValue(name, optionsMap.getBoolean(key))
|
|
1052
|
+
} else if (name == OptionNameEnum.AccessInfo) {
|
|
1053
|
+
optionsMap.getMap(key)?.let {
|
|
1054
|
+
options.setValue(name, toAccessInfo(map = it))
|
|
1055
|
+
}
|
|
745
1056
|
} else if (name == OptionNameEnum.AutoBracket) {
|
|
746
1057
|
optionsMap.getArray(key)?.let {
|
|
747
1058
|
options.setValue(name, toAutoBracket(list = it))
|
|
@@ -759,6 +1070,10 @@ fun setOptionValue(options: Options, name: OptionNameEnum, optionsMap: ReadableM
|
|
|
759
1070
|
optionsMap.getMap(key)?.let {
|
|
760
1071
|
options.setValue(name, toBurstOption(map = it))
|
|
761
1072
|
}
|
|
1073
|
+
} else if (name == OptionNameEnum.CameraLockConfig) {
|
|
1074
|
+
optionsMap.getMap(key)?.let {
|
|
1075
|
+
options.setValue(name, toCameraLockConfig(map = it) as Any)
|
|
1076
|
+
}
|
|
762
1077
|
} else if (name == OptionNameEnum.EthernetConfig) {
|
|
763
1078
|
optionsMap.getMap(key)?.let {
|
|
764
1079
|
options.setValue(name, toEthernetConfig(map = it) as Any)
|
|
@@ -767,10 +1082,18 @@ fun setOptionValue(options: Options, name: OptionNameEnum, optionsMap: ReadableM
|
|
|
767
1082
|
optionsMap.getMap(key)?.let {
|
|
768
1083
|
options.setValue(name, toGpsInfo(map = it))
|
|
769
1084
|
}
|
|
1085
|
+
} else if (name == OptionNameEnum.MobileNetworkSetting) {
|
|
1086
|
+
optionsMap.getMap(key)?.let {
|
|
1087
|
+
options.setValue(name, toMobileNetworkSetting(map = it))
|
|
1088
|
+
}
|
|
770
1089
|
} else if (name == OptionNameEnum.OffDelay) {
|
|
771
1090
|
toOffDelay(optionsMap)?.let {
|
|
772
1091
|
options.setValue(name, it)
|
|
773
1092
|
}
|
|
1093
|
+
} else if (name == OptionNameEnum.OffDelayUsb) {
|
|
1094
|
+
toOffDelayUsb(optionsMap)?.let {
|
|
1095
|
+
options.setValue(name, it)
|
|
1096
|
+
}
|
|
774
1097
|
} else if (name == OptionNameEnum.Proxy) {
|
|
775
1098
|
optionsMap.getMap(key)?.let {
|
|
776
1099
|
options.setValue(name, toProxy(map = it) as Any)
|
|
@@ -783,6 +1106,14 @@ fun setOptionValue(options: Options, name: OptionNameEnum, optionsMap: ReadableM
|
|
|
783
1106
|
optionsMap.getMap(key)?.let {
|
|
784
1107
|
options.setValue(name, toTimeShift(map = it))
|
|
785
1108
|
}
|
|
1109
|
+
} else if (name == OptionNameEnum.TopBottomCorrectionRotation) {
|
|
1110
|
+
optionsMap.getMap(key)?.let {
|
|
1111
|
+
options.setValue(name, toTopBottomCorrectionRotation(map = it))
|
|
1112
|
+
}
|
|
1113
|
+
} else if (name == OptionNameEnum.WlanFrequencyClMode) {
|
|
1114
|
+
optionsMap.getMap(key)?.let {
|
|
1115
|
+
options.setValue(name, toWlanFrequencyClMode(it))
|
|
1116
|
+
}
|
|
786
1117
|
} else {
|
|
787
1118
|
(optionsMap.getString(key))?.let { value ->
|
|
788
1119
|
getOptionValueEnum(name, value)?.let {
|
|
@@ -800,9 +1131,11 @@ fun getOptionValueEnum(name: OptionNameEnum, valueName: String): Any? {
|
|
|
800
1131
|
OptionNameEnum.BluetoothRole -> BluetoothRoleEnum.values().find { it.name == valueName }
|
|
801
1132
|
OptionNameEnum.BurstMode -> BurstModeEnum.values().find { it.name == valueName }
|
|
802
1133
|
OptionNameEnum.CameraControlSource -> CameraControlSourceEnum.values().find { it.name == valueName }
|
|
1134
|
+
OptionNameEnum.CameraLock -> CameraLockEnum.values().find { it.name == valueName }
|
|
803
1135
|
OptionNameEnum.CameraMode -> CameraModeEnum.values().find { it.name == valueName }
|
|
804
1136
|
OptionNameEnum.CameraPower -> CameraPowerEnum.values().find { it.name == valueName }
|
|
805
1137
|
OptionNameEnum.CaptureMode -> CaptureModeEnum.values().find { it.name == valueName }
|
|
1138
|
+
OptionNameEnum.CompassDirectionRef -> CompassDirectionRefEnum.values().find { it.name == valueName }
|
|
806
1139
|
OptionNameEnum.ContinuousNumber -> ContinuousNumberEnum.values().find { it.name == valueName }
|
|
807
1140
|
OptionNameEnum.ExposureCompensation -> ExposureCompensationEnum.values().find { it.name == valueName }
|
|
808
1141
|
OptionNameEnum.ExposureDelay -> ExposureDelayEnum.values().find { it.name == valueName }
|
|
@@ -818,18 +1151,23 @@ fun getOptionValueEnum(name: OptionNameEnum, valueName: String): Any? {
|
|
|
818
1151
|
OptionNameEnum.Language -> LanguageEnum.values().find { it.name == valueName }
|
|
819
1152
|
OptionNameEnum.LatestEnabledExposureDelayTime -> ExposureDelayEnum.values().find { it.name == valueName }
|
|
820
1153
|
OptionNameEnum.MaxRecordableTime -> MaxRecordableTimeEnum.values().find { it.name == valueName }
|
|
1154
|
+
OptionNameEnum.MicrophoneNoiseReduction -> MicrophoneNoiseReductionEnum.values().find { it.name == valueName }
|
|
821
1155
|
OptionNameEnum.NetworkType -> NetworkTypeEnum.values().find { it.name == valueName }
|
|
822
1156
|
OptionNameEnum.OffDelay -> OffDelayEnum.values().find { it.name == valueName }
|
|
1157
|
+
OptionNameEnum.OffDelayUsb -> OffDelayUsbEnum.entries.find { it.name == valueName }
|
|
823
1158
|
OptionNameEnum.PowerSaving -> PowerSavingEnum.values().find { it.name == valueName }
|
|
824
1159
|
OptionNameEnum.Preset -> PresetEnum.values().find { it.name == valueName }
|
|
825
1160
|
OptionNameEnum.PreviewFormat -> PreviewFormatEnum.values().find { it.name == valueName }
|
|
826
1161
|
OptionNameEnum.ShootingMethod -> ShootingMethodEnum.values().find { it.name == valueName }
|
|
827
1162
|
OptionNameEnum.ShutterSpeed -> ShutterSpeedEnum.values().find { it.name == valueName }
|
|
828
1163
|
OptionNameEnum.SleepDelay -> SleepDelayEnum.values().find { it.name == valueName }
|
|
1164
|
+
OptionNameEnum.TopBottomCorrection -> TopBottomCorrectionOptionEnum.values().find { it.name == valueName }
|
|
1165
|
+
OptionNameEnum.UsbConnection -> UsbConnectionEnum.entries.find { it.name == valueName }
|
|
829
1166
|
OptionNameEnum.VideoStitching -> VideoStitchingEnum.values().find { it.name == valueName }
|
|
830
1167
|
OptionNameEnum.VisibilityReduction -> VisibilityReductionEnum.values().find { it.name == valueName }
|
|
831
1168
|
OptionNameEnum.WhiteBalance -> WhiteBalanceEnum.values().find { it.name == valueName }
|
|
832
1169
|
OptionNameEnum.WhiteBalanceAutoStrength -> WhiteBalanceAutoStrengthEnum.values().find { it.name == valueName }
|
|
1170
|
+
OptionNameEnum.WlanAntennaConfig -> WlanAntennaConfigEnum.values().find { it.name == valueName }
|
|
833
1171
|
OptionNameEnum.WlanFrequency -> WlanFrequencyEnum.values().find { it.name == valueName }
|
|
834
1172
|
else -> null
|
|
835
1173
|
}
|
|
@@ -839,16 +1177,22 @@ fun toListAccessPointsResult(accessPointList: List<AccessPoint>): WritableArray
|
|
|
839
1177
|
val result = Arguments.createArray()
|
|
840
1178
|
accessPointList.forEach {
|
|
841
1179
|
val apinfo = Arguments.createMap()
|
|
842
|
-
apinfo.putString(
|
|
843
|
-
apinfo.putBoolean(
|
|
844
|
-
apinfo.putString(
|
|
845
|
-
apinfo.putInt(
|
|
1180
|
+
apinfo.putString(KEY_SSID, it.ssid)
|
|
1181
|
+
apinfo.putBoolean(KEY_SSID_STEALTH, it.ssidStealth)
|
|
1182
|
+
apinfo.putString(KEY_AUTH_MODE, it.authMode.toString())
|
|
1183
|
+
apinfo.putInt(KEY_CONNECTION_PRIORITY, it.connectionPriority)
|
|
846
1184
|
apinfo.putBoolean("usingDhcp", it.usingDhcp)
|
|
847
|
-
apinfo.putString(
|
|
848
|
-
apinfo.putString(
|
|
849
|
-
apinfo.putString(
|
|
1185
|
+
apinfo.putString(KEY_IP_ADDRESS, it.ipAddress)
|
|
1186
|
+
apinfo.putString(KEY_SUBNET_MASK, it.subnetMask)
|
|
1187
|
+
apinfo.putString(KEY_DEFAULT_GATEWAY, it.defaultGateway)
|
|
1188
|
+
it.dns1?.let { dns1 ->
|
|
1189
|
+
apinfo.putString(KEY_DNS1, dns1)
|
|
1190
|
+
}
|
|
1191
|
+
it.dns2?.let { dns2 ->
|
|
1192
|
+
apinfo.putString(KEY_DNS2, dns2)
|
|
1193
|
+
}
|
|
850
1194
|
it.proxy?.let { proxy ->
|
|
851
|
-
apinfo.putMap(
|
|
1195
|
+
apinfo.putMap(KEY_PROXY, toResult(proxy = proxy))
|
|
852
1196
|
}
|
|
853
1197
|
|
|
854
1198
|
result.pushMap(apinfo)
|
|
@@ -856,6 +1200,46 @@ fun toListAccessPointsResult(accessPointList: List<AccessPoint>): WritableArray
|
|
|
856
1200
|
return result
|
|
857
1201
|
}
|
|
858
1202
|
|
|
1203
|
+
fun toAccessInfo(map: ReadableMap): AccessInfo {
|
|
1204
|
+
val dhcpLeaseAddress = map.getArray(KEY_DHCP_LEASE_ADDRESS)?.let { array ->
|
|
1205
|
+
val list = mutableListOf<DhcpLeaseAddress>()
|
|
1206
|
+
for (i in 0 until array.size()) {
|
|
1207
|
+
array.getMap(i)?.let { map ->
|
|
1208
|
+
toDhcpLeaseAddress(map)?.let {
|
|
1209
|
+
list.add(it)
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
if (list.size > 0) list else null
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
return AccessInfo(
|
|
1217
|
+
ssid = map.getString(KEY_SSID) ?: "",
|
|
1218
|
+
ipAddress = map.getString(KEY_IP_ADDRESS) ?: "",
|
|
1219
|
+
subnetMask = map.getString(KEY_SUBNET_MASK) ?: "",
|
|
1220
|
+
defaultGateway = map.getString(KEY_DEFAULT_GATEWAY) ?: "",
|
|
1221
|
+
dns1 = map.getString(KEY_DNS1) ?: "",
|
|
1222
|
+
dns2 = map.getString(KEY_DNS2) ?: "",
|
|
1223
|
+
proxyURL = map.getString("proxyURL") ?: "",
|
|
1224
|
+
frequency = map.getString("frequency")?.let { WlanFrequencyAccessInfoEnum.valueOf(it) } ?: WlanFrequencyAccessInfoEnum.INITIAL_VALUE,
|
|
1225
|
+
wlanSignalStrength = map.getInt("wlanSignalStrength"),
|
|
1226
|
+
wlanSignalLevel = map.getInt("wlanSignalLevel"),
|
|
1227
|
+
lteSignalStrength = map.getInt("lteSignalStrength"),
|
|
1228
|
+
lteSignalLevel = map.getInt("lteSignalLevel"),
|
|
1229
|
+
dhcpLeaseAddress = dhcpLeaseAddress
|
|
1230
|
+
)
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
fun toDhcpLeaseAddress(value: ReadableMap): DhcpLeaseAddress? {
|
|
1234
|
+
val ipAddress = value.getString(KEY_IP_ADDRESS)
|
|
1235
|
+
val macAddress = value.getString(KEY_MAC_ADDRESS)
|
|
1236
|
+
val hostName = value.getString(KEY_HOST_NAME)
|
|
1237
|
+
if (ipAddress == null || macAddress == null || hostName == null) {
|
|
1238
|
+
return null
|
|
1239
|
+
}
|
|
1240
|
+
return DhcpLeaseAddress(ipAddress, macAddress, hostName)
|
|
1241
|
+
}
|
|
1242
|
+
|
|
859
1243
|
fun toAutoBracket(list: ReadableArray): BracketSettingList {
|
|
860
1244
|
val autoBracket = BracketSettingList()
|
|
861
1245
|
for (i in 0 until list.size()) {
|
|
@@ -876,14 +1260,29 @@ fun toAutoBracket(list: ReadableArray): BracketSettingList {
|
|
|
876
1260
|
return autoBracket
|
|
877
1261
|
}
|
|
878
1262
|
|
|
1263
|
+
fun toCameraLockConfig(map: ReadableMap?): CameraLockConfig? {
|
|
1264
|
+
return map?.let {
|
|
1265
|
+
CameraLockConfig(
|
|
1266
|
+
isPowerKeyLocked = if (it.hasKey("isPowerKeyLocked")) it.getBoolean("isPowerKeyLocked") else null,
|
|
1267
|
+
isShutterKeyLocked = if (it.hasKey("isShutterKeyLocked")) it.getBoolean("isShutterKeyLocked") else null,
|
|
1268
|
+
isModeKeyLocked = if (it.hasKey("isModeKeyLocked")) it.getBoolean("isModeKeyLocked") else null,
|
|
1269
|
+
isWlanKeyLocked = if (it.hasKey("isWlanKeyLocked")) it.getBoolean("isWlanKeyLocked") else null,
|
|
1270
|
+
isFnKeyLocked = if (it.hasKey("isFnKeyLocked")) it.getBoolean("isFnKeyLocked") else null,
|
|
1271
|
+
isPanelLocked = if (it.hasKey("isPanelLocked")) it.getBoolean("isPanelLocked") else null,
|
|
1272
|
+
)
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
|
|
879
1276
|
fun toEthernetConfig(map: ReadableMap?): EthernetConfig? {
|
|
880
1277
|
return map?.let {
|
|
881
1278
|
EthernetConfig(
|
|
882
1279
|
usingDhcp = if (it.hasKey("usingDhcp")) it.getBoolean("usingDhcp") else true,
|
|
883
|
-
ipAddress = if (it.hasKey(
|
|
884
|
-
subnetMask = if (it.hasKey(
|
|
885
|
-
defaultGateway = if (it.hasKey(
|
|
886
|
-
|
|
1280
|
+
ipAddress = if (it.hasKey(KEY_IP_ADDRESS)) it.getString(KEY_IP_ADDRESS) else null,
|
|
1281
|
+
subnetMask = if (it.hasKey(KEY_SUBNET_MASK)) it.getString(KEY_SUBNET_MASK) else null,
|
|
1282
|
+
defaultGateway = if (it.hasKey(KEY_DEFAULT_GATEWAY)) it.getString(KEY_DEFAULT_GATEWAY) else null,
|
|
1283
|
+
dns1 = if (it.hasKey(KEY_DNS1)) it.getString(KEY_DNS1) else null,
|
|
1284
|
+
dns2 = if (it.hasKey(KEY_DNS2)) it.getString(KEY_DNS2) else null,
|
|
1285
|
+
proxy = if (it.hasKey(KEY_PROXY)) toProxy(map = it.getMap(KEY_PROXY)) else null
|
|
887
1286
|
)
|
|
888
1287
|
}
|
|
889
1288
|
}
|
|
@@ -892,10 +1291,10 @@ fun toProxy(map: ReadableMap?): Proxy? {
|
|
|
892
1291
|
return map?.let {
|
|
893
1292
|
Proxy(
|
|
894
1293
|
use = it.getBoolean("use"),
|
|
895
|
-
url = it.getString("url"),
|
|
1294
|
+
url = if (it.hasKey("url")) it.getString("url") else null,
|
|
896
1295
|
port = if (it.hasKey("port")) it.getInt("port") else null,
|
|
897
|
-
userid = it.getString("userid"),
|
|
898
|
-
password = it.getString(
|
|
1296
|
+
userid = if (it.hasKey("userid")) it.getString("userid") else null,
|
|
1297
|
+
password = if (it.hasKey(KEY_PASSWORD)) it.getString(KEY_PASSWORD) else null
|
|
899
1298
|
)
|
|
900
1299
|
}
|
|
901
1300
|
}
|
|
@@ -925,6 +1324,20 @@ fun toTimeShift(map: ReadableMap): TimeShiftSetting {
|
|
|
925
1324
|
return timeShift
|
|
926
1325
|
}
|
|
927
1326
|
|
|
1327
|
+
fun toTopBottomCorrectionRotation(map: ReadableMap): TopBottomCorrectionRotation {
|
|
1328
|
+
val pitch = map.getDouble(KEY_TOP_BOTTOM_CORRECTION_ROTATION_PITCH)?.toFloat() ?: 0.0f
|
|
1329
|
+
val roll = map.getDouble(KEY_TOP_BOTTOM_CORRECTION_ROTATION_ROLL)?.toFloat() ?: 0.0f
|
|
1330
|
+
val yaw = map.getDouble(KEY_TOP_BOTTOM_CORRECTION_ROTATION_YAW)?.toFloat() ?: 0.0f
|
|
1331
|
+
return TopBottomCorrectionRotation(pitch = pitch, roll = roll, yaw = yaw)
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
fun toMobileNetworkSetting(map: ReadableMap): MobileNetworkSetting {
|
|
1335
|
+
return MobileNetworkSetting(
|
|
1336
|
+
roaming = map.getString("roaming")?.let { RoamingEnum.valueOf(it) },
|
|
1337
|
+
plan = map.getString("plan")?.let { PlanEnum.valueOf(it) }
|
|
1338
|
+
)
|
|
1339
|
+
}
|
|
1340
|
+
|
|
928
1341
|
fun configToTheta(objects: ReadableMap): Config {
|
|
929
1342
|
val config = Config()
|
|
930
1343
|
config.dateTime = objects.getString("dateTime")
|
|
@@ -958,8 +1371,8 @@ fun digestAuthToTheta(objects: ReadableMap): DigestAuth? {
|
|
|
958
1371
|
val username = objects.getString("username") ?: run {
|
|
959
1372
|
return null
|
|
960
1373
|
}
|
|
961
|
-
val password = if (objects.hasKey(
|
|
962
|
-
objects.getString(
|
|
1374
|
+
val password = if (objects.hasKey(KEY_PASSWORD)) {
|
|
1375
|
+
objects.getString(KEY_PASSWORD)
|
|
963
1376
|
} else {
|
|
964
1377
|
null
|
|
965
1378
|
}
|
|
@@ -994,6 +1407,26 @@ fun toOffDelay(objects: ReadableMap): OffDelay? {
|
|
|
994
1407
|
return null
|
|
995
1408
|
}
|
|
996
1409
|
|
|
1410
|
+
fun toOffDelayUsb(objects: ReadableMap): OffDelayUsb? {
|
|
1411
|
+
if (!objects.hasKey("offDelayUsb")) {
|
|
1412
|
+
return null
|
|
1413
|
+
}
|
|
1414
|
+
when (objects.getType("offDelayUsb")) {
|
|
1415
|
+
ReadableType.String -> {
|
|
1416
|
+
(objects.getString("offDelayUsb"))?.let { value ->
|
|
1417
|
+
return getOptionValueEnum(OptionNameEnum.OffDelayUsb, value) as? OffDelayUsbEnum
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
ReadableType.Number -> {
|
|
1422
|
+
return OffDelayUsbSec(objects.getInt("offDelayUsb"))
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
else -> {}
|
|
1426
|
+
}
|
|
1427
|
+
return null
|
|
1428
|
+
}
|
|
1429
|
+
|
|
997
1430
|
fun toSleepDelay(objects: ReadableMap): SleepDelay? {
|
|
998
1431
|
if (!objects.hasKey("sleepDelay")) {
|
|
999
1432
|
return null
|
|
@@ -1013,3 +1446,70 @@ fun toSleepDelay(objects: ReadableMap): SleepDelay? {
|
|
|
1013
1446
|
}
|
|
1014
1447
|
return null
|
|
1015
1448
|
}
|
|
1449
|
+
|
|
1450
|
+
data class SetAccessPointParams(
|
|
1451
|
+
val ssid: String,
|
|
1452
|
+
val ssidStealth: Boolean?,
|
|
1453
|
+
val authMode: AuthModeEnum,
|
|
1454
|
+
val password: String?,
|
|
1455
|
+
val connectionPriority: Int?,
|
|
1456
|
+
val dns1: String?,
|
|
1457
|
+
val dns2: String?,
|
|
1458
|
+
val proxy: Proxy?,
|
|
1459
|
+
)
|
|
1460
|
+
|
|
1461
|
+
fun toSetAccessPointParams(objects: ReadableMap): SetAccessPointParams {
|
|
1462
|
+
val ssid = objects.getString(KEY_SSID) ?: throw IllegalArgumentException(KEY_SSID)
|
|
1463
|
+
val ssidStealth = if (objects.hasKey(KEY_SSID_STEALTH)) {
|
|
1464
|
+
objects.getBoolean(KEY_SSID_STEALTH)
|
|
1465
|
+
} else {
|
|
1466
|
+
null
|
|
1467
|
+
}
|
|
1468
|
+
val authMode = objects.getString(KEY_AUTH_MODE)?.let { AuthModeEnum.valueOf(it) }
|
|
1469
|
+
?: throw IllegalArgumentException(KEY_AUTH_MODE)
|
|
1470
|
+
val password = objects.getString(KEY_PASSWORD)
|
|
1471
|
+
val connectionPriority = if (objects.hasKey(KEY_CONNECTION_PRIORITY)) {
|
|
1472
|
+
objects.getInt(KEY_CONNECTION_PRIORITY)
|
|
1473
|
+
} else {
|
|
1474
|
+
null
|
|
1475
|
+
}
|
|
1476
|
+
val dns1 = objects.getString(KEY_DNS1)
|
|
1477
|
+
val dns2 = objects.getString(KEY_DNS2)
|
|
1478
|
+
val proxy = if (objects.hasKey(KEY_PROXY)) toProxy(objects.getMap(KEY_PROXY)) else null
|
|
1479
|
+
|
|
1480
|
+
return SetAccessPointParams(
|
|
1481
|
+
ssid = ssid,
|
|
1482
|
+
ssidStealth = ssidStealth,
|
|
1483
|
+
authMode = authMode,
|
|
1484
|
+
password = password,
|
|
1485
|
+
connectionPriority = connectionPriority,
|
|
1486
|
+
dns1 = dns1,
|
|
1487
|
+
dns2 = dns2,
|
|
1488
|
+
proxy = proxy,
|
|
1489
|
+
)
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
data class SetAccessPointStaticallyParams(
|
|
1493
|
+
val ipAddress: String,
|
|
1494
|
+
val subnetMask: String,
|
|
1495
|
+
val defaultGateway: String,
|
|
1496
|
+
)
|
|
1497
|
+
|
|
1498
|
+
fun toSetAccessPointStaticallyParams(objects: ReadableMap): SetAccessPointStaticallyParams {
|
|
1499
|
+
val ipAddress = objects.getString(KEY_IP_ADDRESS) ?: throw IllegalArgumentException(KEY_IP_ADDRESS)
|
|
1500
|
+
val subnetMask = objects.getString(KEY_SUBNET_MASK) ?: throw IllegalArgumentException(KEY_SUBNET_MASK)
|
|
1501
|
+
val defaultGateway = objects.getString(KEY_DEFAULT_GATEWAY) ?: throw IllegalArgumentException(KEY_DEFAULT_GATEWAY)
|
|
1502
|
+
|
|
1503
|
+
return SetAccessPointStaticallyParams(
|
|
1504
|
+
ipAddress = ipAddress,
|
|
1505
|
+
subnetMask = subnetMask,
|
|
1506
|
+
defaultGateway = defaultGateway,
|
|
1507
|
+
)
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
fun toWlanFrequencyClMode(objects: ReadableMap): WlanFrequencyClMode {
|
|
1511
|
+
val enable2_4 = objects.getBoolean(KEY_WLAN_FREQUENCY_CL_MODE_2_4)
|
|
1512
|
+
val enable5_2 = objects.getBoolean(KEY_WLAN_FREQUENCY_CL_MODE_5_2)
|
|
1513
|
+
val enable5_8 = objects.getBoolean(KEY_WLAN_FREQUENCY_CL_MODE_5_8)
|
|
1514
|
+
return WlanFrequencyClMode(enable2_4 = enable2_4, enable5_2 = enable5_2, enable5_8 = enable5_8)
|
|
1515
|
+
}
|