Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start updating RPCs with generated initializers #1824

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
output/

# OS generated files #
######################
2 changes: 2 additions & 0 deletions SmartDeviceLink/private/SDLRPCParameterNames.h
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameApproximatePosition;
extern SDLRPCParameterName const SDLRPCParameterNameAppBundleId;
extern SDLRPCParameterName const SDLRPCParameterNameAppDisplayName;
extern SDLRPCParameterName const SDLRPCParameterNameAppHMIType;
extern SDLRPCParameterName const SDLRPCParameterNameAppIcon;
extern SDLRPCParameterName const SDLRPCParameterNameAppId;
extern SDLRPCParameterName const SDLRPCParameterNameAppInfo;
extern SDLRPCParameterName const SDLRPCParameterNameAppName;
@@ -158,6 +159,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameCloudTransportType;
extern SDLRPCParameterName const SDLRPCParameterNameCurrentForecast;
extern SDLRPCParameterName const SDLRPCParameterNameCurrentForecastSupported;
extern SDLRPCParameterName const SDLRPCParameterNameCurrentTemperature;
extern SDLRPCParameterName const SDLRPCParameterNameCurrentTemperatureAvailable;
extern SDLRPCParameterName const SDLRPCParameterNameCushion;
extern SDLRPCParameterName const SDLRPCParameterNameCustomButtonId;
extern SDLRPCParameterName const SDLRPCParameterNameCustomPresets;
2 changes: 2 additions & 0 deletions SmartDeviceLink/private/SDLRPCParameterNames.m
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@
SDLRPCParameterName const SDLRPCParameterNameApproximatePosition = @"approximatePosition";
SDLRPCParameterName const SDLRPCParameterNameAppBundleId = @"appBundleID";
SDLRPCParameterName const SDLRPCParameterNameAppHMIType = @"appHMIType";
SDLRPCParameterName const SDLRPCParameterNameAppIcon = @"appIcon";
SDLRPCParameterName const SDLRPCParameterNameAppId = @"appID";
SDLRPCParameterName const SDLRPCParameterNameAppInfo = @"appInfo";
SDLRPCParameterName const SDLRPCParameterNameAppName = @"appName";
@@ -157,6 +158,7 @@
SDLRPCParameterName const SDLRPCParameterNameCurrentForecast = @"currentForecast";
SDLRPCParameterName const SDLRPCParameterNameCurrentForecastSupported = @"currentForecastSupported";
SDLRPCParameterName const SDLRPCParameterNameCurrentTemperature = @"currentTemperature";
SDLRPCParameterName const SDLRPCParameterNameCurrentTemperatureAvailable = @"currentTemperatureAvailable";
SDLRPCParameterName const SDLRPCParameterNameCushion = @"cushion";
SDLRPCParameterName const SDLRPCParameterNameCustomButtonId = @"customButtonID";
SDLRPCParameterName const SDLRPCParameterNameCustomPresets = @"customPresets";
60 changes: 52 additions & 8 deletions SmartDeviceLink/public/SDLAddCommand.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
// SDLAddCommand.h
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/


#import "SDLRPCRequest.h"
@@ -9,6 +39,8 @@
@class SDLImage;
@class SDLMenuParams;

NS_ASSUME_NONNULL_BEGIN

/**
* This class will add a command to the application's Command Menu
*
@@ -25,10 +57,22 @@
* @since SDL 1.0
* @see SDLDeleteCommand, SDLAddSubMenu, SDLDeleteSubMenu
*/
@interface SDLAddCommand : SDLRPCRequest

NS_ASSUME_NONNULL_BEGIN
/**
* @param cmdID - @(cmdID)
* @return A SDLAddCommand object
*/
- (instancetype)initWithCmdID:(UInt32)cmdID;

@interface SDLAddCommand : SDLRPCRequest
/**
* @param cmdID - @(cmdID)
* @param menuParams - menuParams
* @param vrCommands - vrCommands
* @param cmdIcon - cmdIcon
* @return A SDLAddCommand object
*/
- (instancetype)initWithCmdID:(UInt32)cmdID menuParams:(nullable SDLMenuParams *)menuParams vrCommands:(nullable NSArray<NSString *> *)vrCommands cmdIcon:(nullable SDLImage *)cmdIcon;

/**
* Constructs a SDLAddCommand with a handler callback when an event occurs.
@@ -37,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @return A SDLAddCommand object
*/
- (instancetype)initWithHandler:(nullable SDLRPCCommandNotificationHandler)handler;
- (instancetype)initWithHandler:(nullable SDLRPCCommandNotificationHandler)handler __deprecated_msg("Use initWithCmdId: instead");

/**
* Convenience init for creating a voice command menu item.
@@ -49,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param handler Called when the VR system recognizes a phrase in `vrCommands`
* @return A SDLAddCommand object
*/
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands handler:(nullable SDLRPCCommandNotificationHandler)handler;
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands handler:(nullable SDLRPCCommandNotificationHandler)handler __deprecated_msg("Use initWithCmdId: instead");

/**
* Convenience init for creating a menu item with text.
@@ -60,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param handler Called when the menu item is selected and/or when the VR system recognizes a phrase in `vrCommands`
* @return A SDLAddCommand object
*/
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(nullable SDLRPCCommandNotificationHandler)handler;
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(nullable SDLRPCCommandNotificationHandler)handler __deprecated_msg("Use initWithCmdId: instead");

/**
* Convenience init for creating a menu item with text and a custom icon.
@@ -78,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param handler Called when the menu item is selected and/or when the VR system recognizes a phrase in `vrCommands`
* @return A SDLAddCommand object
*/
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(nullable NSString *)iconValue iconType:(nullable SDLImageType)iconType iconIsTemplate:(BOOL)iconIsTemplate handler:(nullable SDLRPCCommandNotificationHandler)handler;
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(nullable NSString *)iconValue iconType:(nullable SDLImageType)iconType iconIsTemplate:(BOOL)iconIsTemplate handler:(nullable SDLRPCCommandNotificationHandler)handler __deprecated_msg("Use initWithCmdId: instead");

/**
* Convenience init for creating a menu item with text and a custom icon.
@@ -94,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param handler Called when the menu item is selected and/or when the VR system recognizes a phrase in `vrCommands`
* @return A SDLAddCommand object
*/
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position icon:(nullable SDLImage *)icon handler:(nullable SDLRPCCommandNotificationHandler)handler;
- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position icon:(nullable SDLImage *)icon handler:(nullable SDLRPCCommandNotificationHandler)handler __deprecated_msg("Use initWithCmdId: instead");

/**
* A handler that will let you know when the button you created is subscribed.
20 changes: 20 additions & 0 deletions SmartDeviceLink/public/SDLAddCommand.m
Original file line number Diff line number Diff line change
@@ -23,6 +23,26 @@ - (instancetype)init {
}
#pragma clang diagnostic pop

- (instancetype)initWithCmdID:(UInt32)cmdID {
self = [self init];
if (!self) {
return nil;
}
self.cmdID = @(cmdID);
return self;
}

- (instancetype)initWithCmdID:(UInt32)cmdID menuParams:(nullable SDLMenuParams *)menuParams vrCommands:(nullable NSArray<NSString *> *)vrCommands cmdIcon:(nullable SDLImage *)cmdIcon {
self = [self initWithCmdID:cmdID];
if (!self) {
return nil;
}
self.menuParams = menuParams;
self.vrCommands = vrCommands;
self.cmdIcon = cmdIcon;
return self;
}

- (instancetype)initWithHandler:(nullable SDLRPCCommandNotificationHandler)handler {
self = [self init];
if (!self) {
5 changes: 2 additions & 3 deletions SmartDeviceLink/public/SDLAddSubMenu.h
Original file line number Diff line number Diff line change
@@ -37,6 +37,8 @@

@class SDLImage;

NS_ASSUME_NONNULL_BEGIN

/**
* Add a SDLSubMenu to the Command Menu
* <p>
@@ -50,9 +52,6 @@
* Since <b>SmartDeviceLink 1.0</b><br>
* see SDLDeleteSubMenu SDLAddCommand SDLDeleteCommand
*/

NS_ASSUME_NONNULL_BEGIN

@interface SDLAddSubMenu : SDLRPCRequest

/**
46 changes: 44 additions & 2 deletions SmartDeviceLink/public/SDLAirbagStatus.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLAirbagStatus.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"

@@ -12,6 +41,19 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAirbagStatus : SDLRPCStruct

/**
* @param driverAirbagDeployed - driverAirbagDeployed
* @param driverSideAirbagDeployed - driverSideAirbagDeployed
* @param driverCurtainAirbagDeployed - driverCurtainAirbagDeployed
* @param passengerAirbagDeployed - passengerAirbagDeployed
* @param passengerCurtainAirbagDeployed - passengerCurtainAirbagDeployed
* @param driverKneeAirbagDeployed - driverKneeAirbagDeployed
* @param passengerSideAirbagDeployed - passengerSideAirbagDeployed
* @param passengerKneeAirbagDeployed - passengerKneeAirbagDeployed
* @return A SDLAirbagStatus object
*/
- (instancetype)initWithDriverAirbagDeployed:(SDLVehicleDataEventStatus)driverAirbagDeployed driverSideAirbagDeployed:(SDLVehicleDataEventStatus)driverSideAirbagDeployed driverCurtainAirbagDeployed:(SDLVehicleDataEventStatus)driverCurtainAirbagDeployed passengerAirbagDeployed:(SDLVehicleDataEventStatus)passengerAirbagDeployed passengerCurtainAirbagDeployed:(SDLVehicleDataEventStatus)passengerCurtainAirbagDeployed driverKneeAirbagDeployed:(SDLVehicleDataEventStatus)driverKneeAirbagDeployed passengerSideAirbagDeployed:(SDLVehicleDataEventStatus)passengerSideAirbagDeployed passengerKneeAirbagDeployed:(SDLVehicleDataEventStatus)passengerKneeAirbagDeployed;

