Skip to content

Commit 4073848

Browse files
authored
Merge branch 'master' into update_docker_imgs_for_sysconfig_1_18_1
2 parents adfd955 + f7db85e commit 4073848

File tree

16 files changed

+160
-95
lines changed

16 files changed

+160
-95
lines changed

.github/workflows/darwin.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ jobs:
3636
matrix:
3737
options: # We don't need a full matrix
3838
- flavor: macos-release-availability
39-
arguments: -sdk macosx -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
39+
arguments: -sdk macosx -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new'
4040
- flavor: ios-release
41-
arguments: -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
41+
arguments: -sdk iphoneos -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4242
- flavor: ios-debug
43-
arguments: -sdk iphoneos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
43+
arguments: -sdk iphoneos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4444
- flavor: tvos-debug
45-
arguments: -sdk appletvos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
45+
arguments: -sdk appletvos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4646
- flavor: watchos-debug
47-
arguments: -sdk watchos -configuration Debug OTHER_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
47+
arguments: -sdk watchos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
4848
steps:
4949
- name: Checkout
5050
uses: actions/checkout@v4

examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj

+4-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
3C9437942B3B47A10096E5F4 /* MCErrorUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C9437932B3B47A10096E5F4 /* MCErrorUtils.mm */; };
6161
3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
6262
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8735286A555500771BAD /* libTvCastingCommon.a */; };
63-
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CCB8736286A555500771BAD /* libmbedtls.a */; settings = {ATTRIBUTES = (Required, ); }; };
6463
3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB8739286A593700771BAD /* DiscoveredNodeData.mm */; };
6564
3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873A286A593700771BAD /* CastingServerBridge.h */; };
6665
3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB873B286A593700771BAD /* DiscoveredNodeData.h */; };
@@ -151,7 +150,6 @@
151150
3CCB871D2869085400771BAD /* MatterTvCastingBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MatterTvCastingBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
152151
3CCB87202869085400771BAD /* MatterTvCastingBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterTvCastingBridge.h; sourceTree = "<group>"; };
153152
3CCB8735286A555500771BAD /* libTvCastingCommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTvCastingCommon.a; path = lib/libTvCastingCommon.a; sourceTree = BUILT_PRODUCTS_DIR; };
154-
3CCB8736286A555500771BAD /* libmbedtls.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmbedtls.a; path = lib/libmbedtls.a; sourceTree = BUILT_PRODUCTS_DIR; };
155153
3CCB8739286A593700771BAD /* DiscoveredNodeData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiscoveredNodeData.mm; sourceTree = "<group>"; };
156154
3CCB873A286A593700771BAD /* CastingServerBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CastingServerBridge.h; sourceTree = "<group>"; };
157155
3CCB873B286A593700771BAD /* DiscoveredNodeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiscoveredNodeData.h; sourceTree = "<group>"; };
@@ -183,7 +181,6 @@
183181
buildActionMask = 2147483647;
184182
files = (
185183
3CCB8737286A555500771BAD /* libTvCastingCommon.a in Frameworks */,
186-
3CCB8738286A555500771BAD /* libmbedtls.a in Frameworks */,
187184
);
188185
runOnlyForDeploymentPostprocessing = 0;
189186
};
@@ -233,7 +230,6 @@
233230
isa = PBXGroup;
234231
children = (
235232
3CCB871F2869085400771BAD /* MatterTvCastingBridge */,
236-
3CCB8736286A555500771BAD /* libmbedtls.a */,
237233
3CCB8735286A555500771BAD /* libTvCastingCommon.a */,
238234
3CCB871E2869085400771BAD /* Products */,
239235
);
@@ -556,7 +552,6 @@
556552
DEBUG_INFORMATION_FORMAT = dwarf;
557553
ENABLE_STRICT_OBJC_MSGSEND = YES;
558554
ENABLE_TESTABILITY = YES;
559-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
560555
GCC_C_LANGUAGE_STANDARD = gnu11;
561556
GCC_DYNAMIC_NO_PIC = NO;
562557
GCC_NO_COMMON_BLOCKS = YES;
@@ -644,6 +639,10 @@
644639
3CCB87252869085400771BAD /* Debug */ = {
645640
isa = XCBuildConfiguration;
646641
buildSettings = {
642+
"ARCHS[sdk=iphonesimulator*]" = (
643+
arm64,
644+
x86_64,
645+
);
647646
CHIP_ROOT = "$(PROJECT_DIR)/../../../..";
648647
CODE_SIGN_STYLE = Automatic;
649648
COPY_PHASE_STRIP = NO;

examples/tv-casting-app/darwin/MatterTvCastingBridge/chip_xcode_build_connector.sh

+20-22
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,31 @@ for define in "${defines[@]}"; do
6060
done
6161
target_defines=[${target_defines:1}]
6262

63+
declare target_arch=
6364
declare target_cpu=
64-
case $PLATFORM_PREFERRED_ARCH in
65-
i386)
66-
target_cpu=x86
67-
;;
68-
x86_64)
69-
target_cpu=x64
70-
;;
71-
armv7)
72-
target_cpu=arm
73-
;;
74-
arm64)
75-
target_cpu=arm64
76-
;;
77-
*)
78-
echo >&2
79-
;;
80-
esac
81-
82-
declare target_cflags='"-target","'"$PLATFORM_PREFERRED_ARCH"'-'"$LLVM_TARGET_TRIPLE_VENDOR"'-'"$LLVM_TARGET_TRIPLE_OS_VERSION"'"'
65+
declare target_cflags=
66+
declare current_arch="$(uname -m)"
8367

