Skip to content

Commit

Permalink
Merge branch 'develop' into feature/smartdevicelink#1163/rpc_message_…
Browse files Browse the repository at this point in the history
…protection
  • Loading branch information
SatbirTanda committed Jul 2, 2019
2 parents eb6e81d + 76d6cd1 commit 2a80692
Show file tree
Hide file tree
Showing 561 changed files with 9,211 additions and 4,210 deletions.
169 changes: 100 additions & 69 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Example Apps/Example ObjC/ButtonManager.m
Expand Up @@ -135,6 +135,9 @@ - (SDLSoftButtonObject *)sdlex_softButtonImagesVisibleWithManager:(SDLManager *)
SDLSoftButtonObject *object = [weakself.sdlManager.screenManager softButtonObjectNamed:ImagesVisibleSoftButton];
[object transitionToNextState];

SDLSoftButtonObject *textButton = [weakself.sdlManager.screenManager softButtonObjectNamed:TextVisibleSoftButton];
[textButton transitionToNextState];

SDLLogD(@"Image visibility soft button press fired %d", weakself.imagesEnabled);
}];

Expand Down
15 changes: 11 additions & 4 deletions Example Apps/Example ObjC/ProxyManager.m
Expand Up @@ -54,7 +54,7 @@ - (instancetype)init {
return self;
}