/**
References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.
16 changes: 16 additions & 0 deletions SmartDeviceLink/public/SDLAirbagStatus.m
Original file line number Diff line number Diff line change
@@ -9,6 +9,22 @@

@implementation SDLAirbagStatus

- (instancetype)initWithDriverAirbagDeployed:(SDLVehicleDataEventStatus)driverAirbagDeployed driverSideAirbagDeployed:(SDLVehicleDataEventStatus)driverSideAirbagDeployed driverCurtainAirbagDeployed:(SDLVehicleDataEventStatus)driverCurtainAirbagDeployed passengerAirbagDeployed:(SDLVehicleDataEventStatus)passengerAirbagDeployed passengerCurtainAirbagDeployed:(SDLVehicleDataEventStatus)passengerCurtainAirbagDeployed driverKneeAirbagDeployed:(SDLVehicleDataEventStatus)driverKneeAirbagDeployed passengerSideAirbagDeployed:(SDLVehicleDataEventStatus)passengerSideAirbagDeployed passengerKneeAirbagDeployed:(SDLVehicleDataEventStatus)passengerKneeAirbagDeployed {
self = [self init];
if (!self) {
return nil;
}
self.driverAirbagDeployed = driverAirbagDeployed;
self.driverSideAirbagDeployed = driverSideAirbagDeployed;
self.driverCurtainAirbagDeployed = driverCurtainAirbagDeployed;
self.passengerAirbagDeployed = passengerAirbagDeployed;
self.passengerCurtainAirbagDeployed = passengerCurtainAirbagDeployed;
self.driverKneeAirbagDeployed = driverKneeAirbagDeployed;
self.passengerSideAirbagDeployed = passengerSideAirbagDeployed;
self.passengerKneeAirbagDeployed = passengerKneeAirbagDeployed;
return self;
}

- (void)setDriverAirbagDeployed:(SDLVehicleDataEventStatus)driverAirbagDeployed {
[self.store sdl_setObject:driverAirbagDeployed forName:SDLRPCParameterNameDriverAirbagDeployed];
}
55 changes: 49 additions & 6 deletions SmartDeviceLink/public/SDLAlert.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
// SDLAlert.h
//

/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCRequest.h"

@@ -19,6 +47,21 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAlert : SDLRPCRequest

/**
* @param alertText1 - alertText1
* @param alertText2 - alertText2
* @param alertText3 - alertText3
* @param ttsChunks - ttsChunks
* @param duration - duration
* @param playTone - playTone
* @param progressIndicator - progressIndicator
* @param softButtons - softButtons
* @param alertIcon - alertIcon
* @param cancelID - cancelID
* @return A SDLAlert object
*/
- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(nullable NSNumber<SDLUInt> *)duration playTone:(nullable NSNumber<SDLBool> *)playTone progressIndicator:(nullable NSNumber<SDLBool> *)progressIndicator softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons alertIcon:(nullable SDLImage *)alertIcon cancelID:(nullable NSNumber<SDLInt> *)cancelID;

/**
Convenience init for creating a modal view with text, buttons, and optional sound cues.
@@ -30,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
@param icon Image to be displayed in the alert
@return An SDLAlert object
*/
- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID;
- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:ttsChunks:duration:playTone:progressIndicator:softButtons:alertIcon:cancelID: instead");

/**
Convenience init for creating a sound-only alert.
@@ -39,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN
@param playTone Whether the alert tone should be played before the TTS is spoken
@return An SDLAlert object
*/
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone;
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:ttsChunks:duration:playTone:progressIndicator:softButtons:alertIcon:cancelID: instead");

/**
Convenience init for setting all alert parameters.
@@ -56,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN
@param icon Image to be displayed in the alert
@return An SDLAlert object
*/
- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(UInt16)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID;
- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(UInt16)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID __deprecated_msg("Use initWithAlertText1:alertText2:alertText3:ttsChunks:duration:playTone:progressIndicator:softButtons:alertIcon:cancelID: instead");

/**
The first line of the alert text field.
18 changes: 18 additions & 0 deletions SmartDeviceLink/public/SDLAlert.m
Original file line number Diff line number Diff line change
@@ -23,6 +23,24 @@ - (instancetype)init {
}
#pragma clang diagnostic pop

- (instancetype)initWithAlertText1:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(nullable NSNumber<SDLUInt> *)duration playTone:(nullable NSNumber<SDLBool> *)playTone progressIndicator:(nullable NSNumber<SDLBool> *)progressIndicator softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons alertIcon:(nullable SDLImage *)alertIcon cancelID:(nullable NSNumber<SDLInt> *)cancelID {
self = [self init];
if (!self) {
return nil;
}
self.alertText1 = alertText1;
self.alertText2 = alertText2;
self.alertText3 = alertText3;
self.ttsChunks = ttsChunks;
self.duration = duration;
self.playTone = playTone;
self.progressIndicator = progressIndicator;
self.softButtons = softButtons;
self.alertIcon = alertIcon;
self.cancelID = cancelID;
return self;
}

- (instancetype)initWithAlertText:(nullable NSString *)alertText1 alertText2:(nullable NSString *)alertText2 alertText3:(nullable NSString *)alertText3 softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks duration:(nullable NSNumber *)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(nullable NSNumber *)cancelID {
self = [self init];
if (!self) {
51 changes: 39 additions & 12 deletions SmartDeviceLink/public/SDLAlertManeuver.h
Original file line number Diff line number Diff line change
@@ -1,37 +1,64 @@
// SDLAlertManeuver.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/


#import "SDLRPCRequest.h"

@class SDLSoftButton;
@class SDLTTSChunk;

NS_ASSUME_NONNULL_BEGIN

/**
* Shows a SDLShowConstantTBT message with an optional voice command. This message is shown as an overlay over the display's base screen.
*
* @since SmartDeviceLink 1.0
*/

NS_ASSUME_NONNULL_BEGIN

@interface SDLAlertManeuver : SDLRPCRequest

/// Convenience init to create an alert maneuver with required parameters
/// Convenience init to create an alert maneuver with all parameters
///
/// @param ttsText The text to speak
/// @param ttsChunks An array of text chunks
/// @param softButtons An arry of soft buttons
///
/// @return An SDLAlertManeuver object
- (instancetype)initWithTTS:(nullable NSString *)ttsText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons;
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons;

/// Convenience init to create an alert maneuver with all parameters
/// Convenience init to create an alert maneuver with required parameters
///
/// @param ttsChunks An array of text chunks
/// @param ttsText The text to speak
/// @param softButtons An arry of soft buttons
///
/// @return An SDLAlertManeuver object
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons;
- (instancetype)initWithTTS:(nullable NSString *)ttsText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons __deprecated_msg("Use initWithTTSChunks:softButtons: instead");

/**
* An array of text chunks.
44 changes: 39 additions & 5 deletions SmartDeviceLink/public/SDLAlertResponse.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,53 @@
// SDLAlertResponse.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/


#import "SDLRPCResponse.h"

NS_ASSUME_NONNULL_BEGIN

/**
Response to SDLAlert
@since SDL 1.0
*/

NS_ASSUME_NONNULL_BEGIN

@interface SDLAlertResponse : SDLRPCResponse

/**
* @param tryAgainTime - tryAgainTime
* @return A SDLAlertResponse object
*/
- (instancetype)initWithTryAgainTime:(nullable NSNumber<SDLUInt> *)tryAgainTime;

/// Amount of time (in seconds) that an app must wait before resending an alert.
///
/// @since RPC 2.0
9 changes: 9 additions & 0 deletions SmartDeviceLink/public/SDLAlertResponse.m
Original file line number Diff line number Diff line change
@@ -20,6 +20,15 @@ - (instancetype)init {
}
#pragma clang diagnostic pop

- (instancetype)initWithTryAgainTime:(nullable NSNumber<SDLUInt> *)tryAgainTime {
self = [self init];
if (!self) {
return nil;
}
self.tryAgainTime = tryAgainTime;
return self;
}

- (void)setTryAgainTime:(nullable NSNumber<SDLInt> *)tryAgainTime {
[self.parameters sdl_setObject:tryAgainTime forName:SDLRPCParameterNameTryAgainTime];}

56 changes: 54 additions & 2 deletions SmartDeviceLink/public/SDLAppInfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLAppInfo.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCStruct.h"

@@ -10,6 +39,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAppInfo : SDLRPCStruct

/**
* @param appDisplayName - appDisplayName
* @param appBundleID - appBundleID
* @param appVersion - appVersion
* @return A SDLAppInfo object
*/
- (instancetype)initWithAppDisplayName:(NSString *)appDisplayName appBundleID:(NSString *)appBundleID appVersion:(NSString *)appVersion;

/**
* @param appDisplayName - appDisplayName
* @param appBundleID - appBundleID
* @param appVersion - appVersion
* @param appIcon - appIcon
* @return A SDLAppInfo object
*/
- (instancetype)initWithAppDisplayName:(NSString *)appDisplayName appBundleID:(NSString *)appBundleID appVersion:(NSString *)appVersion appIcon:(nullable NSString *)appIcon;

/// Convenience init with no parameters
///
/// @return An SDLAppInfo object
@@ -36,6 +82,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (strong, nonatomic) NSString *appVersion;

/**
* A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).
* {"string_min_length": 1, "string_max_length": 500}
*/
@property (nullable, strong, nonatomic) NSString *appIcon;

@end

NS_ASSUME_NONNULL_END
28 changes: 28 additions & 0 deletions SmartDeviceLink/public/SDLAppInfo.m
Original file line number Diff line number Diff line change
@@ -13,6 +13,26 @@

@implementation SDLAppInfo

- (instancetype)initWithAppDisplayName:(NSString *)appDisplayName appBundleID:(NSString *)appBundleID appVersion:(NSString *)appVersion {
self = [self init];
if (!self) {
return nil;
}
self.appDisplayName = appDisplayName;
self.appBundleID = appBundleID;
self.appVersion = appVersion;
return self;
}