8468
read -r -a archs <<<"$ARCHS"
85-
8669
for arch in "${archs[@]}"; do
87-
target_cflags+=',"-arch","'"$arch"'"'
70+
if [ -z "$target_arch" ] || [ "$arch" = "$current_arch" ]; then
71+
target_arch="$arch"
72+
case "$arch" in
73+
x86_64) target_cpu="x64" ;;
74+
*) target_cpu="$arch" ;;
75+
esac
76+
fi
77+
if [ -n "$target_cflags" ]; then
78+
target_cflags+=','
79+
fi
80+
target_cflags+='"-arch","'"$arch"'"'
8881
done
8982

9083
[[ $ENABLE_BITCODE == YES ]] && {
91-
target_cflags+=',"-flto"'
84+
if [ -n "$target_cflags" ]; then
85+
target_cflags+=','
86+
fi
87+
target_cflags+='"-flto"'
9288
}
9389

9490
target_cflags+=',"-fno-c++-static-destructors"'
@@ -101,6 +97,8 @@ declare -a args=(
10197
'target_cpu="'"$target_cpu"'"'
10298
'target_defines='"$target_defines"
10399
'target_cflags=['"$target_cflags"']'
100+
"mac_target_arch=\"$target_arch\""
101+
"mac_deployment_target=\"$LLVM_TARGET_TRIPLE_OS_VERSION$LLVM_TARGET_TRIPLE_SUFFIX\""
104102
'build_tv_casting_common_a=true'
105103
)
106104

examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@
340340
DEBUG_INFORMATION_FORMAT = dwarf;
341341
ENABLE_STRICT_OBJC_MSGSEND = YES;
342342
ENABLE_TESTABILITY = YES;
343-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
344343
GCC_C_LANGUAGE_STANDARD = gnu11;
345344
GCC_DYNAMIC_NO_PIC = NO;
346345
GCC_NO_COMMON_BLOCKS = YES;
@@ -426,6 +425,10 @@
426425
3CC0E9052841DD3500EC6A18 /* Debug */ = {
427426
isa = XCBuildConfiguration;
428427
buildSettings = {
428+
"ARCHS[sdk=iphonesimulator*]" = (
429+
arm64,
430+
x86_64,
431+
);
429432
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
430433
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
431434
CLANG_ENABLE_MODULES = YES;
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
44 : [TI] Update Sysconfig Version to 1.18.1
1+
45 : [TI] Update Sysconfig Version to 1.18.1
2+

integrations/docker/images/stage-2/chip-build-telink/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN set -x \
1212
&& : # last line
1313

1414
# Setup Zephyr
15-
ARG ZEPHYR_REVISION=c4dd151a1ffa96bfbd577ddc88a55c5785279514
15+
ARG ZEPHYR_REVISION=65dc1812431bf946dfc110682298acf83d63e27a
1616
WORKDIR /opt/telink/zephyrproject
1717
RUN set -x \
1818
&& python3 -m pip install -U --no-cache-dir west \

scripts/build/builders/efr32.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def __init__(self,
230230
['git', 'describe', '--always', '--dirty', '--exclude', '*']).decode('ascii').strip()
231231
branchName = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('ascii').strip()
232232
self.extra_gn_options.append(
233-
'sl_matter_version_str="v1.2-%s-%s"' % (branchName, shortCommitSha))
233+
'sl_matter_version_str="v1.3-%s-%s"' % (branchName, shortCommitSha))
234234
if enable_917_soc:
235235
if use_rps_extension is False:
236236
self.extra_gn_options.append('use_rps_extension=false')

scripts/examples/gn_silabs_example.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ else
303303
{
304304
ShortCommitSha=$(git describe --always --dirty --exclude '*')
305305
branchName=$(git rev-parse --abbrev-ref HEAD)
306-
optArgs+="sl_matter_version_str=\"v1.2-$branchName-$ShortCommitSha\" "
306+
optArgs+="sl_matter_version_str=\"v1.3-$branchName-$ShortCommitSha\" "
307307
} &>/dev/null
308308
fi
309309

src/app/reporting/Engine.cpp

+17-4
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,16 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu
204204
pathForRetrieval, &encodeState);
205205
if (err != CHIP_NO_ERROR)
206206
{
207-
ChipLogError(DataManagement,
208-
"Error retrieving data from clusterId: " ChipLogFormatMEI ", err = %" CHIP_ERROR_FORMAT,
209-
ChipLogValueMEI(pathForRetrieval.mClusterId), err.Format());
210-
211207
// If error is not an "out of writer space" error, rollback and encode status.
212208
// Otherwise, if partial data allowed, save the encode state.
213209
// Otherwise roll back. If we have already encoded some chunks, we are done; otherwise encode status.
214210

215211
if (encodeState.AllowPartialData() && IsOutOfWriterSpaceError(err))
216212
{
213+
ChipLogDetail(DataManagement,
214+
"List does not fit in packet, chunk between list items for clusterId: " ChipLogFormatMEI
215+
", attributeId: " ChipLogFormatMEI,
216+
ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId));
217217
// Encoding is aborted but partial data is allowed, then we don't rollback and save the state for next chunk.
218218
// The expectation is that RetrieveClusterData has already reset attributeReportIBs to a good state (rolled
219219
// back any partially-written AttributeReportIB instances, reset its error status). Since AllowPartialData()
@@ -230,6 +230,11 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu
230230

231231
if (!IsOutOfWriterSpaceError(err))
232232
{
233+
ChipLogError(DataManagement,
234+
"Fail to retrieve data, roll back and encode status on clusterId: " ChipLogFormatMEI
235+
", attributeId: " ChipLogFormatMEI "err = %" CHIP_ERROR_FORMAT,
236+
ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId),
237+
err.Format());
233238
// Try to encode our error as a status response.
234239
err = attributeReportIBs.EncodeAttributeStatus(pathForRetrieval, StatusIB(err));
235240
if (err != CHIP_NO_ERROR)
@@ -239,6 +244,14 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu
239244
attributeReportIBs.Rollback(attributeBackup);
240245
}
241246
}
247+
else
248+
{
249+
ChipLogDetail(DataManagement,
250+
"Next attribute value does not fit in packet, roll back on clusterId: " ChipLogFormatMEI
251+
", attributeId: " ChipLogFormatMEI ", err = %" CHIP_ERROR_FORMAT,
252+
ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId),
253+
err.Format());
254+
}
242255
}
243256
}
244257
SuccessOrExit(err);

src/darwin/Framework/CHIP/MTRDevice.mm

+35-10
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
NSString * const MTRPreviousDataKey = @"previousData";
5353
NSString * const MTRDataVersionKey = @"dataVersion";
5454

55-
#define kTimeToWaitBeforeMarkingUnreachableAfterSettingUpSubscription 10
55+
#define kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription 10
5656

