blob: b01c9637f56743e696e8ffba8fc1b23f5b417c2a [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 Maltsev8e624b32017-02-01 16:30:25 -080043 StatusCode subscribe(int32_t /*property*/,
44 int32_t /*areas*/,
45 float /*sampleRate*/) override {
Pavel Maltseve2603e32016-10-25 16:03:23 -070046 // TODO(pavelm): implement
Pavel Maltsevdb179c52016-10-27 15:43:06 -070047 return StatusCode::OK;
Pavel Maltseve2603e32016-10-25 16:03:23 -070048 }
49
Pavel Maltsev8e624b32017-02-01 16:30:25 -080050 StatusCode unsubscribe(int32_t /*property*/) override {
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);
Enrico Granata4dcdf002017-01-11 11:47:37 -080060 StatusCode fillObd2LiveFrame (VehiclePropValuePtr* v);
61 StatusCode fillObd2FreezeFrame (VehiclePropValuePtr* v);
Pavel Maltseve2603e32016-10-25 16:03:23 -070062private:
Pavel Maltsev30c84c32016-11-14 16:23:36 -080063 int32_t mFanSpeed = 3;
64 int32_t mBrightness = 7;
65 float mRow1LeftHvacTemperatureSet = 16;
66 float mRow1RightHvacTemperatureSet = 22;
67 bool mFrontDefroster = false;
68 bool mRearDefroster = false;
69 bool mHvacPowerOn = true;
70 bool mHvacRecircOn = true;
71 bool mHvacAcOn = true;
72 bool mHvacAutoOn = true;
73 VehicleHvacFanDirection mFanDirection = VehicleHvacFanDirection::FACE;
Pavel Maltseve2603e32016-10-25 16:03:23 -070074};
75
76} // impl
77
78} // namespace V2_0
79} // namespace vehicle
80} // namespace hardware
81} // namespace android
82
83
84#endif // android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_