Skip to content

Commit 4ef5153

Browse files
author
Mantosh Kumar
committed
Release 24Q2-Patch-1
- BLE IOP test enhancements. - Wi-Fi Dev kit sensor. - Bug fixes.
1 parent 2eb29a1 commit 4ef5153

File tree

105 files changed

+4881
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4881
-48
lines changed

Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def shared_pods
2424
pod 'RxSwift', '~> 6.2.0'
2525
pod 'RxCocoa', '~> 6.2.0'
2626
pod 'Introspect'
27+
pod 'CocoaLumberjack/Swift'
2728
end
2829

2930
def test_pods

Podfile.lock

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ PODS:
88
- Charts/Core (= 4.1.0)
99
- Charts/Core (4.1.0):
1010
- SwiftAlgorithms (~> 1.0)
11+
- CocoaLumberjack/Core (3.8.2)
12+
- CocoaLumberjack/Swift (3.8.2):
13+
- CocoaLumberjack/Core
1114
- Crashlytics (3.12.0):
1215
- Fabric (~> 1.9.0)
1316
- Fabric (1.9.0)
@@ -41,6 +44,7 @@ DEPENDENCIES:
4144
- AEXML
4245
- ChameleonFramework (~> 2.1.0)
4346
- Charts (~> 4.1.0)
47+
- CocoaLumberjack/Swift
4448
- Crashlytics (~> 3.12.0)
4549
- Fabric
4650
- Introspect
@@ -66,6 +70,7 @@ SPEC REPOS:
6670
- AEXML
6771
- ChameleonFramework
6872
- Charts
73+
- CocoaLumberjack
6974
- Crashlytics
7075
- Fabric
7176
- Introspect
@@ -92,6 +97,7 @@ SPEC CHECKSUMS:
9297
AEXML: 1e255ecc6597212f97a7454a69ebd3ede64ac1cf
9398
ChameleonFramework: d21a3cc247abfe5e37609a283a8238b03575cf64
9499
Charts: ce0768268078eee0336f122c3c4ca248e4e204c5
100+
CocoaLumberjack: f8d89a516e7710fdb2e9b8f1560b16ec6040eef0
95101
Crashlytics: a33af323773f73904037dc2e684cd2f0d29f4fe2
96102
Fabric: 09ef2d9b99b104702bede1acaf469fb8f20a9146
97103
Introspect: b62c4dd2063072327c21d618ef2bedc3c87bc366
@@ -113,6 +119,6 @@ SPEC CHECKSUMS:
113119
UICircularProgressRing: 19927375b2b21b5fa5fd9582f15ccdef9659da16
114120
XMLDictionary: fa07b6ff422b3a91d47a5de9bc82e3fc04fbd167
115121

116-
PODFILE CHECKSUM: 90b577a05167576a7f2ac952330395b6f30605e3
122+
PODFILE CHECKSUM: 99c5e34410dda7fcf73bc0c4eccd032787e4da96
117123

118124
COCOAPODS: 1.12.1

SiliconLabsApp.xcodeproj/project.pbxproj

Lines changed: 160 additions & 4 deletions
Large diffs are not rendered by default.

SiliconLabsApp/BluetoothControllers/SILCentralManager.m

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#import "SILWeakNotificationPair.h"
1717
#import "SILConstants.h"
1818
#import "NSString+SILBrowserNotifications.h"
19+
#import "BlueGecko-Swift.h"
1920
#if ENABLE_HOMEKIT
2021
#import <HomeKit/HomeKit.h>
2122
#endif
@@ -58,7 +59,7 @@ @interface SILCentralManager ()
5859

5960
@property (nonatomic, strong) NSArray<CLBeaconRegion *> *regions;
6061
@property (nonatomic, strong) CLLocationManager *locationManager;
61-
62+
@property (nonatomic, strong) IOPLog *logObj;
6263
@end
6364