5757
// Consider moving utility classes to their own file
5858
#pragma mark - Utility Classes
@@ -129,11 +129,31 @@ - (id)strongObject
129129

130130
#pragma mark - MTRDevice
131131
typedef NS_ENUM(NSUInteger, MTRInternalDeviceState) {
132+
// Unsubscribed means we do not have a subscription and are not trying to set one up.
132133
MTRInternalDeviceStateUnsubscribed = 0,
134+
// Subscribing means we are actively trying to establish our initial subscription (e.g. doing
135+
// DNS-SD discovery, trying to establish CASE to the peer, getting priming reports, etc).
133136
MTRInternalDeviceStateSubscribing = 1,
134-
MTRInternalDeviceStateSubscribed = 2
137+
// InitialSubscriptionEstablished means we have at some point finished setting up a
138+
// subscription. That subscription may have dropped since then, but if so it's the ReadClient's
139+
// responsibility to re-establish it.
140+
MTRInternalDeviceStateInitalSubscriptionEstablished = 2,
135141
};
136142

143+
// Utility methods for working with MTRInternalDeviceState, located near the
144+
// enum so it's easier to notice that they need to stay in sync.
145+
namespace {
146+
bool HadSubscriptionEstablishedOnce(MTRInternalDeviceState state)
147+
{
148+
return state >= MTRInternalDeviceStateInitalSubscriptionEstablished;
149+
}
150+
151+
bool NeedToStartSubscriptionSetup(MTRInternalDeviceState state)
152+
{
153+
return state <= MTRInternalDeviceStateUnsubscribed;
154+
}
155+
} // anonymous namespace
156+
137157
typedef NS_ENUM(NSUInteger, MTRDeviceExpectedValueFieldIndex) {
138158
MTRDeviceExpectedValueFieldExpirationTimeIndex = 0,
139159
MTRDeviceExpectedValueFieldValueIndex = 1,
@@ -283,6 +303,7 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle
283303
_expectedValueCache = [NSMutableDictionary dictionary];
284304
_asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self];
285305
_state = MTRDeviceStateUnknown;
306+
_internalDeviceState = MTRInternalDeviceStateUnsubscribed;
286307
_clusterData = [NSMutableDictionary dictionary];
287308
MTR_LOG_INFO("%@ init with hex nodeID 0x%016llX", self, _nodeID.unsignedLongLongValue);
288309
}
@@ -576,6 +597,10 @@ - (void)invalidate
576597
// attempt, since we now have no delegate.
577598
_reattemptingSubscription = NO;
578599

600+
// We do not change _internalDeviceState here, because we might still have a
601+
// subscription. In that case, _internalDeviceState will update when the
602+
// subscription is actually terminated.
603+
579604
os_unfair_lock_unlock(&self->_lock);
580605
}
581606

@@ -678,7 +703,7 @@ - (void)_handleSubscriptionEstablished
678703

679704
// reset subscription attempt wait time when subscription succeeds
680705
_lastSubscriptionAttemptWait = 0;
681-
_internalDeviceState = MTRInternalDeviceStateSubscribed;
706+
_internalDeviceState = MTRInternalDeviceStateInitalSubscriptionEstablished;
682707

683708
// As subscription is established, check if the delegate needs to be informed
684709
if (!_delegateDeviceCachePrimedCalled) {
@@ -786,12 +811,13 @@ - (void)_handleUnsolicitedMessageFromPublisher
786811
[self _reattemptSubscriptionNowIfNeeded];
787812
}
788813

