blob: 7d0b7cbf84c769d5a7ec77c7fdb9a525350e83bd [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
38 VehiclePropValuePtr get(VehicleProperty property,
39 int32_t areaId,
40 status_t* outStatus) override;
41
42 status_t set(const VehiclePropValue& propValue) override;
43
44 status_t subscribe(VehicleProperty property,
45 int32_t areas,
46 float sampleRate) {
47 // TODO(pavelm): implement
48 return OK;
49 }
50
51 status_t unsubscribe(VehicleProperty property) {
52 // TODO(pavelm): implement
53 return OK;
54 }
55
56private:
57 status_t getHvacFanSpeed(int32_t areaId, int32_t* outValue);
58 status_t setHvacFanSpeed(int32_t areaId, int32_t value);
59private:
60 int32_t fanSpeedRow1Left = 3;
61 int32_t fanSpeedRow1Right = 5;
62 int32_t brightness = 7;
63};
64
65} // impl
66
67} // namespace V2_0
68} // namespace vehicle
69} // namespace hardware
70} // namespace android
71
72
73#endif // android_hardware_vehicle_V2_0_impl_DefaultVehicleHal_H_