1 /* 2 * Copyright (c) 2021-2023 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 I_MISCDEVICE_SERVICE_H 17 #define I_MISCDEVICE_SERVICE_H 18 19 #include <string> 20 #include <vector> 21 22 #include "iremote_broker.h" 23 24 #include "light_agent_type.h" 25 #include "miscdevice_common.h" 26 #include "raw_file_descriptor.h" 27 #include "sensors_ipc_interface_code.h" 28 29 namespace OHOS { 30 namespace Sensors { 31 class IMiscdeviceService : public IRemoteBroker { 32 public: 33 IMiscdeviceService() = default; 34 virtual ~IMiscdeviceService() = default; 35 DECLARE_INTERFACE_DESCRIPTOR(u"IMiscdeviceService"); 36 virtual int32_t Vibrate(int32_t vibratorId, int32_t timeOut, int32_t usage) = 0; 37 virtual int32_t PlayVibratorEffect(int32_t vibratorId, const std::string &effect, 38 int32_t loopCount, int32_t usage) = 0; 39 #ifdef OHOS_BUILD_ENABLE_VIBRATOR_CUSTOM 40 virtual int32_t PlayVibratorCustom(int32_t vibratorId, const RawFileDescriptor &rawFd, int32_t usage) = 0; 41 #endif // OHOS_BUILD_ENABLE_VIBRATOR_CUSTOM 42 virtual int32_t StopVibrator(int32_t vibratorId) = 0; 43 virtual int32_t StopVibrator(int32_t vibratorId, const std::string &mode) = 0; 44 virtual int32_t IsSupportEffect(const std::string &effect, bool &state) = 0; 45 virtual std::vector<LightInfo> GetLightList() = 0; 46 virtual int32_t TurnOn(int32_t lightId, const LightColor &color, const LightAnimation &animation) = 0; 47 virtual int32_t TurnOff(int32_t lightId) = 0; 48 }; 49 } // namespace Sensors 50 } // namespace OHOS 51 #endif // I_MISCDEVICE_SERVICE_H 52