15
15
* limitations under the License.
16
16
*/
17
17
18
- #include < app/util/config.h>
19
18
#include < app-common/zap-generated/attributes/Accessors.h>
19
+ #include < app/util/config.h>
20
20
#include < map>
21
21
22
22
#ifdef MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
@@ -27,7 +27,7 @@ using namespace chip;
27
27
using namespace chip ::app::Clusters::MediaInput;
28
28
using Protocols::InteractionModel::Status;
29
29
30
- MediaInputManager::MediaInputManager (chip::EndpointId endpoint): mEndpoint(endpoint)
30
+ MediaInputManager::MediaInputManager (chip::EndpointId endpoint) : mEndpoint(endpoint)
31
31
{
32
32
struct InputData inputData1 (1 , chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi , " HDMI 1" ,
33
33
" High-Definition Multimedia Interface" );
@@ -42,7 +42,8 @@ MediaInputManager::MediaInputManager(chip::EndpointId endpoint):mEndpoint(endpoi
42
42
// Sync the attributes from attribute storage
43
43
Status status = Attributes::CurrentInput::Get (endpoint, &mCurrentInput );
44
44
45
- if (Status::Success != status) {
45
+ if (Status::Success != status)
46
+ {
46
47
ChipLogError (Zcl, " Unable to save CurrentInput attribute, err:0x%x" , to_underlying (status));
47
48
mCurrentInput = 1 ;
48
49
}
@@ -66,7 +67,8 @@ uint8_t MediaInputManager::HandleGetCurrentInput()
66
67
67
68
bool MediaInputManager::HandleSelectInput (const uint8_t index)
68
69
{
69
- if (mCurrentInput == index ) {
70
+ if (mCurrentInput == index )
71
+ {
70
72
ChipLogProgress (Zcl, " CurrentInput is same as new value: %u" , index );
71
73
return true ;
72
74
}
@@ -77,7 +79,8 @@ bool MediaInputManager::HandleSelectInput(const uint8_t index)
77
79
mCurrentInput = index ;
78
80
// Sync the CurrentInput to attribute storage while reporting changes
79
81
Status status = chip::app::Clusters::MediaInput::Attributes::CurrentInput::Set (mEndpoint , index );
80
- if (Status::Success != status) {
82
+ if (Status::Success != status)
83
+ {
81
84
ChipLogError (Zcl, " CurrentInput is not stored successfully, err:0x%x" , to_underlying (status));
82
85
}
83
86
return true ;
@@ -128,6 +131,5 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint)
128
131
gMediaInputManagerInstance [endpoint] = std::make_unique<MediaInputManager>(endpoint);
129
132
130
133
chip::app::Clusters::MediaInput::SetDefaultDelegate (endpoint, gMediaInputManagerInstance [endpoint].get ());
131
-
132
134
}
133
135
#endif // MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
0 commit comments