blob: 231f2b24f6fd818ecfc9518467f9f652edea4c9c [file] [log] [blame]
Pavel Maltseve2603e32016-10-25 16:03:23 -07001/*
2 * Copyright (C) 2016 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
17#ifndef android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_
18#define android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_
19
20#include <VehicleHal.h>
21#include <impl/DefaultConfig.h>
22#include <utils/SystemClock.h>
23
24namespace android {
25namespace hardware {
26namespace vehicle {
27namespace V2_0 {
28
29namespace impl {
30
31class DefaultVehicleHal : public VehicleHal {
32public:
33 std::vector<VehiclePropConfig> listProperties() override {
34 return std::vector<VehiclePropConfig>(std::begin(kVehicleProperties),
35 std::end(kVehicleProperties));
36 }
37
Pavel Maltsevdb179c52016-10-27 15:43:06 -070038 VehiclePropValuePtr get(const VehiclePropValue& requestedPropValue,
39 StatusCode* outStatus) override;
Pavel Maltseve2603e32016-10-25 16:03:23 -070040
Pavel Maltsevdb179c52016-10-27 15:43:06 -070041 StatusCode set(const VehiclePropValue& propValue) override;
Pavel Maltseve2603e32016-10-25 16:03:23 -070042
Pavel Maltsevdb179c52016-10-27 15:43:06 -070043 StatusCode subscribe(VehicleProperty property,
Pavel Maltseve2603e32016-10-25 16:03:23 -070044 int32_t areas,
45 float sampleRate) {
46 // TODO(pavelm): implement
Pavel Maltsevdb179c52016-10-27 15:43:06 -070047 return StatusCode::OK;
Pavel Maltseve2603e32016-10-25 16:03:23 -070048 }
49
Pavel Maltsevdb179c52016-10-27 15:43:06 -070050 StatusCode unsubscribe(VehicleProperty property) {
Pavel Maltseve2603e32016-10-25 16:03:23 -070051 // TODO(pavelm): implement
Pavel Maltsevdb179c52016-10-27 15:43:06 -070052 return StatusCode::OK;
Pavel Maltseve2603e32016-10-25 16:03:23 -070053 }
54
55private:
Pavel Maltsev30c84c32016-11-14 16:23:36 -080056 StatusCode getHvacTemperature(int32_t areaId, float* outValue);
57 StatusCode setHvacTemperature(int32_t areaId, float value);
58 StatusCode getHvacDefroster(int32_t areaId, bool* outValue);
59 StatusCode setHvacDefroster(int32_t areaId, bool value);
Pavel Maltseve2603e32016-10-25 16:03:23 -070060private:
Pavel Maltsev30c84c32016-11-14 16:23:36 -080061 int32_t mFanSpeed = 3;
62 int32_t mBrightness = 7;
63 float mRow1LeftHvacTemperatureSet = 16;
64 float mRow1RightHvacTemperatureSet = 22;
65 bool mFrontDefroster = false;
66 bool mRearDefroster = false;
67 bool mHvacPowerOn = true;
68 bool mHvacRecircOn = true;
69 bool mHvacAcOn = true;
70 bool mHvacAutoOn = true;
71 VehicleHvacFanDirection mFanDirection = VehicleHvacFanDirection::FACE;
Pavel Maltseve2603e32016-10-25 16:03:23 -070072};
73
74} // impl
75
76} // namespace V2_0
77} // namespace vehicle
78} // namespace hardware
79} // namespace android
80
81
82#endif // android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_