- (instancetype)initWithAppDisplayName:(NSString *)appDisplayName appBundleID:(NSString *)appBundleID appVersion:(NSString *)appVersion appIcon:(nullable NSString *)appIcon {
self = [self initWithAppDisplayName:appDisplayName appBundleID:appBundleID appVersion:appVersion];
if (!self) {
return nil;
}
self.appIcon = appIcon;
return self;
}

+ (instancetype)currentAppInfo {
static SDLAppInfo *appInfo = nil;
if (appInfo == nil) {
@@ -53,6 +73,14 @@ - (NSString *)appVersion {
return [self.store sdl_objectForName:SDLRPCParameterNameAppVersion ofClass:NSString.class error:&error];
}

- (void)setAppIcon:(nullable NSString *)appIcon {
[self.store sdl_setObject:appIcon forName:SDLRPCParameterNameAppIcon];
}

- (nullable NSString *)appIcon {
return [self.store sdl_objectForName:SDLRPCParameterNameAppIcon ofClass:NSString.class error:nil];
}

@end

NS_ASSUME_NONNULL_END
11 changes: 9 additions & 2 deletions SmartDeviceLink/public/SDLAppServiceCapability.h
Original file line number Diff line number Diff line change
@@ -26,7 +26,14 @@ NS_ASSUME_NONNULL_BEGIN
* @param updatedAppServiceRecord Service record for a specific app service provider
* @return A SDLAppServiceCapability object
*/
- (instancetype)initWithUpdatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithUpdatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord;

/**
* @param updatedAppServiceRecord - updatedAppServiceRecord
* @param updateReason - updateReason
* @return A SDLAppServiceCapability object
*/
- (instancetype)initWithUpdatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord updateReason:(nullable SDLServiceUpdateReason)updateReason;

/**
* Convenience init for all parameters.
@@ -35,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param updatedAppServiceRecord Service record for a specific app service provider
* @return A SDLAppServiceCapability object
*/
- (instancetype)initWithUpdateReason:(nullable SDLServiceUpdateReason)updateReason updatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord;
- (instancetype)initWithUpdateReason:(nullable SDLServiceUpdateReason)updateReason updatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord __deprecated_msg("Use initWithUpdatedAppServiceRecord: instead");

/**
* Only included in `OnSystemCapbilityUpdated`. Update reason for this service record.
13 changes: 10 additions & 3 deletions SmartDeviceLink/public/SDLAppServiceCapability.m
Original file line number Diff line number Diff line change
@@ -18,13 +18,20 @@
@implementation SDLAppServiceCapability

- (instancetype)initWithUpdatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord {
self = [super init];
self = [self init];
if (!self) {
return self;
return nil;
}

self.updatedAppServiceRecord = updatedAppServiceRecord;
return self;
}

- (instancetype)initWithUpdatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord updateReason:(nullable SDLServiceUpdateReason)updateReason {
self = [self initWithUpdatedAppServiceRecord:updatedAppServiceRecord];
if (!self) {
return nil;
}
self.updateReason = updateReason;
return self;
}

26 changes: 24 additions & 2 deletions SmartDeviceLink/public/SDLAppServiceData.h
Original file line number Diff line number Diff line change
@@ -24,6 +24,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAppServiceData : SDLRPCStruct

/**
* @param serviceType - serviceType
* @param serviceID - serviceID
* @return A SDLAppServiceData object
*/
- (instancetype)initWithServiceType:(NSString *)serviceType serviceID:(NSString *)serviceID;

/**
* @param serviceType - serviceType
* @param serviceID - serviceID
* @param mediaServiceData - mediaServiceData
* @param weatherServiceData - weatherServiceData
* @param navigationServiceData - navigationServiceData
* @return A SDLAppServiceData object
*/
- (instancetype)initWithServiceType:(NSString *)serviceType serviceID:(NSString *)serviceID mediaServiceData:(nullable SDLMediaServiceData *)mediaServiceData weatherServiceData:(nullable SDLWeatherServiceData *)weatherServiceData navigationServiceData:(nullable SDLNavigationServiceData *)navigationServiceData;

/**
* Convenience init for service type and service id.
*
@@ -70,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN
* @param navigationServiceData The navigation service data
* @return A SDLAppServiceData object
*/
- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType serviceId:(NSString *)serviceId mediaServiceData:(nullable SDLMediaServiceData *)mediaServiceData weatherServiceData:(nullable SDLWeatherServiceData *)weatherServiceData navigationServiceData:(nullable SDLNavigationServiceData *)navigationServiceData;
- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType serviceId:(NSString *)serviceId mediaServiceData:(nullable SDLMediaServiceData *)mediaServiceData weatherServiceData:(nullable SDLWeatherServiceData *)weatherServiceData navigationServiceData:(nullable SDLNavigationServiceData *)navigationServiceData __deprecated_msg("Use initWithServiceType:serviceID: instead");

/**
* The type of service that is to be offered by this app. See `AppServiceType` for known enum equivalent types. Parameter is a string to allow for new service types to be used by apps on older versions of SDL Core.
@@ -79,12 +96,17 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (strong, nonatomic) NSString *serviceType;

/**
* {"string_min_length": 1, "string_max_length": null}
*/
@property (strong, nonatomic) NSString *serviceID;

/**
* A unique ID tied to this specific service record. The ID is supplied by the module that services publish themselves.
*
* String, Required
*/
@property (strong, nonatomic) NSString *serviceId;
@property (strong, nonatomic) NSString *serviceId __deprecated_msg("Use serviceID instead");

/**
* The media service data.
32 changes: 31 additions & 1 deletion SmartDeviceLink/public/SDLAppServiceData.m
Original file line number Diff line number Diff line change
@@ -19,14 +19,35 @@

@implementation SDLAppServiceData

- (instancetype)initWithServiceType:(NSString *)serviceType serviceID:(NSString *)serviceID {
self = [self init];
if (!self) {
return nil;
}
self.serviceType = serviceType;
self.serviceID = serviceID;
return self;
}

- (instancetype)initWithServiceType:(NSString *)serviceType serviceID:(NSString *)serviceID mediaServiceData:(nullable SDLMediaServiceData *)mediaServiceData weatherServiceData:(nullable SDLWeatherServiceData *)weatherServiceData navigationServiceData:(nullable SDLNavigationServiceData *)navigationServiceData {
self = [self initWithServiceType:serviceType serviceID:serviceID];
if (!self) {
return nil;
}
self.mediaServiceData = mediaServiceData;
self.weatherServiceData = weatherServiceData;
self.navigationServiceData = navigationServiceData;
return self;
}

- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType serviceId:(NSString *)serviceId {
self = [super init];
if (!self) {
return nil;
}

self.serviceType = serviceType;
self.serviceId = serviceId;
self.serviceID = serviceId;

return self;
}
@@ -86,6 +107,15 @@ - (NSString *)serviceType {
return [self.store sdl_objectForName:SDLRPCParameterNameServiceType ofClass:NSString.class error:&error];
}

- (void)setServiceID:(NSString *)serviceID {
[self.store sdl_setObject:serviceID forName:SDLRPCParameterNameServiceID];
}

- (NSString *)serviceID {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameServiceID ofClass:NSString.class error:&error];
}

- (void)setServiceId:(NSString *)serviceId {
[self.store sdl_setObject:serviceId forName:SDLRPCParameterNameServiceID];
}
99 changes: 74 additions & 25 deletions SmartDeviceLink/public/SDLAppServiceManifest.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
//
// SDLAppServiceManifest.h
// SmartDeviceLink
//
// Created by Nicole on 1/25/19.
// Copyright © 2019 smartdevicelink. All rights reserved.
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCRequest.h"

@@ -25,13 +49,49 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAppServiceManifest : SDLRPCStruct

/**
* @param serviceType - serviceType
* @return A SDLAppServiceManifest object
*/
- (instancetype)initWithServiceType:(NSString *)serviceType;

/**
* @param serviceType - serviceType
* @param serviceName - serviceName
* @param serviceIcon - serviceIcon
* @param allowAppConsumers - allowAppConsumers
* @param rpcSpecVersion - rpcSpecVersion
* @param handledRPCs - handledRPCs
* @param mediaServiceManifest - mediaServiceManifest
* @param weatherServiceManifest - weatherServiceManifest
* @param navigationServiceManifest - navigationServiceManifest
* @return A SDLAppServiceManifest object
*/
- (instancetype)initWithServiceType:(NSString *)serviceType serviceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(nullable NSNumber<SDLBool> *)allowAppConsumers rpcSpecVersion:(nullable SDLMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest;

/**
* Convenience init for all parameters.
*
* @param serviceName Unique name of this service
* @param serviceType The type of service that is to be offered by this app
* @param serviceIcon The file name of the icon to be associated with this service
* @param allowAppConsumers If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
* @param maxRPCSpecVersion This is the max RPC Spec version the app service understands
* @param handledRPCs This field contains the Function IDs for the RPCs that this service intends to handle correctly
* @param mediaServiceManifest A media service manifest
* @param weatherServiceManifest A weather service manifest
* @param navigationServiceManifest A navigation service manifest
* @return A SDLAppServiceManifest object
*/
- (instancetype)initWithServiceName:(nullable NSString *)serviceName serviceType:(SDLAppServiceType)serviceType serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest __deprecated_msg("Use initWithServiceType: instead");

/**
* Convenience init for serviceType.
*
* @param serviceType The type of service that is to be offered by this app
* @return A SDLAppServiceManifest object
*/
- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType;

/**
* Convenience init for a media service manifest.
@@ -72,22 +132,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithNavigationServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest;

/**
* Convenience init for all parameters.
*
* @param serviceName Unique name of this service
* @param serviceType The type of service that is to be offered by this app
* @param serviceIcon The file name of the icon to be associated with this service
* @param allowAppConsumers If true, app service consumers beyond the IVI system will be able to access this service. If false, only the IVI system will be able consume the service. If not provided, it is assumed to be false
* @param maxRPCSpecVersion This is the max RPC Spec version the app service understands
* @param handledRPCs This field contains the Function IDs for the RPCs that this service intends to handle correctly
* @param mediaServiceManifest A media service manifest
* @param weatherServiceManifest A weather service manifest
* @param navigationServiceManifest A navigation service manifest
* @return A SDLAppServiceManifest object
*/
- (instancetype)initWithServiceName:(nullable NSString *)serviceName serviceType:(SDLAppServiceType)serviceType serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest;

/**
* Unique name of this service.
*
@@ -116,12 +160,17 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *allowAppConsumers;

/**
* This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable.
*/
@property (nullable, strong, nonatomic) SDLMsgVersion *rpcSpecVersion;

/**
* This is the max RPC Spec version the app service understands. This is important during the RPC passthrough functionality. If not included, it is assumed the max version of the module is acceptable.
*
* SDLMsgVersion, Optional
*/
@property (nullable, strong, nonatomic) SDLMsgVersion *maxRPCSpecVersion;
@property (nullable, strong, nonatomic) SDLMsgVersion *maxRPCSpecVersion __deprecated_msg("Use rpcSpecVersion instead");

/**
* This field contains the Function IDs for the RPCs that this service intends to handle correctly. This means the service will provide meaningful responses. See FunctionID for enum equivalent values. This parameter is an integer to allow for new function IDs to be used by apps on older versions of SDL Core.
39 changes: 36 additions & 3 deletions SmartDeviceLink/public/SDLAppServiceManifest.m
Original file line number Diff line number Diff line change
@@ -21,6 +21,31 @@

@implementation SDLAppServiceManifest

- (instancetype)initWithServiceType:(NSString *)serviceType {
self = [self init];
if (!self) {
return nil;
}
self.serviceType = serviceType;
return self;
}

- (instancetype)initWithServiceType:(NSString *)serviceType serviceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(nullable NSNumber<SDLBool> *)allowAppConsumers rpcSpecVersion:(nullable SDLMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest {
self = [self initWithServiceType:serviceType];
if (!self) {
return nil;
}
self.serviceName = serviceName;
self.serviceIcon = serviceIcon;
self.allowAppConsumers = allowAppConsumers;
self.rpcSpecVersion = rpcSpecVersion;
self.handledRPCs = handledRPCs;
self.mediaServiceManifest = mediaServiceManifest;
self.weatherServiceManifest = weatherServiceManifest;
self.navigationServiceManifest = navigationServiceManifest;
return self;
}

- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType {
self = [super init];
if (!self) {
@@ -33,15 +58,15 @@ - (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType {
}

- (instancetype)initWithMediaServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest {
return [self initWithServiceName:serviceName serviceType:SDLAppServiceTypeMedia serviceIcon:serviceIcon allowAppConsumers:allowAppConsumers maxRPCSpecVersion:maxRPCSpecVersion handledRPCs:handledRPCs mediaServiceManifest:mediaServiceManifest weatherServiceManifest:nil navigationServiceManifest:nil];
return [self initWithServiceType:SDLAppServiceTypeMedia serviceName:serviceName serviceIcon:serviceIcon allowAppConsumers:@(allowAppConsumers) rpcSpecVersion:maxRPCSpecVersion handledRPCs:handledRPCs mediaServiceManifest:mediaServiceManifest weatherServiceManifest:nil navigationServiceManifest:nil];
}

- (instancetype)initWithWeatherServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest {
return [self initWithServiceName:serviceName serviceType:SDLAppServiceTypeWeather serviceIcon:serviceIcon allowAppConsumers:allowAppConsumers maxRPCSpecVersion:maxRPCSpecVersion handledRPCs:handledRPCs mediaServiceManifest:nil weatherServiceManifest:weatherServiceManifest navigationServiceManifest:nil];
return [self initWithServiceType:SDLAppServiceTypeMedia serviceName:serviceName serviceIcon:serviceIcon allowAppConsumers:@(allowAppConsumers) rpcSpecVersion:maxRPCSpecVersion handledRPCs:handledRPCs mediaServiceManifest:nil weatherServiceManifest:weatherServiceManifest navigationServiceManifest:nil];
}

- (instancetype)initWithNavigationServiceName:(nullable NSString *)serviceName serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest {
return [self initWithServiceName:serviceName serviceType:SDLAppServiceTypeNavigation serviceIcon:serviceIcon allowAppConsumers:allowAppConsumers maxRPCSpecVersion:maxRPCSpecVersion handledRPCs:handledRPCs mediaServiceManifest:nil weatherServiceManifest:nil navigationServiceManifest:navigationServiceManifest];
return [self initWithServiceType:SDLAppServiceTypeMedia serviceName:serviceName serviceIcon:serviceIcon allowAppConsumers:@(allowAppConsumers) rpcSpecVersion:maxRPCSpecVersion handledRPCs:handledRPCs mediaServiceManifest:nil weatherServiceManifest:nil navigationServiceManifest:navigationServiceManifest];
}

- (instancetype)initWithServiceName:(nullable NSString *)serviceName serviceType:(SDLAppServiceType)serviceType serviceIcon:(nullable SDLImage *)serviceIcon allowAppConsumers:(BOOL)allowAppConsumers maxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion handledRPCs:(nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest {
@@ -95,6 +120,14 @@ - (void)setAllowAppConsumers:(nullable NSNumber<SDLBool> *)allowAppConsumers {
return [self.store sdl_objectForName:SDLRPCParameterNameAllowAppConsumers ofClass:NSNumber.class error:nil];
}

- (void)setRpcSpecVersion:(nullable SDLMsgVersion *)rpcSpecVersion {
[self.store sdl_setObject:rpcSpecVersion forName:SDLRPCParameterNameRPCSpecVersion];
}

- (nullable SDLMsgVersion *)rpcSpecVersion {
return [self.store sdl_objectForName:SDLRPCParameterNameRPCSpecVersion ofClass:SDLMsgVersion.class error:nil];
}

- (void)setMaxRPCSpecVersion:(nullable SDLMsgVersion *)maxRPCSpecVersion {
[self.store sdl_setObject:maxRPCSpecVersion forName:SDLRPCParameterNameRPCSpecVersion];
}
38 changes: 31 additions & 7 deletions SmartDeviceLink/public/SDLAppServiceRecord.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
//
// SDLAppServiceRecord.h
// SmartDeviceLink
//
// Created by Nicole on 1/25/19.
// Copyright © 2019 smartdevicelink. All rights reserved.
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCRequest.h"

38 changes: 31 additions & 7 deletions SmartDeviceLink/public/SDLAppServicesCapabilities.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
//
// SDLAppServicesCapabilities.h
// SmartDeviceLink
//
// Created by Nicole on 1/30/19.
// Copyright © 2019 smartdevicelink. All rights reserved.
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCRequest.h"

55 changes: 51 additions & 4 deletions SmartDeviceLink/public/SDLAudioControlCapabilities.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLAudioControlCapabilities.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"
#import "SDLModuleInfo.h"
@@ -13,14 +42,32 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAudioControlCapabilities : SDLRPCStruct

/**
* @param moduleName - moduleName
* @return A SDLAudioControlCapabilities object
*/
- (instancetype)initWithModuleName:(NSString *)moduleName;

/**
* @param moduleName - moduleName
* @param moduleInfo - moduleInfo
* @param sourceAvailable - sourceAvailable
* @param keepContextAvailable - keepContextAvailable
* @param volumeAvailable - volumeAvailable
* @param equalizerAvailable - equalizerAvailable
* @param equalizerMaxChannelId - equalizerMaxChannelId
* @return A SDLAudioControlCapabilities object
*/
- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable keepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable volumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelId:(nullable NSNumber<SDLUInt> *)equalizerMaxChannelId;

/**
Constructs a newly allocated SDLAudioControlCapabilities object with audio control module name (max 100 chars)
@param name The short friendly name of the audio control module.
@param moduleInfo Information about a RC module, including its id.
@return An instance of the SDLAudioControlCapabilities class.
*/
- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo;
- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo __deprecated_msg("Use initWithModuleName: instead");

/**
Constructs a newly allocated SDLAudioControlCapabilities object with given parameters
@@ -33,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN
@param equalizerMaxChannelID Equalizer channel ID (between 1-100).
@return An instance of the SDLAudioControlCapabilities class.
*/
- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable keepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable volumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber<SDLInt> *)equalizerMaxChannelID;
- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable keepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable volumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber<SDLInt> *)equalizerMaxChannelID __deprecated_msg("Use initWithModuleName: instead");

/**
* @abstract The short friendly name of the audio control module.
23 changes: 23 additions & 0 deletions SmartDeviceLink/public/SDLAudioControlCapabilities.m
Original file line number Diff line number Diff line change
@@ -9,6 +9,29 @@

@implementation SDLAudioControlCapabilities

- (instancetype)initWithModuleName:(NSString *)moduleName {
self = [self init];
if (!self) {
return nil;
}
self.moduleName = moduleName;
return self;
}

- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable keepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable volumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelId:(nullable NSNumber<SDLUInt> *)equalizerMaxChannelId {
self = [self initWithModuleName:moduleName];
if (!self) {
return nil;
}
self.moduleInfo = moduleInfo;
self.sourceAvailable = sourceAvailable;
self.keepContextAvailable = keepContextAvailable;
self.volumeAvailable = volumeAvailable;
self.equalizerAvailable = equalizerAvailable;
self.equalizerMaxChannelId = equalizerMaxChannelId;
return self;
}

- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo {
self = [self init];
if (!self) {
36 changes: 32 additions & 4 deletions SmartDeviceLink/public/SDLAudioControlData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLAudioControlData.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"
#import "SDLPrimaryAudioSource.h"
@@ -15,7 +44,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLAudioControlData : SDLRPCStruct


/**
Constructs a newly allocated SDLAudioControlData object with given parameters
@@ -25,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
@param equalizerSettings list of supported Equalizer channels.
@return An instance of the SDLAudioControlData class.
*/
- (instancetype)initWithSource:(nullable SDLPrimaryAudioSource)source keepContext:(nullable NSNumber<SDLBool> *)keepContext volume:(nullable NSNumber<SDLInt> *)volume equalizerSettings:(nullable NSArray<SDLEqualizerSettings *> *)equalizerSettings;
- (instancetype)initWithSource:(nullable SDLPrimaryAudioSource)source keepContext:(nullable NSNumber<SDLBool> *)keepContext volume:(nullable NSNumber<SDLUInt> *)volume equalizerSettings:(nullable NSArray<SDLEqualizerSettings *> *)equalizerSettings;

/**
* @abstract In a getter response or a notification,
41 changes: 39 additions & 2 deletions SmartDeviceLink/public/SDLAudioPassThruCapabilities.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLAudioPassThruCapabilities.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"

@@ -18,6 +47,14 @@ NS_ASSUME_NONNULL_BEGIN

@interface SDLAudioPassThruCapabilities : SDLRPCStruct

/**
* @param samplingRate - samplingRate
* @param bitsPerSample - bitsPerSample
* @param audioType - audioType
* @return A SDLAudioPassThruCapabilities object
*/
- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType;

/**
The sampling rate for AudioPassThru
11 changes: 11 additions & 0 deletions SmartDeviceLink/public/SDLAudioPassThruCapabilities.m
Original file line number Diff line number Diff line change
@@ -11,6 +11,17 @@

@implementation SDLAudioPassThruCapabilities

- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType {
self = [self init];
if (!self) {
return nil;
}
self.samplingRate = samplingRate;
self.bitsPerSample = bitsPerSample;
self.audioType = audioType;
return self;
}

- (void)setSamplingRate:(SDLSamplingRate)samplingRate {
[self.store sdl_setObject:samplingRate forName:SDLRPCParameterNameSamplingRate];
}
53 changes: 51 additions & 2 deletions SmartDeviceLink/public/SDLBeltStatus.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLBeltStatus.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"

@@ -12,6 +41,26 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLBeltStatus : SDLRPCStruct

/**
* @param driverBeltDeployed - driverBeltDeployed
* @param passengerBeltDeployed - passengerBeltDeployed
* @param passengerBuckleBelted - passengerBuckleBelted
* @param driverBuckleBelted - driverBuckleBelted
* @param leftRow2BuckleBelted - leftRow2BuckleBelted
* @param passengerChildDetected - passengerChildDetected
* @param rightRow2BuckleBelted - rightRow2BuckleBelted
* @param middleRow2BuckleBelted - middleRow2BuckleBelted
* @param middleRow3BuckleBelted - middleRow3BuckleBelted
* @param leftRow3BuckleBelted - leftRow3BuckleBelted
* @param rightRow3BuckleBelted - rightRow3BuckleBelted
* @param leftRearInflatableBelted - leftRearInflatableBelted
* @param rightRearInflatableBelted - rightRearInflatableBelted
* @param middleRow1BeltDeployed - middleRow1BeltDeployed
* @param middleRow1BuckleBelted - middleRow1BuckleBelted
* @return A SDLBeltStatus object
*/
- (instancetype)initWithDriverBeltDeployed:(SDLVehicleDataEventStatus)driverBeltDeployed passengerBeltDeployed:(SDLVehicleDataEventStatus)passengerBeltDeployed passengerBuckleBelted:(SDLVehicleDataEventStatus)passengerBuckleBelted driverBuckleBelted:(SDLVehicleDataEventStatus)driverBuckleBelted leftRow2BuckleBelted:(SDLVehicleDataEventStatus)leftRow2BuckleBelted passengerChildDetected:(SDLVehicleDataEventStatus)passengerChildDetected rightRow2BuckleBelted:(SDLVehicleDataEventStatus)rightRow2BuckleBelted middleRow2BuckleBelted:(SDLVehicleDataEventStatus)middleRow2BuckleBelted middleRow3BuckleBelted:(SDLVehicleDataEventStatus)middleRow3BuckleBelted leftRow3BuckleBelted:(SDLVehicleDataEventStatus)leftRow3BuckleBelted rightRow3BuckleBelted:(SDLVehicleDataEventStatus)rightRow3BuckleBelted leftRearInflatableBelted:(SDLVehicleDataEventStatus)leftRearInflatableBelted rightRearInflatableBelted:(SDLVehicleDataEventStatus)rightRearInflatableBelted middleRow1BeltDeployed:(SDLVehicleDataEventStatus)middleRow1BeltDeployed middleRow1BuckleBelted:(SDLVehicleDataEventStatus)middleRow1BuckleBelted;

/**
References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.
23 changes: 23 additions & 0 deletions SmartDeviceLink/public/SDLBeltStatus.m
Original file line number Diff line number Diff line change
@@ -11,6 +11,29 @@

@implementation SDLBeltStatus

- (instancetype)initWithDriverBeltDeployed:(SDLVehicleDataEventStatus)driverBeltDeployed passengerBeltDeployed:(SDLVehicleDataEventStatus)passengerBeltDeployed passengerBuckleBelted:(SDLVehicleDataEventStatus)passengerBuckleBelted driverBuckleBelted:(SDLVehicleDataEventStatus)driverBuckleBelted leftRow2BuckleBelted:(SDLVehicleDataEventStatus)leftRow2BuckleBelted passengerChildDetected:(SDLVehicleDataEventStatus)passengerChildDetected rightRow2BuckleBelted:(SDLVehicleDataEventStatus)rightRow2BuckleBelted middleRow2BuckleBelted:(SDLVehicleDataEventStatus)middleRow2BuckleBelted middleRow3BuckleBelted:(SDLVehicleDataEventStatus)middleRow3BuckleBelted leftRow3BuckleBelted:(SDLVehicleDataEventStatus)leftRow3BuckleBelted rightRow3BuckleBelted:(SDLVehicleDataEventStatus)rightRow3BuckleBelted leftRearInflatableBelted:(SDLVehicleDataEventStatus)leftRearInflatableBelted rightRearInflatableBelted:(SDLVehicleDataEventStatus)rightRearInflatableBelted middleRow1BeltDeployed:(SDLVehicleDataEventStatus)middleRow1BeltDeployed middleRow1BuckleBelted:(SDLVehicleDataEventStatus)middleRow1BuckleBelted {
self = [self init];
if (!self) {
return nil;
}
self.driverBeltDeployed = driverBeltDeployed;
self.passengerBeltDeployed = passengerBeltDeployed;
self.passengerBuckleBelted = passengerBuckleBelted;
self.driverBuckleBelted = driverBuckleBelted;
self.leftRow2BuckleBelted = leftRow2BuckleBelted;
self.passengerChildDetected = passengerChildDetected;
self.rightRow2BuckleBelted = rightRow2BuckleBelted;
self.middleRow2BuckleBelted = middleRow2BuckleBelted;
self.middleRow3BuckleBelted = middleRow3BuckleBelted;
self.leftRow3BuckleBelted = leftRow3BuckleBelted;
self.rightRow3BuckleBelted = rightRow3BuckleBelted;
self.leftRearInflatableBelted = leftRearInflatableBelted;
self.rightRearInflatableBelted = rightRearInflatableBelted;
self.middleRow1BeltDeployed = middleRow1BeltDeployed;
self.middleRow1BuckleBelted = middleRow1BuckleBelted;
return self;
}

- (void)setDriverBeltDeployed:(SDLVehicleDataEventStatus)driverBeltDeployed {
[self.store sdl_setObject:driverBeltDeployed forName:SDLRPCParameterNameDriverBeltDeployed];
}
53 changes: 51 additions & 2 deletions SmartDeviceLink/public/SDLBodyInformation.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLBodyInformation.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"

@@ -15,6 +44,26 @@ NS_ASSUME_NONNULL_BEGIN

@interface SDLBodyInformation : SDLRPCStruct

/**
* @param parkBrakeActive - @(parkBrakeActive)
* @param ignitionStableStatus - ignitionStableStatus
* @param ignitionStatus - ignitionStatus
* @return A SDLBodyInformation object
*/
- (instancetype)initWithParkBrakeActive:(BOOL)parkBrakeActive ignitionStableStatus:(SDLIgnitionStableStatus)ignitionStableStatus ignitionStatus:(SDLIgnitionStatus)ignitionStatus;

/**
* @param parkBrakeActive - @(parkBrakeActive)
* @param ignitionStableStatus - ignitionStableStatus
* @param ignitionStatus - ignitionStatus
* @param driverDoorAjar - driverDoorAjar
* @param passengerDoorAjar - passengerDoorAjar
* @param rearLeftDoorAjar - rearLeftDoorAjar
* @param rearRightDoorAjar - rearRightDoorAjar
* @return A SDLBodyInformation object
*/
- (instancetype)initWithParkBrakeActive:(BOOL)parkBrakeActive ignitionStableStatus:(SDLIgnitionStableStatus)ignitionStableStatus ignitionStatus:(SDLIgnitionStatus)ignitionStatus driverDoorAjar:(nullable NSNumber<SDLBool> *)driverDoorAjar passengerDoorAjar:(nullable NSNumber<SDLBool> *)passengerDoorAjar rearLeftDoorAjar:(nullable NSNumber<SDLBool> *)rearLeftDoorAjar rearRightDoorAjar:(nullable NSNumber<SDLBool> *)rearRightDoorAjar;

/**
* References signal "PrkBrkActv_B_Actl".
23 changes: 23 additions & 0 deletions SmartDeviceLink/public/SDLBodyInformation.m
Original file line number Diff line number Diff line change
@@ -13,6 +13,29 @@

@implementation SDLBodyInformation

- (instancetype)initWithParkBrakeActive:(BOOL)parkBrakeActive ignitionStableStatus:(SDLIgnitionStableStatus)ignitionStableStatus ignitionStatus:(SDLIgnitionStatus)ignitionStatus {
self = [self init];
if (!self) {
return nil;
}
self.parkBrakeActive = @(parkBrakeActive);
self.ignitionStableStatus = ignitionStableStatus;
self.ignitionStatus = ignitionStatus;
return self;
}

- (instancetype)initWithParkBrakeActive:(BOOL)parkBrakeActive ignitionStableStatus:(SDLIgnitionStableStatus)ignitionStableStatus ignitionStatus:(SDLIgnitionStatus)ignitionStatus driverDoorAjar:(nullable NSNumber<SDLBool> *)driverDoorAjar passengerDoorAjar:(nullable NSNumber<SDLBool> *)passengerDoorAjar rearLeftDoorAjar:(nullable NSNumber<SDLBool> *)rearLeftDoorAjar rearRightDoorAjar:(nullable NSNumber<SDLBool> *)rearRightDoorAjar {
self = [self initWithParkBrakeActive:parkBrakeActive ignitionStableStatus:ignitionStableStatus ignitionStatus:ignitionStatus];
if (!self) {
return nil;
}
self.driverDoorAjar = driverDoorAjar;
self.passengerDoorAjar = passengerDoorAjar;
self.rearLeftDoorAjar = rearLeftDoorAjar;
self.rearRightDoorAjar = rearRightDoorAjar;
return self;
}

- (void)setParkBrakeActive:(NSNumber<SDLBool> *)parkBrakeActive {
[self.store sdl_setObject:parkBrakeActive forName:SDLRPCParameterNameParkBrakeActive];
}
59 changes: 56 additions & 3 deletions SmartDeviceLink/public/SDLButtonCapabilities.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLButtonCapabilities.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"

@@ -17,12 +46,36 @@ NS_ASSUME_NONNULL_BEGIN

@interface SDLButtonCapabilities : SDLRPCStruct

/**
* @param nameParam - nameParam
* @param shortPressAvailable - @(shortPressAvailable)
* @param longPressAvailable - @(longPressAvailable)
* @param upDownAvailable - @(upDownAvailable)
* @return A SDLButtonCapabilities object
*/
- (instancetype)initWithNameParam:(SDLButtonName)nameParam shortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable;

/**
* @param nameParam - nameParam
* @param shortPressAvailable - @(shortPressAvailable)
* @param longPressAvailable - @(longPressAvailable)
* @param upDownAvailable - @(upDownAvailable)
* @param moduleInfo - moduleInfo
* @return A SDLButtonCapabilities object
*/
- (instancetype)initWithNameParam:(SDLButtonName)nameParam shortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable moduleInfo:(nullable SDLModuleInfo *)moduleInfo;

/**
* The name of the button. See ButtonName.
*/
@property (strong, nonatomic) SDLButtonName nameParam;

/**
* The name of the SDL HMI button.
Required
*/
@property (strong, nonatomic) SDLButtonName name;
@property (strong, nonatomic) SDLButtonName name __deprecated_msg("Use nameParam instead");

/**
* A NSNumber value indicates whether the button supports a SHORT press
30 changes: 30 additions & 0 deletions SmartDeviceLink/public/SDLButtonCapabilities.m
Original file line number Diff line number Diff line change
@@ -10,6 +10,36 @@

@implementation SDLButtonCapabilities

- (instancetype)initWithNameParam:(SDLButtonName)nameParam shortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable {
self = [self init];
if (!self) {
return nil;
}
self.nameParam = nameParam;
self.shortPressAvailable = @(shortPressAvailable);
self.longPressAvailable = @(longPressAvailable);
self.upDownAvailable = @(upDownAvailable);
return self;
}

- (instancetype)initWithNameParam:(SDLButtonName)nameParam shortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable moduleInfo:(nullable SDLModuleInfo *)moduleInfo {
self = [self initWithNameParam:nameParam shortPressAvailable:shortPressAvailable longPressAvailable:longPressAvailable upDownAvailable:upDownAvailable];
if (!self) {
return nil;
}
self.moduleInfo = moduleInfo;
return self;
}

- (void)setNameParam:(SDLButtonName)nameParam {
[self.store sdl_setObject:nameParam forName:SDLRPCParameterNameName];
}

- (SDLButtonName)nameParam {
NSError *error = nil;
return [self.store sdl_enumForName:SDLRPCParameterNameName error:&error];
}

- (void)setName:(SDLButtonName)name {
[self.store sdl_setObject:name forName:SDLRPCParameterNameName];
}
53 changes: 49 additions & 4 deletions SmartDeviceLink/public/SDLButtonPress.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
//
// SDLButtonPress.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCRequest.h"
#import "SDLModuleType.h"
@@ -16,6 +44,23 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLButtonPress : SDLRPCRequest

/**
* @param moduleType - moduleType
* @param buttonName - buttonName
* @param buttonPressMode - buttonPressMode
* @return A SDLButtonPress object
*/
- (instancetype)initWithModuleType:(SDLModuleType)moduleType buttonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode;

/**
* @param moduleType - moduleType
* @param buttonName - buttonName
* @param buttonPressMode - buttonPressMode
* @param moduleId - moduleId
* @return A SDLButtonPress object
*/
- (instancetype)initWithModuleType:(SDLModuleType)moduleType buttonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode moduleId:(nullable NSString *)moduleId;

/**
Constructs a newly allocated SDLButtonPress object with the given parameters
@@ -26,7 +71,7 @@ Constructs a newly allocated SDLButtonPress object with the given parameters
@return An instance of the SDLButtonPress class.
*/
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId buttonPressMode:(SDLButtonPressMode)buttonPressMode;
- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId buttonPressMode:(SDLButtonPressMode)buttonPressMode __deprecated_msg("Use initWithModuleType:buttonName:buttonPressMode:moduleId instead");

/**
* The module where the button should be pressed.
20 changes: 20 additions & 0 deletions SmartDeviceLink/public/SDLButtonPress.m
Original file line number Diff line number Diff line change
@@ -20,6 +20,26 @@ - (instancetype)init {
}
#pragma clang diagnostic pop

- (instancetype)initWithModuleType:(SDLModuleType)moduleType buttonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode {
self = [self init];
if (!self) {
return nil;
}
self.moduleType = moduleType;
self.buttonName = buttonName;
self.buttonPressMode = buttonPressMode;
return self;
}

- (instancetype)initWithModuleType:(SDLModuleType)moduleType buttonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode moduleId:(nullable NSString *)moduleId {
self = [self initWithModuleType:moduleType buttonName:buttonName buttonPressMode:buttonPressMode];
if (!self) {
return nil;
}
self.moduleId = moduleId;
return self;
}

- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId buttonPressMode:(SDLButtonPressMode)buttonPressMode {
self = [self init];
if (!self) {
25 changes: 22 additions & 3 deletions SmartDeviceLink/public/SDLCancelInteraction.h
Original file line number Diff line number Diff line change
@@ -41,13 +41,26 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLCancelInteraction : SDLRPCRequest

/**
* @param functionIDParam - @(functionIDParam)
* @return A SDLCancelInteraction object
*/
- (instancetype)initWithFunctionIDParam:(UInt32)functionIDParam;

/**
* @param functionIDParam - @(functionIDParam)
* @param cancelID - cancelID
* @return A SDLCancelInteraction object
*/
- (instancetype)initWithFunctionIDParam:(UInt32)functionIDParam cancelID:(nullable NSNumber<SDLInt> *)cancelID;

/**
Convenience init for dismissing the currently presented modal view (either an alert, slider, scrollable message, or perform interation).
@param functionID The ID of the type of modal view to dismiss
@return A SDLCancelInteraction object
*/
- (instancetype)initWithFunctionID:(UInt32)functionID;
- (instancetype)initWithFunctionID:(UInt32)functionID __deprecated_msg("Use initWithFunctionIDParam: instead");

/**
Convenience init for dismissing a specific view.
@@ -56,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN
@param cancelID The ID of the specific interaction to dismiss
@return A SDLCancelInteraction object
*/
- (instancetype)initWithFunctionID:(UInt32)functionID cancelID:(UInt32)cancelID;
- (instancetype)initWithFunctionID:(UInt32)functionID cancelID:(UInt32)cancelID __deprecated_msg("Use initWithFunctionIDParam:cancelID: instead");

/**
Convenience init for dismissing an alert.
@@ -140,14 +153,20 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSNumber<SDLInt> *cancelID;

/**
* The ID of the type of interaction the developer wants to dismiss. Only values 10, (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), 26 (SliderID), and 64 (SubtleAlertID) are permitted.
* {"num_min_value": null, "num_max_value": null}
*/
@property (strong, nonatomic) NSNumber<SDLInt> *functionIDParam;

/**
The ID of the type of interaction to dismiss.
The ID of the type of interaction the developer wants to dismiss. Only values 10, (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), 26 (SliderID), and 64 (SubtleAlertID) are permitted.
Integer, Required
*/
@property (strong, nonatomic) NSNumber<SDLInt> *functionID;
@property (strong, nonatomic) NSNumber<SDLInt> *functionID __deprecated_msg("Use functionIDParam instead");

@end

46 changes: 36 additions & 10 deletions SmartDeviceLink/public/SDLCancelInteraction.m
Original file line number Diff line number Diff line change
@@ -50,6 +50,23 @@ - (instancetype)init {
}
#pragma clang diagnostic pop

- (instancetype)initWithFunctionIDParam:(UInt32)functionIDParam {
self = [self init];
if (!self) {
return nil;
}
self.functionIDParam = @(functionIDParam);
return self;
}

- (instancetype)initWithFunctionIDParam:(UInt32)functionIDParam cancelID:(nullable NSNumber<SDLInt> *)cancelID {
self = [self initWithFunctionIDParam:functionIDParam];
if (!self) {
return nil;
}
self.cancelID = cancelID;
return self;
}

- (instancetype)initWithFunctionID:(UInt32)functionID {
self = [self init];
@@ -74,43 +91,43 @@ - (instancetype)initWithFunctionID:(UInt32)functionID cancelID:(UInt32)cancelID
}

- (instancetype)initWithAlertCancelID:(UInt32)cancelID {
return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert].unsignedIntValue cancelID:cancelID];
return [self initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert].unsignedIntValue cancelID:@(cancelID)];
}

