1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef MECHBODY_CONTROLLER_MECHBODY_CONTROLLER_ENUMS_H 17 #define MECHBODY_CONTROLLER_MECHBODY_CONTROLLER_ENUMS_H 18 19 namespace OHOS { 20 namespace MechBodyController { 21 22 constexpr uint8_t MC_CONFIG_VERSION = 0x00; 23 24 constexpr uint16_t CMD_TYPE_BUTTON_EVENT_NOTIFY = 0x0240; 25 constexpr uint16_t CMD_TYPE_PARAM_NOTIFY = 0x0241; 26 constexpr uint16_t CMD_TYPE_ATTITUDE_NOTIFY = 0x0242; 27 constexpr uint16_t CMD_TYPE_EXE_RESULT_NOTIFY = 0x0243; 28 constexpr uint16_t CMD_TYPE_WHEEL_DATA_NOTIFY = 0x0244; 29 constexpr uint16_t CMD_TYPE_TRACKING_ENABLED_NOTIFY = 0x0245; 30 31 constexpr uint8_t BIT_0 = 0x00; 32 constexpr uint8_t BIT_1 = 0x01; 33 constexpr uint8_t BIT_2 = 0x02; 34 constexpr uint8_t BIT_3 = 0x03; 35 constexpr uint8_t BIT_5 = 0x05; 36 constexpr size_t BIT_OFFSET_1 = 1; 37 constexpr size_t BIT_OFFSET_2 = 2; 38 constexpr size_t BIT_OFFSET_3 = 3; 39 constexpr size_t BIT_OFFSET_4 = 4; 40 constexpr size_t BIT_OFFSET_7 = 7; 41 constexpr size_t BIT_OFFSET_8 = 8; 42 constexpr size_t BIT_OFFSET_10 = 10; 43 constexpr size_t BIT_OFFSET_13 = 13; 44 constexpr float FLOAT_EPSILON = 0.01f; 45 constexpr int32_t CMD_PRIORITY_HIGH = 5; 46 constexpr int32_t CMD_PRIORITY_MIDDLE = 3; 47 constexpr int32_t CMD_PRIORITY_LOW = 0; 48 49 constexpr int32_t DECIMAL_SCALE = 10; 50 51 enum class ProtocolCmdType : uint8_t { 52 REQ = 0b0000, 53 RSP = 0b0001, 54 RPT = 0b0010 55 }; 56 57 enum class OptType : uint8_t { 58 PUT = 0x00, 59 GET = 0x01, 60 REPORT = 0x02 61 }; 62 63 enum class CameraType : uint8_t { 64 FRONT = 0x01, 65 BACK = 0x02, 66 OTHER = 0x03 67 }; 68 69 enum class ConfidenceLevel : uint8_t { 70 HIGH = 0x01, 71 MEDIUM = 0x02, 72 LOW = 0x03, 73 LOST = 0x04 74 }; 75 76 enum class CameraKeyEvent : int32_t { 77 INVALID = -1, 78 START_FILMING = 0, 79 SWITCH_CAMERA = 1, 80 ZOOM_IN = 2, 81 ZOOM_OUT = 3, 82 SWITCH_PHOTO_FILM = 4, 83 SWITCH_TRACKING = 5, 84 }; 85 86 enum class MechMode : uint8_t { 87 FOLLOW = 0, 88 PITCH_FREE = 1, 89 FPV = 2, 90 ROLL = 3, 91 FREE = 4, 92 INVALID = 0xFF, 93 }; 94 95 enum class Operation : int32_t { 96 CONNECT = 0, 97 DISCONNECT = 1 98 }; 99 100 enum class TrackingEvent : int32_t { 101 CAMERA_TRACKING_USER_DISABLED = 0, 102 CAMERA_TRACKING_USER_ENABLED = 1, 103 CAMERA_TRACKING_LAYOUT_CHANGED = 2 104 }; 105 106 enum class ExecResult : int32_t { 107 COMPLETED = 0, 108 INTERRUPTED = 1, 109 LIMITED = 2, 110 TIMEOUT = 3, 111 SYSTEM_ERROR = 100 112 }; 113 114 enum class MechType : int32_t { 115 PORTABLE_GIMBAL = 0 116 }; 117 118 enum class AttachmentState : int32_t { 119 ATTACHED = 0, 120 DETACHED = 1 121 }; 122 123 enum class CameraTrackingLayout : int32_t { 124 DEFAULT = 0, 125 LEFT = 1, 126 MIDDLE = 2, 127 RIGHT = 3 128 }; 129 130 enum class MovingStatus : int32_t { 131 STILL = 0, 132 MOVING = 1, 133 LIMIT = 2 134 }; 135 136 enum class RotationAxisLimited : uint32_t { 137 NOT_LIMITED = 0, 138 NEG_LIMITED = 1, 139 POS_LIMITED = 2, 140 }; 141 142 enum class PresetAction : int32_t { 143 NOD = 0, 144 }; 145 146 enum class MobileRotation : int32_t { 147 INVALID = -1, 148 UP = 0, 149 RIGHT = 90, 150 DOWN = 180, 151 LEFT = 270, 152 }; 153 154 enum class MechTrackingStatus : uint8_t { 155 MECH_TK_DISABLE = 0, 156 MECH_TK_ENABLE_NO_TARGET = 1, 157 MECH_TK_ENABLE_WITH_TARGET = 2, 158 }; 159 } // namespace MechBodyController 160 } // namespace OHOS 161 #endif // MECHBODY_CONTROLLER_MECHBODY_CONTROLLER_ENUMS_H 162