1 /* 2 * Copyright (c) 2021 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 MISCDEVICE_COMMON_H 17 #define MISCDEVICE_COMMON_H 18 19 #include "vibrator_agent_type.h" 20 21 namespace OHOS { 22 namespace Sensors { 23 // These LightId correspond to logical lights 24 enum LightId { 25 LIGHT_ID_LED = 0, 26 LIGHT_ID_KEYBOARD, 27 LIGHT_ID_BUTTONS, 28 LIGHT_ID_BELT, 29 30 UNKNOWN, 31 }; 32 33 // MISC device support id 34 enum class MiscdeviceDeviceId { LED = 0, VIBRATOR, UNKNOWN }; 35 36 constexpr int32_t THREADSLEEPTIME = 500; 37 38 typedef struct VibratorEffectParameter { 39 int32_t loopCount = 1; 40 int32_t usage = USAGE_UNKNOWN; 41 bool systemUsage = false; 42 uint32_t sessionId = 0; 43 VibratorParameter vibratorParameter; 44 }VibratorEffectParameter; 45 46 typedef struct PrimitiveEffect { 47 int32_t intensity = 0; 48 int32_t usage = 0; 49 bool systemUsage; 50 int32_t count = 0; 51 } PrimitiveEffect; 52 53 class MiscdeviceCommon { 54 public: 55 MiscdeviceCommon() = default; 56 ~MiscdeviceCommon() = default; 57 }; 58 } // namespace Sensors 59 } // namespace OHOS 60 #endif // MISCDEVICE_COMMON_H 61