diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h index 3b01fe28218296..5d65540781b2da 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h @@ -18,15 +18,17 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + extern NSString * const kCHIPToolDefaultsDomain; extern NSString * const kNetworkSSIDDefaultsKey; extern NSString * const kNetworkPasswordDefaultsKey; extern NSString * const kFabricIdKey; -CHIPDeviceController * InitializeCHIP(void); -CHIPDeviceController * CHIPRestartController(CHIPDeviceController * controller); -id CHIPGetDomainValueForKey(NSString * domain, NSString * key); -BOOL CHIPSetDomainValueForKey(NSString * domain, NSString * key, id value); +CHIPDeviceController * _Nullable InitializeCHIP(void); +CHIPDeviceController * _Nullable CHIPRestartController(CHIPDeviceController * controller); +id _Nullable CHIPGetDomainValueForKey(NSString * domain, NSString * key); +BOOL CHIPSetDomainValueForKey(NSString * domain, NSString * key, id _Nullable value); void CHIPRemoveDomainValueForKey(NSString * domain, NSString * key); uint64_t CHIPGetNextAvailableDeviceID(void); NSString * KeyForPairedDevice(uint64_t id); @@ -37,12 +39,10 @@ BOOL CHIPIsDevicePaired(uint64_t id); BOOL CHIPGetConnectedDevice(CHIPDeviceConnectionCallback completionHandler); BOOL CHIPGetConnectedDeviceWithID(uint64_t deviceId, CHIPDeviceConnectionCallback completionHandler); void CHIPUnpairDeviceWithID(uint64_t deviceId); -CHIPDevice * CHIPGetDeviceBeingCommissioned(void); - -NS_ASSUME_NONNULL_BEGIN +CHIPDevice * _Nullable CHIPGetDeviceBeingCommissioned(void); @interface CHIPToolPersistentStorageDelegate : NSObject -- (NSData *)storageDataForKey:(NSString *)key; +- (nullable NSData *)storageDataForKey:(NSString *)key; - (BOOL)setStorageData:(NSData *)value forKey:(NSString *)key; - (BOOL)removeStorageDataForKey:(NSString *)key; @end diff --git a/src/darwin/Framework/CHIPTests/CHIPTestStorage.h b/src/darwin/Framework/CHIPTests/CHIPTestStorage.h index d1d70ebf141a6a..0ea9951d970371 100644 --- a/src/darwin/Framework/CHIPTests/CHIPTestStorage.h +++ b/src/darwin/Framework/CHIPTests/CHIPTestStorage.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestStorage : NSObject -- (NSData *)storageDataForKey:(NSString *)key; +- (nullable NSData *)storageDataForKey:(NSString *)key; - (BOOL)setStorageData:(NSData *)value forKey:(NSString *)key; - (BOOL)removeStorageDataForKey:(NSString *)key; @end diff --git a/src/darwin/Framework/CHIPTests/CHIPTestStorage.m b/src/darwin/Framework/CHIPTests/CHIPTestStorage.m index dc9b3ad1b7d4cb..45afe1d916f2bc 100644 --- a/src/darwin/Framework/CHIPTests/CHIPTestStorage.m +++ b/src/darwin/Framework/CHIPTests/CHIPTestStorage.m @@ -22,7 +22,7 @@ @interface CHIPTestStorage () @implementation CHIPTestStorage -- (NSData *)storageDataForKey:(NSString *)key +- (nullable NSData *)storageDataForKey:(NSString *)key { return _values[key]; }