|
| 1 | +/* |
| 2 | + * If not stated otherwise in this file or this component's LICENSE file the |
| 3 | + * following copyright and licenses apply: |
| 4 | + * |
| 5 | + * Copyright 2024 RDK Management |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +#pragma once |
| 21 | + |
| 22 | +#include "Module.h" |
| 23 | +#include <vector> |
| 24 | + |
| 25 | +// @stubgen:include <com/IIteratorType.h> |
| 26 | + |
| 27 | +namespace WPEFramework |
| 28 | +{ |
| 29 | + namespace Exchange |
| 30 | + { |
| 31 | + // @json @text:keep |
| 32 | + struct EXTERNAL IFrontPanel : virtual public Core::IUnknown { |
| 33 | + enum { ID = ID_FRONT_PANEL }; |
| 34 | + |
| 35 | + |
| 36 | + struct EXTERNAL FrontPanelSuccess { |
| 37 | + bool success; |
| 38 | + }; |
| 39 | + |
| 40 | + using IFrontPanelLightsListIterator = RPC::IIteratorType<string, ID_FRONT_PANEL_LIGHTS_LIST_ITERATOR>; |
| 41 | + |
| 42 | + // @json:omit |
| 43 | + virtual Core::hresult Configure(PluginHost::IShell* service) = 0; |
| 44 | + |
| 45 | + // @brief Gets the status of the Front Panel |
| 46 | + // @text getBrightness |
| 47 | + // @param index: Index of the brightness level |
| 48 | + // @param brightness: Brightness level |
| 49 | + // @param success: Is the operation successful or not |
| 50 | + virtual Core::hresult GetBrightness(const string& index, uint32_t &brightness /* @out */, bool &success /* @out */) = 0; |
| 51 | + |
| 52 | + // @brief Gets the front panel lights |
| 53 | + // @text getFrontPanelLights |
| 54 | + // @param supportedLights: List of supported front panel lights |
| 55 | + // @param supportedLightsInfo: Information about the supported front panel lights |
| 56 | + // @param success: Is the operation successful or not |
| 57 | + virtual Core::hresult GetFrontPanelLights(IFrontPanelLightsListIterator*& supportedLights /* @out */, string &supportedLightsInfo /* @out @opaque */, bool &success /* @out */) = 0; |
| 58 | + |
| 59 | + // @brief Switches the specified LED off |
| 60 | + // @text powerLedOff |
| 61 | + // @param index: Index of the LED to switch off |
| 62 | + // @param success: Is the operation successful or not |
| 63 | + virtual Core::hresult PowerLedOff(const string& index, FrontPanelSuccess &success /* @out */) = 0; |
| 64 | + |
| 65 | + // @brief Switches the specified LED on |
| 66 | + // @text powerLedOn |
| 67 | + // @param index: Index of the LED to switch on |
| 68 | + // @param success: Is the operation successful or not |
| 69 | + virtual Core::hresult PowerLedOn(const string& index, FrontPanelSuccess &success /* @out */) = 0; |
| 70 | + |
| 71 | + // @brief Sets a blink pattern for the specified LED. The blinkInfo parameter is a JSON string containing: ledIndicator (string) |
| 72 | + // @text setBlink |
| 73 | + // @param blinkInfo: JSON string with blink pattern information containing ledIndicator, iterations, and pattern array with brightness, duration(milliseconds), and optional color and red/green/blue values. |
| 74 | + // @param success: Is the operation successful or not |
| 75 | + virtual Core::hresult SetBlink(const string& blinkInfo /* @opaque */, FrontPanelSuccess &success /* @out */) = 0; |
| 76 | + |
| 77 | + // @brief Sets the brightness of the specified LED |
| 78 | + // @text setBrightness |
| 79 | + // @param index: Index of the brightness level |
| 80 | + // @param brightness: Brightness level to set |
| 81 | + // @param success: Is the operation successful or not |
| 82 | + virtual Core::hresult SetBrightness(const string& index, const uint32_t brightness, FrontPanelSuccess &success /* @out */) = 0; |
| 83 | + |
| 84 | + // @brief Sets the LED with the specified color and brightness |
| 85 | + // @text setLED |
| 86 | + // @param ledIndicator: LED indicator to set |
| 87 | + // @param brightness: Brightness level of the LED |
| 88 | + // @param color: Color of the LED |
| 89 | + // @param red: Red component of the LED color |
| 90 | + // @param green: Green component of the LED color |
| 91 | + // @param blue: Blue component of the LED color |
| 92 | + // @param success: Is the operation successful or not |
| 93 | + virtual Core::hresult SetLED(const string& ledIndicator, const uint32_t brightness, const string& color, const uint32_t red, const uint32_t green, const uint32_t blue, FrontPanelSuccess &success /* @out */) = 0; |
| 94 | + |
| 95 | + }; |
| 96 | +} // namespace Exchange |
| 97 | +} // namespace WPEFramework |
0 commit comments