blob: 8987036f99fa07badeaea86280df46bec05c88ea [file] [log] [blame]
Steven Moreland9f8b5c72016-11-29 15:03:38 -08001/*
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 */
Steven Morelandd6e4f032016-11-28 18:37:07 -080016#ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
17#define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H
Steven Moreland81f5da92016-09-30 16:32:24 -070018
19#include <android/hardware/light/2.0/ILight.h>
20#include <hardware/hardware.h>
21#include <hardware/lights.h>
22#include <hidl/Status.h>
23#include <hidl/MQDescriptor.h>
24#include <map>
25
26namespace android {
27namespace hardware {
28namespace light {
29namespace V2_0 {
30namespace implementation {
31
32using ::android::hardware::light::V2_0::ILight;
33using ::android::hardware::light::V2_0::LightState;
34using ::android::hardware::light::V2_0::Status;
35using ::android::hardware::light::V2_0::Type;
36using ::android::hardware::Return;
37using ::android::hardware::Void;
38using ::android::hardware::hidl_vec;
39using ::android::hardware::hidl_string;
40using ::android::sp;
41
42struct Light : public ILight {
43 Light(std::map<Type, light_device_t*> &&lights);
44
45 // Methods from ::android::hardware::light::V2_0::ILight follow.
46 Return<Status> setLight(Type type, const LightState& state) override;
47 Return<void> getSupportedTypes(getSupportedTypes_cb _hidl_cb) override;
48
49private:
50 std::map<Type, light_device_t*> mLights;
51};
52
53extern "C" ILight* HIDL_FETCH_ILight(const char* name);
54
55} // namespace implementation
56} // namespace V2_0
57} // namespace light
58} // namespace hardware
59} // namespace android
60
Steven Morelandd6e4f032016-11-28 18:37:07 -080061#endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H