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_THERMAL_V1_1_THERMALTYPES_H 17#define OHOS_HDI_THERMAL_V1_1_THERMALTYPES_H 18 19#include <cstdbool> 20#include <cstdint> 21#include <string> 22#include <vector> 23 24#ifndef HDI_BUFF_MAX_SIZE 25#define HDI_BUFF_MAX_SIZE (1024 * 200) 26#endif 27 28#ifndef HDI_CHECK_VALUE_RETURN 29#define HDI_CHECK_VALUE_RETURN(lv, compare, rv, ret) do { \ 30 if ((lv) compare (rv)) { \ 31 return ret; \ 32 } \ 33} while (false) 34#endif 35 36#ifndef HDI_CHECK_VALUE_RET_GOTO 37#define HDI_CHECK_VALUE_RET_GOTO(lv, compare, rv, ret, value, table) do { \ 38 if ((lv) compare (rv)) { \ 39 ret = value; \ 40 goto table; \ 41 } \ 42} while (false) 43#endif 44 45namespace OHOS { 46class MessageParcel; 47} 48 49namespace OHOS { 50namespace HDI { 51namespace Thermal { 52namespace V1_1 { 53 54using namespace OHOS; 55 56struct ThermalZoneInfo { 57 std::string type; 58 int32_t temp; 59}; 60 61struct HdfThermalCallbackInfo { 62 std::vector<OHOS::HDI::Thermal::V1_1::ThermalZoneInfo> info; 63}; 64 65bool ThermalZoneInfoBlockMarshalling(OHOS::MessageParcel &data, const OHOS::HDI::Thermal::V1_1::ThermalZoneInfo& dataBlock); 66 67bool ThermalZoneInfoBlockUnmarshalling(OHOS::MessageParcel &data, OHOS::HDI::Thermal::V1_1::ThermalZoneInfo& dataBlock); 68 69bool HdfThermalCallbackInfoBlockMarshalling(OHOS::MessageParcel &data, const OHOS::HDI::Thermal::V1_1::HdfThermalCallbackInfo& dataBlock); 70 71bool HdfThermalCallbackInfoBlockUnmarshalling(OHOS::MessageParcel &data, OHOS::HDI::Thermal::V1_1::HdfThermalCallbackInfo& dataBlock); 72 73} // V1_1 74} // Thermal 75} // HDI 76} // OHOS 77 78#endif // OHOS_HDI_THERMAL_V1_1_THERMALTYPES_H 79 80