Steven Moreland | 08484f8 | 2016-10-14 12:27:48 -0700 | [diff] [blame] | 1 | #include "Light.h" |
| 2 | |
| 3 | namespace android { |
| 4 | namespace hardware { |
| 5 | namespace example { |
| 6 | namespace extension { |
| 7 | namespace light { |
| 8 | namespace V2_0 { |
| 9 | namespace implementation { |
| 10 | |
| 11 | // Methods from ::android::hardware::light::V2_0::ILight follow. |
| 12 | Return<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 | |
| 26 | Return<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. |
| 40 | Return<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 |