File tree 12 files changed +22
-59
lines changed
zigbee-matter-light/silabs
12 files changed +22
-59
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,11 @@ class AppTask : public BaseApplication
75
75
private:
76
76
static AppTask sAppTask ;
77
77
/* *
78
- * @brief AppTask initialisation function
78
+ * @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
79
79
*
80
80
* @return CHIP_ERROR
81
81
*/
82
- CHIP_ERROR Init () ;
82
+ CHIP_ERROR AppInit () override ;
83
83
84
84
/* *
85
85
* @brief PB0 Button event processing function
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ static EnergyReportingTestEventTriggerHandler sEnergyReportingTestEventTriggerHa
60
60
static DeviceEnergyManagementTestEventTriggerHandler sDeviceEnergyManagementTestEventTriggerHandler ;
61
61
#endif
62
62
63
- CHIP_ERROR AppTask::Init ()
63
+ CHIP_ERROR AppTask::AppInit ()
64
64
{
65
65
CHIP_ERROR err = CHIP_NO_ERROR;
66
66
chip::DeviceLayer::Silabs::GetPlatform ().SetButtonsCb (AppTask::ButtonEventHandler);
@@ -69,13 +69,6 @@ CHIP_ERROR AppTask::Init()
69
69
GetLCD ().Init ((uint8_t *) " Dishwasher-App" );
70
70
#endif
71
71
72
- err = BaseApplication::Init ();
73
- if (err != CHIP_NO_ERROR)
74
- {
75
- SILABS_LOG (" BaseApplication::Init() failed" );
76
- appError (err);
77
- }
78
-
79
72
PlatformMgr ().LockChipStack ();
80
73
err = DeviceEnergyManager::Instance ().Init ();
81
74
PlatformMgr ().UnlockChipStack ();
Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ class AppTask : public BaseApplication
81
81
82
82
private:
83
83
/* *
84
- * @brief AppTask initialisation function
84
+ * @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
85
85
*
86
86
* @return CHIP_ERROR
87
87
*/
88
- CHIP_ERROR Init () ;
88
+ CHIP_ERROR AppInit () override ;
89
89
90
90
static AppTask sAppTask ;
91
91
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ using namespace chip::app::Clusters;
65
65
66
66
AppTask AppTask::sAppTask ;
67
67
68
- CHIP_ERROR AppTask::Init ()
68
+ CHIP_ERROR AppTask::AppInit ()
69
69
{
70
70
CHIP_ERROR err = CHIP_NO_ERROR;
71
71
chip::DeviceLayer::Silabs::GetPlatform ().SetButtonsCb (AppTask::ButtonEventHandler);
@@ -75,13 +75,6 @@ CHIP_ERROR AppTask::Init()
75
75
GetLCD ().SetCustomUI (FanControlUI::DrawUI);
76
76
#endif
77
77
78
- err = BaseApplication::Init ();
79
- if (err != CHIP_NO_ERROR)
80
- {
81
- ChipLogError (AppServer, " BaseApplication::Init() failed" );
82
- appError (err);
83
- }
84
-
85
78
err = FanControlMgr ().Init ();
86
79
if (err != CHIP_NO_ERROR)
87
80
{
Original file line number Diff line number Diff line change @@ -121,11 +121,11 @@ class AppTask : public BaseApplication
121
121
};
122
122
123
123
/* *
124
- * @brief AppTask initialisation function
124
+ * @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
125
125
*
126
126
* @return CHIP_ERROR
127
127
*/
128
- CHIP_ERROR Init () ;
128
+ CHIP_ERROR AppInit () override ;
129
129
130
130
#ifdef DISPLAY_ENABLED
131
131
/* *
Original file line number Diff line number Diff line change @@ -58,21 +58,14 @@ constexpr uint8_t kOccupancyLedId = 0;
58
58
59
59
AppTask AppTask::sAppTask ;
60
60
61
- CHIP_ERROR AppTask::Init ()
61
+ CHIP_ERROR AppTask::AppInit ()
62
62
{
63
63
CHIP_ERROR err = CHIP_NO_ERROR;
64
64
GetPlatform ().SetButtonsCb (AppTask::ButtonEventHandler);
65
65
#ifdef DISPLAY_ENABLED
66
66
GetLCD ().Init ((uint8_t *) SENSOR_NAME);
67
67
#endif
68
68
69
- err = BaseApplication::Init ();
70
- if (err != CHIP_NO_ERROR)
71
- {
72
- ChipLogError (AppServer, " BaseApplication::Init() failed" );
73
- appError (err);
74
- }
75
-
76
69
sOccupancyLed .Init (kOccupancyLedId );
77
70
sOccupancyLed .Set (false );
78
71
Original file line number Diff line number Diff line change @@ -84,11 +84,11 @@ class AppTask : public BaseApplication
84
84
static void UpdateClusterState (intptr_t context);
85
85
86
86
/* *
87
- * @brief AppTask initialisation function
87
+ * @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
88
88
*
89
89
* @return CHIP_ERROR
90
90
*/
91
- CHIP_ERROR Init () ;
91
+ CHIP_ERROR AppInit () override ;
92
92
93
93
static void TimerEventHandler (TimerHandle_t xTimer);
94
94
};
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ using namespace ::chip::DeviceLayer;
62
62
63
63
AppTask AppTask::sAppTask ;
64
64
65
- CHIP_ERROR AppTask::Init ()
65
+ CHIP_ERROR AppTask::AppInit ()
66
66
{
67
67
CHIP_ERROR err = CHIP_NO_ERROR;
68
68
chip::DeviceLayer::Silabs::GetPlatform ().SetButtonsCb (AppTask::ButtonEventHandler);
@@ -71,13 +71,6 @@ CHIP_ERROR AppTask::Init()
71
71
GetLCD ().Init ((uint8_t *) " onoffPlug-App" );
72
72
#endif
73
73
74
- err = BaseApplication::Init ();
75
- if (err != CHIP_NO_ERROR)
76
- {
77
- SILABS_LOG (" BaseApplication::Init() failed" );
78
- appError (err);
79
- }
80
-
81
74
err = PlugMgr ().Init ();
82
75
if (err != CHIP_NO_ERROR)
83
76
{
Original file line number Diff line number Diff line change @@ -52,7 +52,12 @@ class AppTask : public BaseApplication
52
52
private:
53
53
friend AppTask & GetAppTask (void );
54
54
55
- CHIP_ERROR Init ();
55
+ /* *
56
+ * @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
57
+ *
58
+ * @return CHIP_ERROR
59
+ */
60
+ CHIP_ERROR AppInit () override ;
56
61
static AppTask sAppTask ;
57
62
/* *
58
63
* @brief PB0 Button event processing function
Original file line number Diff line number Diff line change @@ -48,18 +48,11 @@ using namespace ::chip::DeviceLayer;
48
48
49
49
AppTask AppTask::sAppTask ;
50
50
51
- CHIP_ERROR AppTask::Init ()
51
+ CHIP_ERROR AppTask::AppInit ()
52
52
{
53
53
CHIP_ERROR err = CHIP_NO_ERROR;
54
54
chip::DeviceLayer::Silabs::GetPlatform ().SetButtonsCb (AppTask::ButtonEventHandler);
55
55
56
- err = BaseApplication::Init ();
57
- if (err != CHIP_NO_ERROR)
58
- {
59
- SILABS_LOG (" BaseApplication::Init() failed" );
60
- appError (err);
61
- }
62
-
63
56
return err;
64
57
}
65
58
Original file line number Diff line number Diff line change @@ -92,11 +92,11 @@ class AppTask : public BaseApplication
92
92
static void UpdateClusterState (intptr_t context);
93
93
94
94
/* *
95
- * @brief AppTask initialisation function
95
+ * @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
96
96
*
97
97
* @return CHIP_ERROR
98
98
*/
99
- CHIP_ERROR Init () ;
99
+ CHIP_ERROR AppInit () override ;
100
100
101
101
/* *
102
102
* @brief PB0 Button event processing function
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ using namespace ::chip::DeviceLayer;
94
94
95
95
AppTask AppTask::sAppTask ;
96
96
97
- CHIP_ERROR AppTask::Init ()
97
+ CHIP_ERROR AppTask::AppInit ()
98
98
{
99
99
CHIP_ERROR err = CHIP_NO_ERROR;
100
100
app::SetAttributePersistenceProvider (&gDeferredAttributePersister );
@@ -113,13 +113,6 @@ CHIP_ERROR AppTask::Init()
113
113
ChipLogProgress (AppServer, " Sequential CMP app" );
114
114
#endif
115
115
116
- err = BaseApplication::Init ();
117
- if (err != CHIP_NO_ERROR)
118
- {
119
- SILABS_LOG (" BaseApplication::Init() failed" );
120
- appError (err);
121
- }
122
-
123
116
err = LightMgr ().Init ();
124
117
if (err != CHIP_NO_ERROR)
125
118
{
You can’t perform that action at this time.
0 commit comments