1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at 6c5e268c6Sopenharmony_ci * 7c5e268c6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c5e268c6Sopenharmony_ci * 9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and 13c5e268c6Sopenharmony_ci * limitations under the License. 14c5e268c6Sopenharmony_ci */ 15c5e268c6Sopenharmony_ci 16c5e268c6Sopenharmony_ci/** 17c5e268c6Sopenharmony_ci * @addtogroup Motion 18c5e268c6Sopenharmony_ci * @{ 19c5e268c6Sopenharmony_ci * 20c5e268c6Sopenharmony_ci * @brief Provides common APIs for hardware services to access the motion driver module. 21c5e268c6Sopenharmony_ci * 22c5e268c6Sopenharmony_ci * A service can obtain a motion driver object or agent and then call APIs provided by this object or agent to 23c5e268c6Sopenharmony_ci * enable or disable motion and subscribe to or unsubscribe from motion data. 24c5e268c6Sopenharmony_ci * 25c5e268c6Sopenharmony_ci * @since 4.0 26c5e268c6Sopenharmony_ci */ 27c5e268c6Sopenharmony_ci 28c5e268c6Sopenharmony_ci/** 29c5e268c6Sopenharmony_ci * @file IMotionInterface.idl 30c5e268c6Sopenharmony_ci * 31c5e268c6Sopenharmony_ci * @brief Defines the APIs for enabling or disabling motion and subscribing to or unsubscribing from motion data. 32c5e268c6Sopenharmony_ci * 33c5e268c6Sopenharmony_ci * The APIs defined here can be called to implement various motion features, such as pickup, flipping, shaking, and screen rotation. 34c5e268c6Sopenharmony_ci * 35c5e268c6Sopenharmony_ci * @since 4.0 36c5e268c6Sopenharmony_ci * @version 1.1 37c5e268c6Sopenharmony_ci */ 38c5e268c6Sopenharmony_ci 39c5e268c6Sopenharmony_ci/** 40c5e268c6Sopenharmony_ci * @brief Defines the package path of the motion driver module APIs. 41c5e268c6Sopenharmony_ci * 42c5e268c6Sopenharmony_ci * @since 4.0 43c5e268c6Sopenharmony_ci */ 44c5e268c6Sopenharmony_cipackage ohos.hdi.motion.v1_1; 45c5e268c6Sopenharmony_ci 46c5e268c6Sopenharmony_ciimport ohos.hdi.motion.v1_0.MotionTypes; 47c5e268c6Sopenharmony_ciimport ohos.hdi.motion.v1_0.IMotionCallback; 48c5e268c6Sopenharmony_ciimport ohos.hdi.motion.v1_0.IMotionInterface; 49c5e268c6Sopenharmony_ciimport ohos.hdi.motion.v1_1.MotionTypes; 50c5e268c6Sopenharmony_ci 51c5e268c6Sopenharmony_ci/** 52c5e268c6Sopenharmony_ci * @brief Defines the APIs for performing basic operations on motion devices. 53c5e268c6Sopenharmony_ci * 54c5e268c6Sopenharmony_ci * The APIs can be used to enable or disable motion and subscribe to or unsubscribe from motion data. 55c5e268c6Sopenharmony_ci */ 56c5e268c6Sopenharmony_ciinterface IMotionInterface extends ohos.hdi.motion.v1_0.IMotionInterface { 57c5e268c6Sopenharmony_ci /** 58c5e268c6Sopenharmony_ci * @brief Sets motion config information. 59c5e268c6Sopenharmony_ci * 60c5e268c6Sopenharmony_ci * @param motionType Motion type. For details, see {@link HdfMotionTypeTag}. 61c5e268c6Sopenharmony_ci * @param data Motion wave config parameters for a trick. For details, see {@link WaveParam}. 62c5e268c6Sopenharmony_ci * 63c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 64c5e268c6Sopenharmony_ci * @return Returns a negative value if the operation fails. 65c5e268c6Sopenharmony_ci * 66c5e268c6Sopenharmony_ci * @since 4.0 67c5e268c6Sopenharmony_ci * @version 1.1 68c5e268c6Sopenharmony_ci */ 69c5e268c6Sopenharmony_ci SetMotionConfig([in] int motionType, [in] unsigned char[] data); 70c5e268c6Sopenharmony_ci} 71c5e268c6Sopenharmony_ci/** @} */