6465
@implementation SILCentralManager
@@ -73,6 +74,7 @@ - (instancetype)initWithServiceUUIDs:(NSArray *)serviceUUIDs {
7374
[self setupNotifications];
7475
[self setupBeaconMonitoring];
7576
self.connectionsViewModel = [SILBrowserConnectionsViewModel sharedInstance];
77+
_logObj = [[IOPLog alloc] init];
7678
}
7779
return self;
7880
}
@@ -124,9 +126,14 @@ - (void)setupNotifications {
124126
- (void)applicationWillTerminateNotification:(NSNotification *)notification {
125127
if (self.connectedPeripheral) {
126128
NSLog(@"Disconnected from connected peripheral");
129+
130+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"Disconnected from connected peripheral: %@", self.connectedPeripheral]];
131+
127132
[self disconnectFromPeripheral:self.connectedPeripheral];
128133
} else if (self.connectingPeripheral) {
129134
NSLog(@"Disconnect from connecting peripheral");
135+
136+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"Disconnect from connecting peripheral: %@", self.connectingPeripheral]];
130137
[self disconnectFromPeripheral:self.connectingPeripheral];
131138
}
132139
}
@@ -383,6 +390,8 @@ - (double)getTimestampWithAdvertisementData:(NSDictionary *)advertisementData {
383390

384391
- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral {
385392
NSLog(@"didConnectPeripheral: %@", peripheral);
393+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"didConnectPeripheral: %@", peripheral]];
394+
386395
[self removeUnfiredConnectionTimeoutTimer];
387396
self.connectingPeripheral = nil;
388397
self.connectedPeripheral = peripheral;
@@ -398,6 +407,11 @@ - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPerip
398407
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error {
399408
NSLog(@"didFailToConnectPeripheral: %@", peripheral.name);
400409
NSLog(@"error: %@", error);
410+
411+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"didDisconnectPeripheral: %@", peripheral]];
412+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"didDisconnectPeripheral: %@", peripheral.name]];
413+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"error: %@", error]];
414+
401415
[self removeUnfiredConnectionTimeoutTimer];
402416
[self handleConnectionFailureWithError:error];
403417
[self postRegisterLogNotification:[SILLogDataModel prepareLogDescription:@"didFailToConnectPeripheral: " andPeripheral:peripheral andError:error]];
@@ -408,14 +422,20 @@ - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPe
408422
NSLog(@"didDisconnectPeripheral: %@", peripheral.name);
409423
NSLog(@"error: %@", error);
410424

425+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"didDisconnectPeripheral: %@", peripheral]];
426+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"didDisconnectPeripheral: %@", peripheral.name]];
427+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"error: %@", error]];
428+
411429
BOOL wasConnected = [self.connectionsViewModel isConnectedPeripheral:peripheral];
412430
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
413431
userInfo[SILCentralManagerPeripheralKey] = peripheral;
414432
userInfo[SILNotificationKeyUUID] = peripheral.identifier.UUIDString;
415433
if (error) {
416434
userInfo[SILCentralManagerErrorKey] = error;
417435
}
418-
436+
437+
[_logObj iopLogSwiftFunctionWithMessage:[NSString stringWithFormat:@"UserInfo: %@", userInfo]];
438+
419439
[[NSNotificationCenter defaultCenter] postNotificationName:SILCentralManagerDidDisconnectPeripheralNotification
420440
object:self
421441
userInfo:userInfo];

SiliconLabsApp/Categories/UIImage+SILImages.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ extern NSString * const SILImageNameHomeWifiCommissioning;
3535
extern NSString * const SILImageNameHomeESLDemo;
3636
extern NSString * const SILImageNameHomeMatterDemo;
3737
extern NSString * const SILImageNameHomeWifiOtaDemo;
38+
//extern NSString * const SILImageNameHomeWifiSensor;
39+
extern NSString * const SILImageNameHomeWiFiSensor;
3840

