File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -2164,4 +2164,17 @@ CHIP_ERROR FabricTable::SetFabricIndexForNextAddition(FabricIndex fabricIndex)
2164
2164
return CHIP_NO_ERROR;
2165
2165
}
2166
2166
2167
+ CHIP_ERROR FabricTable::SetShouldAdvertiseIdentity (FabricIndex fabricIndex, AdvertiseIdentity advertiseIdentity)
2168
+ {
2169
+ VerifyOrReturnError (IsValidFabricIndex (fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX);
2170
+
2171
+ FabricInfo * fabricInfo = GetMutableFabricByIndex (fabricIndex);
2172
+ bool fabricIsInitialized = (fabricInfo != nullptr ) && fabricInfo->IsInitialized ();
2173
+ VerifyOrReturnError (fabricIsInitialized, CHIP_ERROR_INVALID_FABRIC_INDEX);
2174
+
2175
+ fabricInfo->SetShouldAdvertiseIdentity (advertiseIdentity == AdvertiseIdentity::Yes);
2176
+
2177
+ return CHIP_NO_ERROR;
2178
+ }
2179
+
2167
2180
} // namespace chip
Original file line number Diff line number Diff line change @@ -212,6 +212,8 @@ class DLL_EXPORT FabricInfo
212
212
mNodeId = kUndefinedNodeId ;
213
213
}
214
214
215
+ void SetShouldAdvertiseIdentity (bool advertiseIdentity) { mShouldAdvertiseIdentity = advertiseIdentity; }
216
+
215
217
static constexpr size_t MetadataTLVMaxSize ()
216
218
{
217
219
return TLV::EstimateStructOverhead (sizeof (uint16_t ), kFabricLabelMaxLengthInBytes );
@@ -1027,6 +1029,18 @@ class DLL_EXPORT FabricTable
1027
1029
*/
1028
1030
CHIP_ERROR SetFabricIndexForNextAddition (FabricIndex fabricIndex);
1029
1031
1032
+ /* *
1033
+ * @brief Set the advertising behavior for the fabric identified by `fabricIndex`.
1034
+ *
1035
+ * It is the caller's responsibility to actually restart DNS-SD advertising
1036
+ * as needed after updating this state.
1037
+ *
1038
+ * @param fabricIndex - Fabric Index for which to set the label
1039
+ * @param advertiseIdentity - whether the identity for this fabric should be advertised.
1040
+ * @retval CHIP_ERROR_INVALID_FABRIC_INDEX if fabricIndex does not refer to a fabric in the table
1041
+ */
1042
+ CHIP_ERROR SetShouldAdvertiseIdentity (FabricIndex fabricIndex, AdvertiseIdentity advertiseIdentity);
1043
+
1030
1044
private:
1031
1045
enum class StateFlags : uint16_t
1032
1046
{
You can’t perform that action at this time.
0 commit comments