- (void)startManager {
- (void)sdlex_startManager {
__weak typeof (self) weakSelf = self;
[self.sdlManager startWithReadyHandler:^(BOOL success, NSError * _Nullable error) {
if (!success) {
Expand All @@ -76,7 +76,10 @@ - (void)startManager {
}

- (void)stopConnection {
[self.sdlManager stop];
dispatch_async(dispatch_get_main_queue(), ^{
[self.sdlManager stop];
});

[self sdlex_updateProxyState:ProxyStateStopped];
}

Expand Down Expand Up @@ -106,10 +109,14 @@ + (SDLLifecycleConfiguration *)sdlex_tcpLifecycleConfiguration {
}

- (void)sdlex_setupConfigurationWithLifecycleConfiguration:(SDLLifecycleConfiguration *)lifecycleConfiguration {
if (self.sdlManager != nil) {
// Manager already created, just start it again.
[self sdlex_startManager];
return;
}
SDLConfiguration *config = [SDLConfiguration configurationWithLifecycle:lifecycleConfiguration lockScreen:[SDLLockScreenConfiguration enabledConfigurationWithAppIcon:[UIImage imageNamed:ExampleAppLogoName] backgroundColor:nil] logging:[self.class sdlex_logConfiguration] fileManager:[SDLFileManagerConfiguration defaultConfiguration]];
self.sdlManager = [[SDLManager alloc] initWithConfiguration:config delegate:self];

[self startManager];
[self sdlex_startManager];
}

+ (SDLLifecycleConfiguration *)sdlex_setLifecycleConfigurationPropertiesOnConfiguration:(SDLLifecycleConfiguration *)config {
Expand Down
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.2.3</string>
<string>6.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions Example Apps/Example ObjC/VehicleDataManager.m
Expand Up @@ -37,7 +37,7 @@ - (instancetype)initWithManager:(SDLManager *)manager refreshUIHandler:(RefreshU
_refreshUIHandler = refreshUIHandler;
_vehicleOdometerData = @"";

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(vehicleDataNotification:) name:SDLDidReceiveVehicleDataNotification object:nil];
[_sdlManager subscribeToRPC:SDLDidReceiveVehicleDataNotification withObserver:self selector:@selector(vehicleDataNotification:)];
[self sdlex_resetOdometer];

return self;
Expand Down Expand Up @@ -112,7 +112,7 @@ - (void)vehicleDataNotification:(SDLRPCNotificationNotification *)notification {
}

SDLOnVehicleData *onVehicleData = (SDLOnVehicleData *)notification.notification;
self.vehicleOdometerData = [NSString stringWithFormat:@"%@: %@ kph", VehicleDataOdometerName, onVehicleData.odometer];
self.vehicleOdometerData = [NSString stringWithFormat:@"%@: %@ km", VehicleDataOdometerName, onVehicleData.odometer];

if (!self.refreshUIHandler) { return; }
self.refreshUIHandler();
Expand Down
11 changes: 10 additions & 1 deletion Example Apps/Example Swift/ProxyManager.swift
Expand Up @@ -43,6 +43,12 @@ extension ProxyManager {
///
/// - Parameter connectionType: The type of transport layer to use.
func start(with proxyTransportType: ProxyTransportType) {
guard sdlManager == nil else {
// Manager already created, just start it again.
startManager()
return
}

delegate?.didChangeProxyState(ProxyState.searching)
sdlManager = SDLManager(configuration: proxyTransportType == .iap ? ProxyManager.connectIAP() : ProxyManager.connectTCP(), delegate: self)
startManager()
Expand All @@ -55,7 +61,10 @@ extension ProxyManager {
return
}

sdlManager.stop()
DispatchQueue.main.async { [weak self] in
self?.sdlManager.stop()
}

delegate?.didChangeProxyState(.stopped)
}
}
Expand Down
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.2.3</string>
<string>6.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Example Apps/Example Swift/VehicleDataManager.swift
Expand Up @@ -23,7 +23,7 @@ class VehicleDataManager: NSObject {
super.init()

resetOdometer()
NotificationCenter.default.addObserver(self, selector: #selector(vehicleDataNotification(_:)), name: .SDLDidReceiveVehicleData, object: nil)
self.sdlManager.subscribe(to: .SDLDidReceiveVehicleData, observer: self, selector: #selector(vehicleDataNotification(_:)))
}
}

Expand Down
23 changes: 23 additions & 0 deletions Package.swift
@@ -0,0 +1,23 @@
// swift-tools-version:5.0
import PackageDescription

let package = Package(
name: "SmartDeviceLink",
products: [
.library(name: "SmartDeviceLink", targets: ["SmartDeviceLink"]),
.library(name: "SmartDeviceLinkSwift", targets: ["SmartDeviceLinkSwift"])
],
targets: [
.target(
name: "SmartDeviceLink",
path: "SmartDeviceLink"
),
.target(
name: "SmartDeviceLinkSwift",
dependencies: [
"SmartDeviceLink"
],
path: "SmartDeviceLinkSwift"
),
]
)
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -7,6 +7,7 @@
[![CocoaPods Downloads](https://img.shields.io/cocoapods/dt/SmartDeviceLink-iOS.svg?maxAge=172800)](https://cocoapods.org/pods/SmartDeviceLink-iOS)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)
[![Accio supported](https://img.shields.io/badge/Accio-supported-0A7CF5.svg?style=flat)](https://github.com/JamitLabs/Accio)


# SmartDeviceLink (SDL)
Expand Down Expand Up @@ -35,6 +36,18 @@ See the [changelog](https://github.com/smartdevicelink/sdl_ios/blob/master/CHANG

### Installing

#### Accio

You can install this library using [Accio/SwiftPM](https://github.com/JamitLabs/Accio) documentation page. Please follow the steps to install and initialization Accio into a current or new application.

In your Package.swift file , you want to add `.package(url: "https://github.com/smartdevicelink/sdl_ios.git", .from: "6.2.3"),` to the dependencies array. Then add `SmartDeviceLink` to the targets dependencies array.

Please see [Mainifest format](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescriptionV4.md) to specify dependencies to a specific branch / version of SDL.

###### Swift

If you are building a Swift app, then add this instead `SmartDeviceLinkSwift` to the targets dependencies array.

##### Cocoapods

You can install this library using [Cocoapods](https://cocoapods.org/pods/SmartDeviceLink-iOS). You can get started with Cocoapods by [following their install guide](https://guides.cocoapods.org/using/getting-started.html#getting-started), and learn how to use Cocoapods to install dependencies [by following this guide](https://guides.cocoapods.org/using/using-cocoapods.html).
Expand Down
6 changes: 4 additions & 2 deletions SmartDeviceLink-iOS.podspec
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|

s.name = "SmartDeviceLink-iOS"
s.version = "6.2.3"
s.version = "6.3.0"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" }
s.platform = :ios, "8.0"
s.dependency 'BiSON', '~> 1.1.1'
s.dependency 'BiSON', '~> 1.2.0'
s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s }
s.requires_arc = true
s.resource_bundles = { 'SmartDeviceLink' => ['SmartDeviceLink/Assets/**/*'] }
Expand Down Expand Up @@ -42,6 +42,7 @@ ss.public_header_files = [
'SmartDeviceLink/SDLArtwork.h',
'SmartDeviceLink/SDLAudioControlData.h',
'SmartDeviceLink/SDLAudioControlCapabilities.h',
'SmartDeviceLink/SDLAudioFile.h',
'SmartDeviceLink/SDLAudioPassThruCapabilities.h',
'SmartDeviceLink/SDLAudioStreamingState.h',
'SmartDeviceLink/SDLAudioStreamingIndicator.h',
Expand Down Expand Up @@ -206,6 +207,7 @@ ss.public_header_files = [
'SmartDeviceLink/SDLMediaServiceManifest.h',
'SmartDeviceLink/SDLMediaType.h',
'SmartDeviceLink/SDLMenuCell.h',
'SmartDeviceLink/SDLMenuManagerConstants.h',
'SmartDeviceLink/SDLMenuParams.h',
'SmartDeviceLink/SDLMetadataTags.h',
'SmartDeviceLink/SDLMetadataType.h',
Expand Down

0 comments on commit 2a80692

Please sign in to comment.