1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.car.hal; 17 18 import android.car.hardware.hvac.CarHvacManager; 19 import android.hardware.automotive.vehicle.V2_0.VehicleProperty; 20 21 public class HvacHalService extends PropertyHalServiceBase { 22 private static final boolean DBG = false; 23 private static final String TAG = "HvacHalService"; 24 25 private final ManagerToHalPropIdMap mMgrHalPropIdMap = ManagerToHalPropIdMap.create( 26 CarHvacManager.ID_MIRROR_DEFROSTER_ON, VehicleProperty.HVAC_SIDE_MIRROR_HEAT, 27 28 CarHvacManager.ID_STEERING_WHEEL_TEMP, VehicleProperty.HVAC_STEERING_WHEEL_TEMP, 29 30 CarHvacManager.ID_OUTSIDE_AIR_TEMP, VehicleProperty.ENV_OUTSIDE_TEMPERATURE, 31 32 CarHvacManager.ID_TEMPERATURE_UNITS, VehicleProperty.HVAC_TEMPERATURE_UNITS, 33 34 CarHvacManager.ID_ZONED_TEMP_SETPOINT, VehicleProperty.HVAC_TEMPERATURE_SET, 35 36 CarHvacManager.ID_ZONED_TEMP_ACTUAL, VehicleProperty.HVAC_TEMPERATURE_CURRENT, 37 38 CarHvacManager.ID_ZONED_FAN_SPEED_SETPOINT, VehicleProperty.HVAC_FAN_SPEED, 39 40 CarHvacManager.ID_ZONED_FAN_SPEED_RPM, VehicleProperty.HVAC_ACTUAL_FAN_SPEED_RPM, 41 42 CarHvacManager.ID_ZONED_FAN_POSITION_AVAILABLE, 43 VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE, 44 45 CarHvacManager.ID_ZONED_FAN_POSITION, VehicleProperty.HVAC_FAN_DIRECTION, 46 47 CarHvacManager.ID_ZONED_SEAT_TEMP, VehicleProperty.HVAC_SEAT_TEMPERATURE, 48 49 CarHvacManager.ID_ZONED_AC_ON, VehicleProperty.HVAC_AC_ON, 50 51 CarHvacManager.ID_ZONED_AUTOMATIC_MODE_ON, VehicleProperty.HVAC_AUTO_ON, 52 53 CarHvacManager.ID_ZONED_AIR_RECIRCULATION_ON,VehicleProperty.HVAC_RECIRC_ON, 54 55 CarHvacManager.ID_ZONED_MAX_AC_ON, VehicleProperty.HVAC_MAX_AC_ON, 56 57 CarHvacManager.ID_ZONED_DUAL_ZONE_ON, VehicleProperty.HVAC_DUAL_ON, 58 59 CarHvacManager.ID_ZONED_MAX_DEFROST_ON, VehicleProperty.HVAC_MAX_DEFROST_ON, 60 61 CarHvacManager.ID_ZONED_HVAC_POWER_ON, VehicleProperty.HVAC_POWER_ON, 62 63 CarHvacManager.ID_WINDOW_DEFROSTER_ON, VehicleProperty.HVAC_DEFROSTER 64 ); 65 HvacHalService(VehicleHal vehicleHal)66 public HvacHalService(VehicleHal vehicleHal) { 67 super(vehicleHal, TAG, DBG); 68 } 69 70 // Convert the HVAC public API property ID to HAL property ID 71 @Override managerToHalPropId(int hvacPropId)72 protected int managerToHalPropId(int hvacPropId) { 73 return mMgrHalPropIdMap.getHalPropId(hvacPropId); 74 } 75 76 // Convert he HAL specific property ID to HVAC public API 77 @Override halToManagerPropId(int halPropId)78 protected int halToManagerPropId(int halPropId) { 79 return mMgrHalPropIdMap.getManagerPropId(halPropId); 80 } 81 } 82