1 /* 2 * Copyright (c) 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 OHOS_HDI_SENSOR_V1_1_ISENSORCALLBACK_VDI_H 17 #define OHOS_HDI_SENSOR_V1_1_ISENSORCALLBACK_VDI_H 18 19 #include <stdint.h> 20 #include <vector> 21 #include <hdf_base.h> 22 #include <hdi_base.h> 23 #include "iremote_object.h" 24 #include "v2_0/sensor_types.h" 25 26 namespace OHOS { 27 namespace HDI { 28 namespace Sensor { 29 namespace V1_1 { 30 31 struct HdfSensorEventsVdi { 32 int32_t sensorId; 33 int32_t version; 34 int64_t timestamp; 35 uint32_t option; 36 int32_t mode; 37 std::vector<uint8_t> data; 38 uint32_t dataLen; 39 }; 40 41 class ISensorCallbackVdi : public HdiBase { 42 public: 43 virtual ~ISensorCallbackVdi() = default; 44 virtual int32_t OnDataEventVdi(const HdfSensorEventsVdi& eventVdi) = 0; 45 virtual int32_t OnDataEvent(const V2_0::HdfSensorEvents& event) = 0; 46 virtual sptr<IRemoteObject> HandleCallbackDeath() = 0; 47 }; 48 49 } // V1_1 50 } // Sensor 51 } // HDI 52 } // OHOS 53 54 #endif // OHOS_HDI_SENSOR_V1_1_ISENSORCALLBACK_VDI_H 55