789-
- (void)_markDeviceAsUnreachableIfNotSusbcribed
814+
- (void)_markDeviceAsUnreachableIfNeverSubscribed
790815
{
791816
os_unfair_lock_assert_owner(&self->_lock);
792817

793-
if (_internalDeviceState >= MTRInternalDeviceStateSubscribed)
818+
if (HadSubscriptionEstablishedOnce(_internalDeviceState)) {
794819
return;
820+
}
795821

796822
MTR_LOG_DEFAULT("%@ still not subscribed, marking the device as unreachable", self);
797823
[self _changeState:MTRDeviceStateUnreachable];
@@ -1025,20 +1051,19 @@ - (void)_setupSubscription
10251051
#endif
10261052

10271053
// for now just subscribe once
1028-
if (_internalDeviceState > MTRInternalDeviceStateUnsubscribed) {
1054+
if (!NeedToStartSubscriptionSetup(_internalDeviceState)) {
10291055
return;
10301056
}
10311057

10321058
_internalDeviceState = MTRInternalDeviceStateSubscribing;
10331059

10341060
// Set up a timer to mark as not reachable if it takes too long to set up a subscription
10351061
MTRWeakReference<MTRDevice *> * weakSelf = [MTRWeakReference weakReferenceWithObject:self];
1036-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kTimeToWaitBeforeMarkingUnreachableAfterSettingUpSubscription * NSEC_PER_SEC)), self.queue, ^{
1062+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, static_cast<int64_t>(kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription) * static_cast<int64_t>(NSEC_PER_SEC)), self.queue, ^{
10371063
MTRDevice * strongSelf = weakSelf.strongObject;
10381064
if (strongSelf != nil) {
1039-
os_unfair_lock_lock(&strongSelf->_lock);
1040-
[strongSelf _markDeviceAsUnreachableIfNotSusbcribed];
1041-
os_unfair_lock_unlock(&strongSelf->_lock);
1065+
std::lock_guard lock(strongSelf->_lock);
1066+
[strongSelf _markDeviceAsUnreachableIfNeverSubscribed];
10421067
}
10431068
});
10441069

src/darwin/Framework/CHIP/MTRDeviceController.mm

-3
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,10 @@
8888
static NSString * const kErrorPairingInit = @"Init failure while creating a pairing delegate";
8989
static NSString * const kErrorPartialDacVerifierInit = @"Init failure while creating a partial DAC verifier";
9090
static NSString * const kErrorPairDevice = @"Failure while pairing the device";
91-
static NSString * const kErrorUnpairDevice = @"Failure while unpairing the device";
9291
static NSString * const kErrorStopPairing = @"Failure while trying to stop the pairing process";
9392
static NSString * const kErrorPreWarmCommissioning = @"Failure while trying to pre-warm the commissioning process";
9493
static NSString * const kErrorOpenPairingWindow = @"Open Pairing Window failed";
95-
static NSString * const kErrorGetPairedDevice = @"Failure while trying to retrieve a paired device";
9694
static NSString * const kErrorNotRunning = @"Controller is not running. Call startup first.";
97-
static NSString * const kInfoStackShutdown = @"Shutting down the Matter Stack";
9895
static NSString * const kErrorSetupCodeGen = @"Generating Manual Pairing Code failed";
9996
static NSString * const kErrorGenerateNOC = @"Generating operational certificate failed";
10097
static NSString * const kErrorKeyAllocation = @"Generating new operational key failed";

src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm

+8-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@
8484
static NSString * const kErrorSessionKeystoreInit = @"Init failure while initializing session keystore";
8585

8686
static bool sExitHandlerRegistered = false;
87-
static void ShutdownOnExit() { [[MTRDeviceControllerFactory sharedInstance] stopControllerFactory]; }
87+
static void ShutdownOnExit()
88+
{
89+
MTR_LOG_INFO("ShutdownOnExit invoked on exit");
90+
[[MTRDeviceControllerFactory sharedInstance] stopControllerFactory];
91+
}
8892

8993
@interface MTRDeviceControllerFactory () {
9094
MTRServerEndpoint * _otaProviderEndpoint;
@@ -323,6 +327,8 @@ - (void)cleanupInitObjects
323327

324328
- (void)cleanupStartupObjects
325329
{
330+
MTR_LOG_INFO("Cleaning startup objects in controller factory");
331+
326332
// Make sure the deinit order here is the reverse of the init order in
327333
// startControllerFactory:
328334
_certificationDeclarationCertificates = nil;
@@ -562,7 +568,7 @@ - (void)stopControllerFactory
562568
[_controllers[0] shutdown];
563569
}
564570

565-
MTR_LOG_DEBUG("Shutting down the Matter controller factory");
571+
MTR_LOG_INFO("Shutting down the Matter controller factory");
566572
_controllerFactory->Shutdown();
567573

568574
[self cleanupStartupObjects];

0 commit comments

Comments
 (0)