blob: 8851461de18aa0abe513cd78cf1db8135f4fb048 [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
Steven Moreland81f5da92016-09-30 16:32:24 -070045 Return<Status> setLight(Type type, const LightState& state) override;
46 Return<void> getSupportedTypes(getSupportedTypes_cb _hidl_cb) override;
47
Steven Morelandb0c20e92017-12-20 14:50:53 -080048 Return<void> debug(const hidl_handle& handle, const hidl_vec<hidl_string>& options) override;
49
50 private:
Steven Moreland81f5da92016-09-30 16:32:24 -070051 std::map<Type, light_device_t*> mLights;
52};
53
54extern "C" ILight* HIDL_FETCH_ILight(const char* name);
55
56} // namespace implementation
57} // namespace V2_0
58} // namespace light
59} // namespace hardware
60} // namespace android
61
Steven Morelandd6e4f032016-11-28 18:37:07 -080062#endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H