@@ -50,14 +50,18 @@ class GenericOperationalStateDelegateImpl : public Delegate
50
50
CHIP_ERROR GetOperationalStateAtIndex (size_t index, GenericOperationalState & operationalState) override ;
51
51
52
52
/* *
53
- * Fills in the provided GenericOperationalPhase with the phase at index `index` if there is one,
53
+ * Fills in the provided MutableCharSpan with the phase at index `index` if there is one,
54
54
* or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases.
55
+ *
56
+ * If CHIP_ERROR_NOT_FOUND is returned for index 0, that indicates that the PhaseList attribute is null
57
+ * (there are no phases defined at all).
58
+ *
55
59
* Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the
56
60
* device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed.
57
61
* @param index The index of the phase, with 0 representing the first phase.
58
- * @param operationalPhase The GenericOperationalPhase is filled.
62
+ * @param operationalPhase The MutableCharSpan is filled.
59
63
*/
60
- CHIP_ERROR GetOperationalPhaseAtIndex (size_t index, GenericOperationalPhase & operationalPhase) override ;
64
+ CHIP_ERROR GetOperationalPhaseAtIndex (size_t index, MutableCharSpan & operationalPhase) override ;
61
65
62
66
// command callback
63
67
/* *
@@ -86,7 +90,7 @@ class GenericOperationalStateDelegateImpl : public Delegate
86
90
87
91
protected:
88
92
Span<const GenericOperationalState> mOperationalStateList ;
89
- Span<const GenericOperationalPhase > mOperationalPhaseList ;
93
+ Span<const CharSpan > mOperationalPhaseList ;
90
94
};
91
95
92
96
// This is an application level delegate to handle operational state commands according to the specific business logic.
@@ -100,16 +104,10 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl
100
104
GenericOperationalState (to_underlying (OperationalStateEnum::kError )),
101
105
};
102
106
103
- const GenericOperationalPhase opPhaseList[1 ] = {
104
- // Phase List is null
105
- GenericOperationalPhase (DataModel::Nullable<CharSpan>()),
106
- };
107
-
108
107
public:
109
108
OperationalStateDelegate ()
110
109
{
111
110
GenericOperationalStateDelegateImpl::mOperationalStateList = Span<const GenericOperationalState>(opStateList);
112
- GenericOperationalStateDelegateImpl::mOperationalPhaseList = Span<const GenericOperationalPhase>(opPhaseList);
113
111
}
114
112
};
115
113
@@ -134,18 +132,11 @@ class RvcOperationalStateDelegate : public OperationalState::GenericOperationalS
134
132
OperationalState::GenericOperationalState (to_underlying (Clusters::RvcOperationalState::OperationalStateEnum::kDocked )),
135
133
};
136
134
137
- const OperationalState::GenericOperationalPhase rvcOpPhaseList[1 ] = {
138
- // Phase List is null
139
- OperationalState::GenericOperationalPhase (DataModel::Nullable<CharSpan>()),
140
- };
141
-
142
135
public:
143
136
RvcOperationalStateDelegate ()
144
137
{
145
138
GenericOperationalStateDelegateImpl::mOperationalStateList =
146
139
Span<const OperationalState::GenericOperationalState>(rvcOpStateList);
147
- GenericOperationalStateDelegateImpl::mOperationalPhaseList =
148
- Span<const OperationalState::GenericOperationalPhase>(rvcOpPhaseList);
149
140
}
150
141
};
151
142
0 commit comments