blob: d738a6d2a66785d7b3a6a002aaaf5f2e4f68b24f [file] [log] [blame]
Steven Moreland08484f82016-10-14 12:27:48 -07001#include "Light.h"
2
3namespace android {
4namespace hardware {
5namespace example {
6namespace extension {
7namespace light {
8namespace V2_0 {
9namespace implementation {
10
11// Methods from ::android::hardware::light::V2_0::ILight follow.
12Return<Status> Light::setLight(Type type, const LightState& state) {
13 // Forward types for new methods.
14
15 ExtLightState extState {
16 .state = state,
17 .interpolationOmega =
18 static_cast<int32_t>(Default::INTERPOLATION_OMEGA),
19 .brightness = // ExtBrightness inherits from Brightness
20 static_cast<ExtBrightness>(state.brightnessMode)
21 };
22
23 return setExtLight(type, extState);
24}
25
26Return<void> Light::getSupportedTypes(getSupportedTypes_cb _hidl_cb) {
27 // implement unchanged method as you would always
28 hidl_vec<Type> vec{};
29
30 // ******************************************************
31 // Note: awesome proprietary hardware implementation here
32 // ******************************************************
33
34 _hidl_cb(vec);
35
36 return Void();
37}
38
39// Methods from ::android::hardware::example::extension::light::V2_0::ILight follow.
40Return<Status> Light::setExtLight(Type /* type */,
41 const ExtLightState& /* state */) {
42
43 // ******************************************************
44 // Note: awesome proprietary hardware implementation here
45 // ******************************************************
46
47 return Status::SUCCESS;
48}
49
50} // namespace implementation
51} // namespace V2_0
52} // namespace light
53} // namespace extension
54} // namespace example
55} // namespace hardware
56} // namespace android