- (instancetype)initWithSliderCancelID:(UInt32)cancelID {
return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider].unsignedIntValue cancelID:cancelID];
return [self initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider].unsignedIntValue cancelID:@(cancelID)];
}

- (instancetype)initWithScrollableMessageCancelID:(UInt32)cancelID {
return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage].unsignedIntValue cancelID:cancelID];
return [self initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage].unsignedIntValue cancelID:@(cancelID)];
}

- (instancetype)initWithPerformInteractionCancelID:(UInt32)cancelID {
return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue cancelID:cancelID];
return [self initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue cancelID:@(cancelID)];
}

- (instancetype)initWithSubtleAlertCancelID:(UInt32)cancelID {
return [self initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSubtleAlert].unsignedIntValue cancelID:cancelID];
return [self initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSubtleAlert].unsignedIntValue cancelID:@(cancelID)];
}

+ (instancetype)alert {
return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert].unsignedIntValue];
return [[self alloc] initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameAlert].unsignedIntValue];
}

+ (instancetype)slider {
return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider].unsignedIntValue];
return [[self alloc] initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSlider].unsignedIntValue];
}

+ (instancetype)scrollableMessage {
return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage].unsignedIntValue];
return [[self alloc] initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameScrollableMessage].unsignedIntValue];
}