3941
extern NSString * const SILImageNameKeyboard;
4042
extern NSString * const SILImageNameKeyboardCheckmark;

SiliconLabsApp/Categories/UIImage+SILImages.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
NSString * const SILImageNameHomeESLDemo = @"esl_icon";
3636
NSString * const SILImageNameHomeMatterDemo = @"matter_icon";
3737
NSString * const SILImageNameHomeWifiOtaDemo = @"wifi_ota_icon";
38+
//NSString * const SILImageNameHomeWifiSensor = @"icon - wifi commissioning";
39+
NSString * const SILImageNameHomeWiFiSensor = @"WiFi_sensore_icon";
40+
3841

3942
NSString * const SILImageNameKeyboard = @"Keyboard";
4043
NSString * const SILImageNameKeyboardCheckmark = @"KeyboardCheckmark";

SiliconLabsApp/Models/SILApp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ typedef NS_ENUM(NSInteger, SILAppType) {
2020
SILAppTypeWifiCommissioning,
2121
SILAppTypeESLDemo,
2222
SILAppTypeMatterDemo,
23-
SILAppTypeWifiOTA
23+
SILAppTypeWifiOTA,
24+
SILAppTypeWifiSensor
2425
};
2526

2627
@interface SILApp : NSObject

SiliconLabsApp/Models/SILApp.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ + (NSArray *)demoApps {
2323
[self wifiCommissioningApp],
2424
[self eslDemoApp],
2525
[self matterDemoApp],
26-
[self WifiOTADemoApp]
26+
[self WifiOTADemoApp],
27+
[self WifiSensorDemoApp]
2728
];
2829
}
2930

@@ -117,11 +118,18 @@ + (SILApp *)matterDemoApp {
117118

118119
+ (SILApp *)WifiOTADemoApp {
119120
return [[SILApp alloc] initWithAppType:SILAppTypeWifiOTA
120-
title:@"Wi-fi OTA Demo"
121+
title:@"Wi-Fi OTA Demo"
121122
description:@"Control OTA Firmware update over Wi-Fi."
122123
showcasedProfiles:@{}
123124
imageName:SILImageNameHomeWifiOtaDemo];
124125
}
126+
+ (SILApp *)WifiSensorDemoApp {
127+
return [[SILApp alloc] initWithAppType:SILAppTypeWifiSensor
128+
title:@"Wi-Fi Sensors"
129+
description:@"Read and display sensor data from the dev kit sensors."
130+
showcasedProfiles:@{}
131+
imageName:SILImageNameHomeWiFiSensor];
132+
}
125133

126134
- (instancetype)initWithAppType:(SILAppType)appType
127135
title:(NSString *)title

SiliconLabsApp/SILAppDelegate.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import SwiftUI
1212
import Fabric
1313
import Crashlytics
1414
import CoreHaptics
15+
import CocoaLumberjack
1516

1617
class SILAppDelegate : UIResponder, UIApplicationDelegate {
1718
var window: UIWindow?
@@ -33,6 +34,19 @@ class SILAppDelegate : UIResponder, UIApplicationDelegate {
3334
window = UIWindow(frame: UIScreen.main.bounds)
3435
window?.rootViewController = UIHostingController(rootView: MainNavigationView())
3536
window?.makeKeyAndVisible()
37+
38+
setupLogs()
39+
3640
return true
3741
}
42+
private func setupLogs() {
43+
DDLog.add(DDOSLogger.sharedInstance)
44+
45+
let fileLogger: DDFileLogger = DDFileLogger() // File Logger
46+
fileLogger.rollingFrequency = 60 * 60 * 24 // 24 hours
47+
fileLogger.logFileManager.maximumNumberOfLogFiles = 30
48+
fileLogger.maximumFileSize = 1024 * 1024 * 10 // 10 MiB
49+
DDLog.add(fileLogger)
50+
//SBMLogger.sharedInstance().delegate = self;
51+
}
3852
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}

0 commit comments

Comments
 (0)