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 25 namespace OHOS { 26 namespace HDI { 27 namespace Sensor { 28 namespace V1_1 { 29 30 struct HdfSensorEventsVdi { 31 int32_t sensorId; 32 int32_t version; 33 int64_t timestamp; 34 uint32_t option; 35 int32_t mode; 36 std::vector<uint8_t> data; 37 uint32_t dataLen; 38 }; 39 40 class ISensorCallbackVdi : public HdiBase { 41 public: 42 virtual ~ISensorCallbackVdi() = default; 43 virtual int32_t OnDataEventVdi(const HdfSensorEventsVdi& eventVdi) = 0; 44 virtual sptr<IRemoteObject> HandleCallbackDeath() = 0; 45 }; 46 47 } // V1_1 48 } // Sensor 49 } // HDI 50 } // OHOS 51 52 #endif // OHOS_HDI_SENSOR_V1_1_ISENSORCALLBACK_VDI_H 53