/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @addtogroup Motion * @{ * * @brief Provides common APIs for hardware services to access the motion driver module. * * A service can obtain a motion driver object or agent and then call APIs provided by this object or agent to * enable or disable motion and subscribe to or unsubscribe from motion data. * * @since 3.2 */ /** * @file IMotionCallback.idl * * @brief Defines the callback for reporting motion data. * * To subscribe to motion data, an instance of this callback must be registered. * * @since 3.2 * @version 1.0 */ /** * @brief Defines the package path of the motion driver module APIs. * * @since 3.2 */ package ohos.hdi.motion.v1_0; import ohos.hdi.motion.v1_0.MotionTypes; /** * @brief Defines the callback for reporting motion data. * * Motion users need to register this callback to subscribe to motion data and can receive the data only when motion is enabled. * For details, see {@link IMotionInterface}. * * @since 3.2 */ [callback] interface IMotionCallback { /** * @brief Called to report motion data. * * @param event Motion data to report. For details, see {@link HdfMotionEvent}. * * @return Returns 0 if the operation is successful. * @return Returns a negative value if the operation fails. * * @since 3.2 */ OnDataEvent([in] struct HdfMotionEvent event); } /** @} */