+ (instancetype)performInteraction {
return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue];
return [[self alloc] initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNamePerformInteraction].unsignedIntValue];
}

+ (instancetype)subtleAlert {
return [[self alloc] initWithFunctionID:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSubtleAlert].unsignedIntValue];
return [[self alloc] initWithFunctionIDParam:[SDLFunctionID.sharedInstance functionIdForName:SDLRPCFunctionNameSubtleAlert].unsignedIntValue];
}

- (void)setCancelID:(nullable NSNumber<SDLInt> *)cancelID {
@@ -121,6 +138,15 @@ - (void)setCancelID:(nullable NSNumber<SDLInt> *)cancelID {
return [self.parameters sdl_objectForName:SDLRPCParameterNameCancelID ofClass:NSNumber.class error:nil];
}

- (void)setFunctionIDParam:(NSNumber<SDLInt> *)functionIDParam {
[self.parameters sdl_setObject:functionIDParam forName:SDLRPCParameterNameFunctionID];
}

- (NSNumber<SDLInt> *)functionIDParam {
NSError *error = nil;
return [self.parameters sdl_objectForName:SDLRPCParameterNameFunctionID ofClass:NSNumber.class error:&error];
}

- (void)setFunctionID:(NSNumber<SDLInt> *)functionID {
[self.parameters sdl_setObject:functionID forName:SDLRPCParameterNameFunctionID];
}
38 changes: 33 additions & 5 deletions SmartDeviceLink/public/SDLChangeRegistration.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
// SDLChangeRegistration.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/


#import "SDLRPCRequest.h"
#import "SDLLanguage.h"

@class SDLTTSChunk;

NS_ASSUME_NONNULL_BEGIN

/**
* If the app recognizes during the app registration that the SDL HMI language (voice/TTS and/or display) does not match the app language, the app will be able (but does not need) to change this registration with changeRegistration prior to app being brought into focus.
*
* Any HMILevel allowed
*
* @since SDL 2.0
*/

NS_ASSUME_NONNULL_BEGIN

@interface SDLChangeRegistration : SDLRPCRequest

/**
56 changes: 52 additions & 4 deletions SmartDeviceLink/public/SDLChoice.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// SDLChoice.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"

@@ -15,6 +44,25 @@ NS_ASSUME_NONNULL_BEGIN

@interface SDLChoice : SDLRPCStruct

/**
* @param choiceID - @(choiceID)
* @param menuName - menuName
* @return A SDLChoice object
*/
- (instancetype)initWithChoiceID:(UInt16)choiceID menuName:(NSString *)menuName;

/**
* @param choiceID - @(choiceID)
* @param menuName - menuName
* @param vrCommands - vrCommands
* @param image - image
* @param secondaryText - secondaryText
* @param tertiaryText - tertiaryText
* @param secondaryImage - secondaryImage
* @return A SDLChoice object
*/
- (instancetype)initWithChoiceID:(UInt16)choiceID menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands image:(nullable SDLImage *)image secondaryText:(nullable NSString *)secondaryText tertiaryText:(nullable NSString *)tertiaryText secondaryImage:(nullable SDLImage *)secondaryImage;

/**
Constructs a newly allocated SDLChangeRegistration object with the required parameters
@@ -24,7 +72,7 @@ Constructs a newly allocated SDLChangeRegistration object with the required para
@return An instance of the SDLChangeRegistration class.
*/
- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands;
- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands __deprecated_msg("Use initWithChoiceID:menuName: instead");

/**
Constructs a newly allocated SDLChangeRegistration object with all parameters
@@ -39,7 +87,7 @@ Constructs a newly allocated SDLChangeRegistration object with all parameters
@return An instance of the SDLChangeRegistration class.
*/
- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands image:(nullable SDLImage *)image secondaryText:(nullable NSString *)secondaryText secondaryImage:(nullable SDLImage *)secondaryImage tertiaryText:(nullable NSString *)tertiaryText;
- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands image:(nullable SDLImage *)image secondaryText:(nullable NSString *)secondaryText secondaryImage:(nullable SDLImage *)secondaryImage tertiaryText:(nullable NSString *)tertiaryText __deprecated_msg("Use initWithChoiceID:menuName: instead");

/**
* The application-scoped identifier that uniquely identifies this choice
23 changes: 23 additions & 0 deletions SmartDeviceLink/public/SDLChoice.m
Original file line number Diff line number Diff line change
@@ -11,6 +11,29 @@

@implementation SDLChoice

- (instancetype)initWithChoiceID:(UInt16)choiceID menuName:(NSString *)menuName {
self = [self init];
if (!self) {
return nil;
}
self.choiceID = @(choiceID);
self.menuName = menuName;
return self;
}

- (instancetype)initWithChoiceID:(UInt16)choiceID menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands image:(nullable SDLImage *)image secondaryText:(nullable NSString *)secondaryText tertiaryText:(nullable NSString *)tertiaryText secondaryImage:(nullable SDLImage *)secondaryImage {
self = [self initWithChoiceID:choiceID menuName:menuName];
if (!self) {
return nil;
}
self.vrCommands = vrCommands;
self.image = image;
self.secondaryText = secondaryText;
self.tertiaryText = tertiaryText;
self.secondaryImage = secondaryImage;
return self;
}

- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(nullable NSArray<NSString *> *)vrCommands image:(nullable SDLImage *)image secondaryText:(nullable NSString *)secondaryText secondaryImage:(nullable SDLImage *)secondaryImage tertiaryText:(nullable NSString *)tertiaryText {
self = [self initWithId:choiceId menuName:menuName vrCommands:vrCommands];
if (!self) {
73 changes: 69 additions & 4 deletions SmartDeviceLink/public/SDLClimateControlCapabilities.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
//
// SDLClimateControlCapabilities.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"
#import "SDLDefrostZone.h"
@@ -14,6 +42,36 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLClimateControlCapabilities : SDLRPCStruct

/**
* @param moduleName - moduleName
* @return A SDLClimateControlCapabilities object
*/
- (instancetype)initWithModuleName:(NSString *)moduleName;

/**
* @param moduleName - moduleName
* @param moduleInfo - moduleInfo
* @param currentTemperatureAvailable - currentTemperatureAvailable
* @param fanSpeedAvailable - fanSpeedAvailable
* @param desiredTemperatureAvailable - desiredTemperatureAvailable
* @param acEnableAvailable - acEnableAvailable
* @param acMaxEnableAvailable - acMaxEnableAvailable
* @param circulateAirEnableAvailable - circulateAirEnableAvailable
* @param autoModeEnableAvailable - autoModeEnableAvailable
* @param dualModeEnableAvailable - dualModeEnableAvailable
* @param defrostZoneAvailable - defrostZoneAvailable
* @param defrostZone - defrostZone
* @param ventilationModeAvailable - ventilationModeAvailable
* @param ventilationMode - ventilationMode
* @param heatedSteeringWheelAvailable - heatedSteeringWheelAvailable
* @param heatedWindshieldAvailable - heatedWindshieldAvailable
* @param heatedRearWindowAvailable - heatedRearWindowAvailable
* @param heatedMirrorsAvailable - heatedMirrorsAvailable
* @param climateEnableAvailable - climateEnableAvailable
* @return A SDLClimateControlCapabilities object
*/
- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo currentTemperatureAvailable:(nullable NSNumber<SDLBool> *)currentTemperatureAvailable fanSpeedAvailable:(nullable NSNumber<SDLBool> *)fanSpeedAvailable desiredTemperatureAvailable:(nullable NSNumber<SDLBool> *)desiredTemperatureAvailable acEnableAvailable:(nullable NSNumber<SDLBool> *)acEnableAvailable acMaxEnableAvailable:(nullable NSNumber<SDLBool> *)acMaxEnableAvailable circulateAirEnableAvailable:(nullable NSNumber<SDLBool> *)circulateAirEnableAvailable autoModeEnableAvailable:(nullable NSNumber<SDLBool> *)autoModeEnableAvailable dualModeEnableAvailable:(nullable NSNumber<SDLBool> *)dualModeEnableAvailable defrostZoneAvailable:(nullable NSNumber<SDLBool> *)defrostZoneAvailable defrostZone:(nullable NSArray<SDLDefrostZone> *)defrostZone ventilationModeAvailable:(nullable NSNumber<SDLBool> *)ventilationModeAvailable ventilationMode:(nullable NSArray<SDLVentilationMode> *)ventilationMode heatedSteeringWheelAvailable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelAvailable heatedWindshieldAvailable:(nullable NSNumber<SDLBool> *)heatedWindshieldAvailable heatedRearWindowAvailable:(nullable NSNumber<SDLBool> *)heatedRearWindowAvailable heatedMirrorsAvailable:(nullable NSNumber<SDLBool> *)heatedMirrorsAvailable climateEnableAvailable:(nullable NSNumber<SDLBool> *)climateEnableAvailable;

/// Convenience init to describe the climate control capabilities with all properities.
///
/// @param moduleName The short friendly name of the climate control module.
@@ -33,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param heatedMirrorsAvailable Availability of the control (enable/disable) of heated Mirrors
/// @param climateEnableAvailable Availability of the control of enable/disable climate control
/// @return An SDLClimateControlCapabilities object
- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable;
- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable __deprecated_msg("Use initWithModuleName: instead");

/**
* The short friendly name of the climate control module.
@@ -53,6 +111,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fanSpeedAvailable;

/**
* Availability of the reading of current temperature. True: Available, False: Not Available, Not present: Not Available.
*
* @added in SmartDeviceLink 5.0.0
*/
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *currentTemperatureAvailable;

/**
* Availability of the control of desired temperature.
* True: Available, False: Not Available, Not present: Not Available.
43 changes: 43 additions & 0 deletions SmartDeviceLink/public/SDLClimateControlCapabilities.m
Original file line number Diff line number Diff line change
@@ -10,6 +10,41 @@

@implementation SDLClimateControlCapabilities

- (instancetype)initWithModuleName:(NSString *)moduleName {
self = [self init];
if (!self) {
return nil;
}
self.moduleName = moduleName;
return self;
}

- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo currentTemperatureAvailable:(nullable NSNumber<SDLBool> *)currentTemperatureAvailable fanSpeedAvailable:(nullable NSNumber<SDLBool> *)fanSpeedAvailable desiredTemperatureAvailable:(nullable NSNumber<SDLBool> *)desiredTemperatureAvailable acEnableAvailable:(nullable NSNumber<SDLBool> *)acEnableAvailable acMaxEnableAvailable:(nullable NSNumber<SDLBool> *)acMaxEnableAvailable circulateAirEnableAvailable:(nullable NSNumber<SDLBool> *)circulateAirEnableAvailable autoModeEnableAvailable:(nullable NSNumber<SDLBool> *)autoModeEnableAvailable dualModeEnableAvailable:(nullable NSNumber<SDLBool> *)dualModeEnableAvailable defrostZoneAvailable:(nullable NSNumber<SDLBool> *)defrostZoneAvailable defrostZone:(nullable NSArray<SDLDefrostZone> *)defrostZone ventilationModeAvailable:(nullable NSNumber<SDLBool> *)ventilationModeAvailable ventilationMode:(nullable NSArray<SDLVentilationMode> *)ventilationMode heatedSteeringWheelAvailable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelAvailable heatedWindshieldAvailable:(nullable NSNumber<SDLBool> *)heatedWindshieldAvailable heatedRearWindowAvailable:(nullable NSNumber<SDLBool> *)heatedRearWindowAvailable heatedMirrorsAvailable:(nullable NSNumber<SDLBool> *)heatedMirrorsAvailable climateEnableAvailable:(nullable NSNumber<SDLBool> *)climateEnableAvailable {
self = [self initWithModuleName:moduleName];
if (!self) {
return nil;
}
self.moduleInfo = moduleInfo;
self.currentTemperatureAvailable = currentTemperatureAvailable;
self.fanSpeedAvailable = fanSpeedAvailable;
self.desiredTemperatureAvailable = desiredTemperatureAvailable;
self.acEnableAvailable = acEnableAvailable;
self.acMaxEnableAvailable = acMaxEnableAvailable;
self.circulateAirEnableAvailable = circulateAirEnableAvailable;
self.autoModeEnableAvailable = autoModeEnableAvailable;
self.dualModeEnableAvailable = dualModeEnableAvailable;
self.defrostZoneAvailable = defrostZoneAvailable;
self.defrostZone = defrostZone;
self.ventilationModeAvailable = ventilationModeAvailable;
self.ventilationMode = ventilationMode;
self.heatedSteeringWheelAvailable = heatedSteeringWheelAvailable;
self.heatedWindshieldAvailable = heatedWindshieldAvailable;
self.heatedRearWindowAvailable = heatedRearWindowAvailable;
self.heatedMirrorsAvailable = heatedMirrorsAvailable;
self.climateEnableAvailable = climateEnableAvailable;
return self;
}

- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)steeringWheelAvailable heatedWindshieldAvailable:(BOOL)windshieldAvailable heatedRearWindowAvailable:(BOOL)rearWindowAvailable heatedMirrorsAvailable:(BOOL)mirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable{
self = [self init];
if (!self) {
@@ -52,6 +87,14 @@ - (void)setFanSpeedAvailable:(nullable NSNumber<SDLBool> *)fanSpeedAvailable {
return [self.store sdl_objectForName:SDLRPCParameterNameFanSpeedAvailable ofClass:NSNumber.class error:nil];
}

- (void)setCurrentTemperatureAvailable:(nullable NSNumber<SDLBool> *)currentTemperatureAvailable {
[self.store sdl_setObject:currentTemperatureAvailable forName:SDLRPCParameterNameCurrentTemperatureAvailable];
}

- (nullable NSNumber<SDLBool> *)currentTemperatureAvailable {
return [self.store sdl_objectForName:SDLRPCParameterNameCurrentTemperatureAvailable ofClass:NSNumber.class error:nil];
}

- (void)setDesiredTemperatureAvailable:(nullable NSNumber<SDLBool> *)desiredTemperatureAvailable {
[self.store sdl_setObject:desiredTemperatureAvailable forName:SDLRPCParameterNameDesiredTemperatureAvailable];
}
56 changes: 52 additions & 4 deletions SmartDeviceLink/public/SDLClimateControlData.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
//
// SDLClimateControlData.h
//
/*
* Copyright (c) 2020, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#import "SDLRPCMessage.h"
#import "SDLDefrostZone.h"
@@ -16,6 +44,26 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface SDLClimateControlData : SDLRPCStruct

/**
* @param fanSpeed - fanSpeed
* @param currentTemperature - currentTemperature
* @param desiredTemperature - desiredTemperature
* @param acEnable - acEnable
* @param circulateAirEnable - circulateAirEnable
* @param autoModeEnable - autoModeEnable
* @param defrostZone - defrostZone
* @param dualModeEnable - dualModeEnable
* @param acMaxEnable - acMaxEnable
* @param ventilationMode - ventilationMode
* @param heatedSteeringWheelEnable - heatedSteeringWheelEnable
* @param heatedWindshieldEnable - heatedWindshieldEnable
* @param heatedRearWindowEnable - heatedRearWindowEnable
* @param heatedMirrorsEnable - heatedMirrorsEnable
* @param climateEnable - climateEnable
* @return A SDLClimateControlData object
*/
- (instancetype)initWithFanSpeed:(nullable NSNumber<SDLUInt> *)fanSpeed currentTemperature:(nullable SDLTemperature *)currentTemperature desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber<SDLBool> *)acEnable circulateAirEnable:(nullable NSNumber<SDLBool> *)circulateAirEnable autoModeEnable:(nullable NSNumber<SDLBool> *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber<SDLBool> *)dualModeEnable acMaxEnable:(nullable NSNumber<SDLBool> *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber<SDLBool> *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber<SDLBool> *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber<SDLBool> *)heatedMirrorsEnable climateEnable:(nullable NSNumber<SDLBool> *)climateEnable;

