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 I_MISCDEVICE_SERVICE_H 17 #define I_MISCDEVICE_SERVICE_H 18 19 #include <string> 20 #include <vector> 21 22 #include "iremote_broker.h" 23 #include "light_agent_type.h" 24 #include "miscdevice_common.h" 25 26 namespace OHOS { 27 namespace Sensors { 28 class IMiscdeviceService : public IRemoteBroker { 29 public: 30 IMiscdeviceService() = default; 31 virtual ~IMiscdeviceService() = default; 32 DECLARE_INTERFACE_DESCRIPTOR(u"IMiscdeviceService"); 33 virtual int32_t Vibrate(int32_t vibratorId, int32_t timeOut, int32_t usage) = 0; 34 virtual int32_t CancelVibrator(int32_t vibratorId) = 0; 35 virtual int32_t PlayVibratorEffect(int32_t vibratorId, const std::string &effect, 36 int32_t loopCount, int32_t usage) = 0; 37 virtual int32_t StopVibratorEffect(int32_t vibratorId, const std::string &effect) = 0; 38 virtual std::vector<LightInfo> GetLightList() = 0; 39 virtual int32_t TurnOn(int32_t lightId, const LightColor &color, const LightAnimation &animation) = 0; 40 virtual int32_t TurnOff(int32_t lightId) = 0; 41 42 enum { 43 VIBRATE, 44 CANCEL_VIBRATOR, 45 PLAY_VIBRATOR_EFFECT, 46 STOP_VIBRATOR_EFFECT, 47 GET_LIGHT_LIST, 48 TURN_ON, 49 TURN_OFF, 50 }; 51 }; 52 } // namespace Sensors 53 } // namespace OHOS 54 #endif // I_MISCDEVICE_SERVICE_H 55