/// Convenience init for climate control data with all properties.
/// @param fanSpeed Speed of Fan in integer
/// @param desiredTemperature Desired Temperature in SDLTemperature
@@ -32,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param heatedMirrorsEnable Represents if heated mirrors are enabled
/// @param climateEnable Represents if climate is enabled
/// @return An SDLClimateControlData object
- (instancetype)initWithFanSpeed:(nullable NSNumber<SDLInt> *)fanSpeed desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber<SDLBool> *)acEnable circulateAirEnable:(nullable NSNumber<SDLBool> *)circulateAirEnable autoModeEnable:(nullable NSNumber<SDLBool> *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber<SDLBool> *)dualModeEnable acMaxEnable:(nullable NSNumber<SDLBool> *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber<SDLBool> *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber<SDLBool> *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber<SDLBool> *)heatedMirrorsEnable climateEnable:(nullable NSNumber<SDLBool> *)climateEnable;
- (instancetype)initWithFanSpeed:(nullable NSNumber<SDLInt> *)fanSpeed desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber<SDLBool> *)acEnable circulateAirEnable:(nullable NSNumber<SDLBool> *)circulateAirEnable autoModeEnable:(nullable NSNumber<SDLBool> *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber<SDLBool> *)dualModeEnable acMaxEnable:(nullable NSNumber<SDLBool> *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber<SDLBool> *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber<SDLBool> *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber<SDLBool> *)heatedMirrorsEnable climateEnable:(nullable NSNumber<SDLBool> *)climateEnable __deprecated_msg("Use initWithFanSpeed:currentTemperature:desiredTemperature:acEnable:circulateAirEnable:autoModeEnable:defrostZone:dualModeEnable:acMaxEnable:ventilationMode:heatedSteeringWheelEnable:heatedWindshieldEnable:heatedRearWindowEnable:heatedMirrorsEnable:climateEnable:");

/**
* Speed of Fan in integer
Loading