diff --git a/.gitignore b/.gitignore index cd964170f3..a548a5e567 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ DerivedData *.hmap *.ipa *.xcuserstate +output/ # OS generated files # ###################### diff --git a/SmartDeviceLink/private/SDLRPCParameterNames.h b/SmartDeviceLink/private/SDLRPCParameterNames.h index 7222039dee..09354546c2 100644 --- a/SmartDeviceLink/private/SDLRPCParameterNames.h +++ b/SmartDeviceLink/private/SDLRPCParameterNames.h @@ -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; diff --git a/SmartDeviceLink/private/SDLRPCParameterNames.m b/SmartDeviceLink/private/SDLRPCParameterNames.m index 353b4d7793..b7841b4f7d 100644 --- a/SmartDeviceLink/private/SDLRPCParameterNames.m +++ b/SmartDeviceLink/private/SDLRPCParameterNames.m @@ -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"; diff --git a/SmartDeviceLink/public/SDLAddCommand.h b/SmartDeviceLink/public/SDLAddCommand.h index ea59689700..21394eb343 100644 --- a/SmartDeviceLink/public/SDLAddCommand.h +++ b/SmartDeviceLink/public/SDLAddCommand.h @@ -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 *)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 *)vrCommands handler:(nullable SDLRPCCommandNotificationHandler)handler; +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray *)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 *)vrCommands menuName:(NSString *)menuName handler:(nullable SDLRPCCommandNotificationHandler)handler; +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray *)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 *)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 *)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 *)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 *)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. diff --git a/SmartDeviceLink/public/SDLAddCommand.m b/SmartDeviceLink/public/SDLAddCommand.m index 83da5658f1..ddd791b2fa 100644 --- a/SmartDeviceLink/public/SDLAddCommand.m +++ b/SmartDeviceLink/public/SDLAddCommand.m @@ -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 *)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) { diff --git a/SmartDeviceLink/public/SDLAddSubMenu.h b/SmartDeviceLink/public/SDLAddSubMenu.h index 2de2f466db..55cb001077 100644 --- a/SmartDeviceLink/public/SDLAddSubMenu.h +++ b/SmartDeviceLink/public/SDLAddSubMenu.h @@ -37,6 +37,8 @@ @class SDLImage; +NS_ASSUME_NONNULL_BEGIN + /** * Add a SDLSubMenu to the Command Menu *

@@ -50,9 +52,6 @@ * Since SmartDeviceLink 1.0
* see SDLDeleteSubMenu SDLAddCommand SDLDeleteCommand */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLAddSubMenu : SDLRPCRequest /** diff --git a/SmartDeviceLink/public/SDLAirbagStatus.h b/SmartDeviceLink/public/SDLAirbagStatus.h index 140b6af07d..dc68a243e2 100644 --- a/SmartDeviceLink/public/SDLAirbagStatus.h +++ b/SmartDeviceLink/public/SDLAirbagStatus.h @@ -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. diff --git a/SmartDeviceLink/public/SDLAirbagStatus.m b/SmartDeviceLink/public/SDLAirbagStatus.m index 650a2c5ba1..8b80505819 100644 --- a/SmartDeviceLink/public/SDLAirbagStatus.m +++ b/SmartDeviceLink/public/SDLAirbagStatus.m @@ -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]; } diff --git a/SmartDeviceLink/public/SDLAlert.h b/SmartDeviceLink/public/SDLAlert.h index f18ea0c10d..4cdf67f485 100644 --- a/SmartDeviceLink/public/SDLAlert.h +++ b/SmartDeviceLink/public/SDLAlert.h @@ -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 *)ttsChunks duration:(nullable NSNumber *)duration playTone:(nullable NSNumber *)playTone progressIndicator:(nullable NSNumber *)progressIndicator softButtons:(nullable NSArray *)softButtons alertIcon:(nullable SDLImage *)alertIcon cancelID:(nullable NSNumber *)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 *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray *)ttsChunks alertIcon:(nullable SDLImage *)icon cancelID:(UInt32)cancelID; +- (instancetype)initWithAlertText:(nullable NSString *)alertText softButtons:(nullable NSArray *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray *)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 *)ttsChunks playTone:(BOOL)playTone; +- (instancetype)initWithTTSChunks:(nullable NSArray *)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 *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray *)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 *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray *)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. diff --git a/SmartDeviceLink/public/SDLAlert.m b/SmartDeviceLink/public/SDLAlert.m index 3533ae5f6c..93e3a9d9c3 100644 --- a/SmartDeviceLink/public/SDLAlert.m +++ b/SmartDeviceLink/public/SDLAlert.m @@ -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 *)ttsChunks duration:(nullable NSNumber *)duration playTone:(nullable NSNumber *)playTone progressIndicator:(nullable NSNumber *)progressIndicator softButtons:(nullable NSArray *)softButtons alertIcon:(nullable SDLImage *)alertIcon cancelID:(nullable NSNumber *)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 *)softButtons playTone:(BOOL)playTone ttsChunks:(nullable NSArray *)ttsChunks duration:(nullable NSNumber *)duration progressIndicator:(BOOL)progressIndicator alertIcon:(nullable SDLImage *)icon cancelID:(nullable NSNumber *)cancelID { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLAlertManeuver.h b/SmartDeviceLink/public/SDLAlertManeuver.h index 3da7e63d4b..d080cab04f 100644 --- a/SmartDeviceLink/public/SDLAlertManeuver.h +++ b/SmartDeviceLink/public/SDLAlertManeuver.h @@ -1,5 +1,34 @@ -// 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" @@ -7,31 +36,29 @@ @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 *)softButtons; +- (instancetype)initWithTTSChunks:(nullable NSArray *)ttsChunks softButtons:(nullable NSArray *)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 *)ttsChunks softButtons:(nullable NSArray *)softButtons; +- (instancetype)initWithTTS:(nullable NSString *)ttsText softButtons:(nullable NSArray *)softButtons __deprecated_msg("Use initWithTTSChunks:softButtons: instead"); /** * An array of text chunks. diff --git a/SmartDeviceLink/public/SDLAlertResponse.h b/SmartDeviceLink/public/SDLAlertResponse.h index db73310a6f..c1823136fe 100644 --- a/SmartDeviceLink/public/SDLAlertResponse.h +++ b/SmartDeviceLink/public/SDLAlertResponse.h @@ -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 *)tryAgainTime; + /// Amount of time (in seconds) that an app must wait before resending an alert. /// /// @since RPC 2.0 diff --git a/SmartDeviceLink/public/SDLAlertResponse.m b/SmartDeviceLink/public/SDLAlertResponse.m index 401b29e76c..9a42f73a8c 100644 --- a/SmartDeviceLink/public/SDLAlertResponse.m +++ b/SmartDeviceLink/public/SDLAlertResponse.m @@ -20,6 +20,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithTryAgainTime:(nullable NSNumber *)tryAgainTime { + self = [self init]; + if (!self) { + return nil; + } + self.tryAgainTime = tryAgainTime; + return self; +} + - (void)setTryAgainTime:(nullable NSNumber *)tryAgainTime { [self.parameters sdl_setObject:tryAgainTime forName:SDLRPCParameterNameTryAgainTime];} diff --git a/SmartDeviceLink/public/SDLAppInfo.h b/SmartDeviceLink/public/SDLAppInfo.h index 2aaff168e0..fe6a60eb50 100644 --- a/SmartDeviceLink/public/SDLAppInfo.h +++ b/SmartDeviceLink/public/SDLAppInfo.h @@ -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 diff --git a/SmartDeviceLink/public/SDLAppInfo.m b/SmartDeviceLink/public/SDLAppInfo.m index 1b7ec0150f..4e09c74335 100644 --- a/SmartDeviceLink/public/SDLAppInfo.m +++ b/SmartDeviceLink/public/SDLAppInfo.m @@ -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 diff --git a/SmartDeviceLink/public/SDLAppServiceCapability.h b/SmartDeviceLink/public/SDLAppServiceCapability.h index 803f82c7cb..34b45c9eb9 100644 --- a/SmartDeviceLink/public/SDLAppServiceCapability.h +++ b/SmartDeviceLink/public/SDLAppServiceCapability.h @@ -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. diff --git a/SmartDeviceLink/public/SDLAppServiceCapability.m b/SmartDeviceLink/public/SDLAppServiceCapability.m index 595540cf4e..d867c5200a 100644 --- a/SmartDeviceLink/public/SDLAppServiceCapability.m +++ b/SmartDeviceLink/public/SDLAppServiceCapability.m @@ -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; } diff --git a/SmartDeviceLink/public/SDLAppServiceData.h b/SmartDeviceLink/public/SDLAppServiceData.h index 28a6121b93..af325c19e8 100644 --- a/SmartDeviceLink/public/SDLAppServiceData.h +++ b/SmartDeviceLink/public/SDLAppServiceData.h @@ -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. diff --git a/SmartDeviceLink/public/SDLAppServiceData.m b/SmartDeviceLink/public/SDLAppServiceData.m index 13565a7af5..dfed4879fb 100644 --- a/SmartDeviceLink/public/SDLAppServiceData.m +++ b/SmartDeviceLink/public/SDLAppServiceData.m @@ -19,6 +19,27 @@ @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) { @@ -26,7 +47,7 @@ - (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType serviceId: } 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]; } diff --git a/SmartDeviceLink/public/SDLAppServiceManifest.h b/SmartDeviceLink/public/SDLAppServiceManifest.h index 3998e8a2c6..04d7536a25 100644 --- a/SmartDeviceLink/public/SDLAppServiceManifest.h +++ b/SmartDeviceLink/public/SDLAppServiceManifest.h @@ -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 *)allowAppConsumers rpcSpecVersion:(nullable SDLMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray *> *)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 *> *)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 *> *)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 *> *)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 *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. diff --git a/SmartDeviceLink/public/SDLAppServiceManifest.m b/SmartDeviceLink/public/SDLAppServiceManifest.m index a49a995176..7b99bda0c3 100644 --- a/SmartDeviceLink/public/SDLAppServiceManifest.m +++ b/SmartDeviceLink/public/SDLAppServiceManifest.m @@ -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 *)allowAppConsumers rpcSpecVersion:(nullable SDLMsgVersion *)rpcSpecVersion handledRPCs:(nullable NSArray *> *)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 *> *)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 *> *)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 *> *)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 *> *)handledRPCs mediaServiceManifest:(nullable SDLMediaServiceManifest *)mediaServiceManifest weatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest navigationServiceManifest:(nullable SDLNavigationServiceManifest *)navigationServiceManifest { @@ -95,6 +120,14 @@ - (void)setAllowAppConsumers:(nullable NSNumber *)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]; } diff --git a/SmartDeviceLink/public/SDLAppServiceRecord.h b/SmartDeviceLink/public/SDLAppServiceRecord.h index fd5a3bf378..deb626f7b6 100644 --- a/SmartDeviceLink/public/SDLAppServiceRecord.h +++ b/SmartDeviceLink/public/SDLAppServiceRecord.h @@ -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" diff --git a/SmartDeviceLink/public/SDLAppServicesCapabilities.h b/SmartDeviceLink/public/SDLAppServicesCapabilities.h index feb843c309..d011b3af51 100644 --- a/SmartDeviceLink/public/SDLAppServicesCapabilities.h +++ b/SmartDeviceLink/public/SDLAppServicesCapabilities.h @@ -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" diff --git a/SmartDeviceLink/public/SDLAudioControlCapabilities.h b/SmartDeviceLink/public/SDLAudioControlCapabilities.h index f596b081b8..9a0a0f8ea8 100644 --- a/SmartDeviceLink/public/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/public/SDLAudioControlCapabilities.h @@ -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,6 +42,24 @@ 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 *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelId:(nullable NSNumber *)equalizerMaxChannelId; + /** Constructs a newly allocated SDLAudioControlCapabilities object with audio control module name (max 100 chars) @@ -20,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN @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 *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID; +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID __deprecated_msg("Use initWithModuleName: instead"); /** * @abstract The short friendly name of the audio control module. diff --git a/SmartDeviceLink/public/SDLAudioControlCapabilities.m b/SmartDeviceLink/public/SDLAudioControlCapabilities.m index 68832efe27..3d3d963cfd 100644 --- a/SmartDeviceLink/public/SDLAudioControlCapabilities.m +++ b/SmartDeviceLink/public/SDLAudioControlCapabilities.m @@ -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 *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelId:(nullable NSNumber *)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) { diff --git a/SmartDeviceLink/public/SDLAudioControlData.h b/SmartDeviceLink/public/SDLAudioControlData.h index 2cd9963387..4416283209 100644 --- a/SmartDeviceLink/public/SDLAudioControlData.h +++ b/SmartDeviceLink/public/SDLAudioControlData.h @@ -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 *)keepContext volume:(nullable NSNumber *)volume equalizerSettings:(nullable NSArray *)equalizerSettings; +- (instancetype)initWithSource:(nullable SDLPrimaryAudioSource)source keepContext:(nullable NSNumber *)keepContext volume:(nullable NSNumber *)volume equalizerSettings:(nullable NSArray *)equalizerSettings; /** * @abstract In a getter response or a notification, diff --git a/SmartDeviceLink/public/SDLAudioPassThruCapabilities.h b/SmartDeviceLink/public/SDLAudioPassThruCapabilities.h index 67f2292814..4ed2deed24 100644 --- a/SmartDeviceLink/public/SDLAudioPassThruCapabilities.h +++ b/SmartDeviceLink/public/SDLAudioPassThruCapabilities.h @@ -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 diff --git a/SmartDeviceLink/public/SDLAudioPassThruCapabilities.m b/SmartDeviceLink/public/SDLAudioPassThruCapabilities.m index c84263a246..2870965e68 100644 --- a/SmartDeviceLink/public/SDLAudioPassThruCapabilities.m +++ b/SmartDeviceLink/public/SDLAudioPassThruCapabilities.m @@ -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]; } diff --git a/SmartDeviceLink/public/SDLBeltStatus.h b/SmartDeviceLink/public/SDLBeltStatus.h index 4b71c3764f..3ade91a906 100644 --- a/SmartDeviceLink/public/SDLBeltStatus.h +++ b/SmartDeviceLink/public/SDLBeltStatus.h @@ -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. diff --git a/SmartDeviceLink/public/SDLBeltStatus.m b/SmartDeviceLink/public/SDLBeltStatus.m index 89a5271e3a..9ef87c5b16 100644 --- a/SmartDeviceLink/public/SDLBeltStatus.m +++ b/SmartDeviceLink/public/SDLBeltStatus.m @@ -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]; } diff --git a/SmartDeviceLink/public/SDLBodyInformation.h b/SmartDeviceLink/public/SDLBodyInformation.h index bed364503e..5eb0c68a28 100644 --- a/SmartDeviceLink/public/SDLBodyInformation.h +++ b/SmartDeviceLink/public/SDLBodyInformation.h @@ -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 *)driverDoorAjar passengerDoorAjar:(nullable NSNumber *)passengerDoorAjar rearLeftDoorAjar:(nullable NSNumber *)rearLeftDoorAjar rearRightDoorAjar:(nullable NSNumber *)rearRightDoorAjar; + /** * References signal "PrkBrkActv_B_Actl". diff --git a/SmartDeviceLink/public/SDLBodyInformation.m b/SmartDeviceLink/public/SDLBodyInformation.m index fe8aa8b29b..27f81b88f0 100644 --- a/SmartDeviceLink/public/SDLBodyInformation.m +++ b/SmartDeviceLink/public/SDLBodyInformation.m @@ -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 *)driverDoorAjar passengerDoorAjar:(nullable NSNumber *)passengerDoorAjar rearLeftDoorAjar:(nullable NSNumber *)rearLeftDoorAjar rearRightDoorAjar:(nullable NSNumber *)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 *)parkBrakeActive { [self.store sdl_setObject:parkBrakeActive forName:SDLRPCParameterNameParkBrakeActive]; } diff --git a/SmartDeviceLink/public/SDLButtonCapabilities.h b/SmartDeviceLink/public/SDLButtonCapabilities.h index 1333da2cfa..470223d356 100644 --- a/SmartDeviceLink/public/SDLButtonCapabilities.h +++ b/SmartDeviceLink/public/SDLButtonCapabilities.h @@ -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 diff --git a/SmartDeviceLink/public/SDLButtonCapabilities.m b/SmartDeviceLink/public/SDLButtonCapabilities.m index 1685d09079..5b8fc1769a 100644 --- a/SmartDeviceLink/public/SDLButtonCapabilities.m +++ b/SmartDeviceLink/public/SDLButtonCapabilities.m @@ -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]; } diff --git a/SmartDeviceLink/public/SDLButtonPress.h b/SmartDeviceLink/public/SDLButtonPress.h index ee77170724..363eb6f541 100644 --- a/SmartDeviceLink/public/SDLButtonPress.h +++ b/SmartDeviceLink/public/SDLButtonPress.h @@ -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. diff --git a/SmartDeviceLink/public/SDLButtonPress.m b/SmartDeviceLink/public/SDLButtonPress.m index c2047ca6ca..fe0136dd89 100644 --- a/SmartDeviceLink/public/SDLButtonPress.m +++ b/SmartDeviceLink/public/SDLButtonPress.m @@ -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) { diff --git a/SmartDeviceLink/public/SDLCancelInteraction.h b/SmartDeviceLink/public/SDLCancelInteraction.h index 289e854436..6b02994a31 100644 --- a/SmartDeviceLink/public/SDLCancelInteraction.h +++ b/SmartDeviceLink/public/SDLCancelInteraction.h @@ -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 *)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,6 +153,12 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *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 *functionIDParam; + /** The ID of the type of interaction to dismiss. @@ -147,7 +166,7 @@ NS_ASSUME_NONNULL_BEGIN Integer, Required */ -@property (strong, nonatomic) NSNumber *functionID; +@property (strong, nonatomic) NSNumber *functionID __deprecated_msg("Use functionIDParam instead"); @end diff --git a/SmartDeviceLink/public/SDLCancelInteraction.m b/SmartDeviceLink/public/SDLCancelInteraction.m index bd591dc28d..283f85d0b2 100644 --- a/SmartDeviceLink/public/SDLCancelInteraction.m +++ b/SmartDeviceLink/public/SDLCancelInteraction.m @@ -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 *)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 *)cancelID { @@ -121,6 +138,15 @@ - (void)setCancelID:(nullable NSNumber *)cancelID { return [self.parameters sdl_objectForName:SDLRPCParameterNameCancelID ofClass:NSNumber.class error:nil]; } +- (void)setFunctionIDParam:(NSNumber *)functionIDParam { + [self.parameters sdl_setObject:functionIDParam forName:SDLRPCParameterNameFunctionID]; +} + +- (NSNumber *)functionIDParam { + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFunctionID ofClass:NSNumber.class error:&error]; +} + - (void)setFunctionID:(NSNumber *)functionID { [self.parameters sdl_setObject:functionID forName:SDLRPCParameterNameFunctionID]; } diff --git a/SmartDeviceLink/public/SDLChangeRegistration.h b/SmartDeviceLink/public/SDLChangeRegistration.h index 5e16d16eff..c3958f8714 100644 --- a/SmartDeviceLink/public/SDLChangeRegistration.h +++ b/SmartDeviceLink/public/SDLChangeRegistration.h @@ -1,5 +1,34 @@ -// 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" @@ -7,6 +36,8 @@ @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. * @@ -14,9 +45,6 @@ * * @since SDL 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLChangeRegistration : SDLRPCRequest /** diff --git a/SmartDeviceLink/public/SDLChoice.h b/SmartDeviceLink/public/SDLChoice.h index 9651159511..f2bbbd2a63 100644 --- a/SmartDeviceLink/public/SDLChoice.h +++ b/SmartDeviceLink/public/SDLChoice.h @@ -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 *)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 *)vrCommands; +- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString *)menuName vrCommands:(nullable NSArray *)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 *)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 *)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 diff --git a/SmartDeviceLink/public/SDLChoice.m b/SmartDeviceLink/public/SDLChoice.m index e384ddf867..e0454bf256 100644 --- a/SmartDeviceLink/public/SDLChoice.m +++ b/SmartDeviceLink/public/SDLChoice.m @@ -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 *)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 *)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) { diff --git a/SmartDeviceLink/public/SDLClimateControlCapabilities.h b/SmartDeviceLink/public/SDLClimateControlCapabilities.h index a0eb2a690e..c0d85f5dfc 100644 --- a/SmartDeviceLink/public/SDLClimateControlCapabilities.h +++ b/SmartDeviceLink/public/SDLClimateControlCapabilities.h @@ -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 *)currentTemperatureAvailable fanSpeedAvailable:(nullable NSNumber *)fanSpeedAvailable desiredTemperatureAvailable:(nullable NSNumber *)desiredTemperatureAvailable acEnableAvailable:(nullable NSNumber *)acEnableAvailable acMaxEnableAvailable:(nullable NSNumber *)acMaxEnableAvailable circulateAirEnableAvailable:(nullable NSNumber *)circulateAirEnableAvailable autoModeEnableAvailable:(nullable NSNumber *)autoModeEnableAvailable dualModeEnableAvailable:(nullable NSNumber *)dualModeEnableAvailable defrostZoneAvailable:(nullable NSNumber *)defrostZoneAvailable defrostZone:(nullable NSArray *)defrostZone ventilationModeAvailable:(nullable NSNumber *)ventilationModeAvailable ventilationMode:(nullable NSArray *)ventilationMode heatedSteeringWheelAvailable:(nullable NSNumber *)heatedSteeringWheelAvailable heatedWindshieldAvailable:(nullable NSNumber *)heatedWindshieldAvailable heatedRearWindowAvailable:(nullable NSNumber *)heatedRearWindowAvailable heatedMirrorsAvailable:(nullable NSNumber *)heatedMirrorsAvailable climateEnableAvailable:(nullable NSNumber *)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 *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 *currentTemperatureAvailable; + /** * Availability of the control of desired temperature. * True: Available, False: Not Available, Not present: Not Available. diff --git a/SmartDeviceLink/public/SDLClimateControlCapabilities.m b/SmartDeviceLink/public/SDLClimateControlCapabilities.m index fb173cfedc..a254312292 100644 --- a/SmartDeviceLink/public/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/public/SDLClimateControlCapabilities.m @@ -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 *)currentTemperatureAvailable fanSpeedAvailable:(nullable NSNumber *)fanSpeedAvailable desiredTemperatureAvailable:(nullable NSNumber *)desiredTemperatureAvailable acEnableAvailable:(nullable NSNumber *)acEnableAvailable acMaxEnableAvailable:(nullable NSNumber *)acMaxEnableAvailable circulateAirEnableAvailable:(nullable NSNumber *)circulateAirEnableAvailable autoModeEnableAvailable:(nullable NSNumber *)autoModeEnableAvailable dualModeEnableAvailable:(nullable NSNumber *)dualModeEnableAvailable defrostZoneAvailable:(nullable NSNumber *)defrostZoneAvailable defrostZone:(nullable NSArray *)defrostZone ventilationModeAvailable:(nullable NSNumber *)ventilationModeAvailable ventilationMode:(nullable NSArray *)ventilationMode heatedSteeringWheelAvailable:(nullable NSNumber *)heatedSteeringWheelAvailable heatedWindshieldAvailable:(nullable NSNumber *)heatedWindshieldAvailable heatedRearWindowAvailable:(nullable NSNumber *)heatedRearWindowAvailable heatedMirrorsAvailable:(nullable NSNumber *)heatedMirrorsAvailable climateEnableAvailable:(nullable NSNumber *)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 *)fanSpeedAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameFanSpeedAvailable ofClass:NSNumber.class error:nil]; } +- (void)setCurrentTemperatureAvailable:(nullable NSNumber *)currentTemperatureAvailable { + [self.store sdl_setObject:currentTemperatureAvailable forName:SDLRPCParameterNameCurrentTemperatureAvailable]; +} + +- (nullable NSNumber *)currentTemperatureAvailable { + return [self.store sdl_objectForName:SDLRPCParameterNameCurrentTemperatureAvailable ofClass:NSNumber.class error:nil]; +} + - (void)setDesiredTemperatureAvailable:(nullable NSNumber *)desiredTemperatureAvailable { [self.store sdl_setObject:desiredTemperatureAvailable forName:SDLRPCParameterNameDesiredTemperatureAvailable]; } diff --git a/SmartDeviceLink/public/SDLClimateControlData.h b/SmartDeviceLink/public/SDLClimateControlData.h index 7282c70cea..34d88a5512 100644 --- a/SmartDeviceLink/public/SDLClimateControlData.h +++ b/SmartDeviceLink/public/SDLClimateControlData.h @@ -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 *)fanSpeed currentTemperature:(nullable SDLTemperature *)currentTemperature desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber *)acEnable circulateAirEnable:(nullable NSNumber *)circulateAirEnable autoModeEnable:(nullable NSNumber *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber *)dualModeEnable acMaxEnable:(nullable NSNumber *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber *)heatedMirrorsEnable climateEnable:(nullable NSNumber *)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 *)fanSpeed desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber *)acEnable circulateAirEnable:(nullable NSNumber *)circulateAirEnable autoModeEnable:(nullable NSNumber *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber *)dualModeEnable acMaxEnable:(nullable NSNumber *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber *)heatedMirrorsEnable climateEnable:(nullable NSNumber *)climateEnable; +- (instancetype)initWithFanSpeed:(nullable NSNumber *)fanSpeed desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber *)acEnable circulateAirEnable:(nullable NSNumber *)circulateAirEnable autoModeEnable:(nullable NSNumber *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber *)dualModeEnable acMaxEnable:(nullable NSNumber *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber *)heatedMirrorsEnable climateEnable:(nullable NSNumber *)climateEnable __deprecated_msg("Use initWithFanSpeed:currentTemperature:desiredTemperature:acEnable:circulateAirEnable:autoModeEnable:defrostZone:dualModeEnable:acMaxEnable:ventilationMode:heatedSteeringWheelEnable:heatedWindshieldEnable:heatedRearWindowEnable:heatedMirrorsEnable:climateEnable:"); /** * Speed of Fan in integer diff --git a/SmartDeviceLink/public/SDLClimateControlData.m b/SmartDeviceLink/public/SDLClimateControlData.m index 8d54828450..53bc10207f 100644 --- a/SmartDeviceLink/public/SDLClimateControlData.m +++ b/SmartDeviceLink/public/SDLClimateControlData.m @@ -11,6 +11,29 @@ @implementation SDLClimateControlData +- (instancetype)initWithFanSpeed:(nullable NSNumber *)fanSpeed currentTemperature:(nullable SDLTemperature *)currentTemperature desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber *)acEnable circulateAirEnable:(nullable NSNumber *)circulateAirEnable autoModeEnable:(nullable NSNumber *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber *)dualModeEnable acMaxEnable:(nullable NSNumber *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber *)heatedMirrorsEnable climateEnable:(nullable NSNumber *)climateEnable { + self = [self init]; + if (!self) { + return nil; + } + self.fanSpeed = fanSpeed; + self.currentTemperature = currentTemperature; + self.desiredTemperature = desiredTemperature; + self.acEnable = acEnable; + self.circulateAirEnable = circulateAirEnable; + self.autoModeEnable = autoModeEnable; + self.defrostZone = defrostZone; + self.dualModeEnable = dualModeEnable; + self.acMaxEnable = acMaxEnable; + self.ventilationMode = ventilationMode; + self.heatedSteeringWheelEnable = heatedSteeringWheelEnable; + self.heatedWindshieldEnable = heatedWindshieldEnable; + self.heatedRearWindowEnable = heatedRearWindowEnable; + self.heatedMirrorsEnable = heatedMirrorsEnable; + self.climateEnable = climateEnable; + return self; +} + - (instancetype)initWithFanSpeed:(nullable NSNumber *)fanSpeed desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber *)acEnable circulateAirEnable:(nullable NSNumber *)circulateAirEnable autoModeEnable:(nullable NSNumber *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber *)dualModeEnable acMaxEnable:(nullable NSNumber *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode heatedSteeringWheelEnable:(nullable NSNumber *)heatedSteeringWheelEnable heatedWindshieldEnable:(nullable NSNumber *)heatedWindshieldEnable heatedRearWindowEnable:(nullable NSNumber *)heatedRearWindowEnable heatedMirrorsEnable:(nullable NSNumber *)heatedMirrorsEnable climateEnable:(nullable NSNumber *)climateEnable { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLCloudAppProperties.h b/SmartDeviceLink/public/SDLCloudAppProperties.h index 6f64956a85..f440360740 100644 --- a/SmartDeviceLink/public/SDLCloudAppProperties.h +++ b/SmartDeviceLink/public/SDLCloudAppProperties.h @@ -1,10 +1,34 @@ -// -// SDLCloudAppProperties.h -// SmartDeviceLink -// -// Created by Nicole on 2/26/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 "SDLRPCStruct.h" @@ -24,7 +48,19 @@ NS_ASSUME_NONNULL_BEGIN * @param appID The id of the cloud app * @return A SDLCloudAppProperties object */ -- (instancetype)initWithAppID:(NSString *)appID NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithAppID:(NSString *)appID; + +/** + * @param appID - appID + * @param nicknames - nicknames + * @param enabled - enabled + * @param authToken - authToken + * @param cloudTransportType - cloudTransportType + * @param hybridAppPreference - hybridAppPreference + * @param endpoint - endpoint + * @return A SDLCloudAppProperties object + */ +- (instancetype)initWithAppIDParam:(NSString *)appID nicknames:(nullable NSArray *)nicknames enabled:(nullable NSNumber *)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint __deprecated_msg("Eventually this will be replaced with an initializer without param"); /** * Convenience init for all parameters. @@ -38,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN * @param endpoint The websocket endpoint * @return A SDLCloudAppProperties object */ -- (instancetype)initWithAppID:(NSString *)appID nicknames:(nullable NSArray *)nicknames enabled:(BOOL)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint; +- (instancetype)initWithAppID:(NSString *)appID nicknames:(nullable NSArray *)nicknames enabled:(BOOL)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint __deprecated_msg("Eventually this will be replaced by an initializer with different parameter types"); /** * An array of app names a cloud app is allowed to register with. If included in a `SetCloudAppProperties` request, this value will overwrite the existing "nicknames" field in the app policies section of the policy table. diff --git a/SmartDeviceLink/public/SDLCloudAppProperties.m b/SmartDeviceLink/public/SDLCloudAppProperties.m index 3a2ad32a26..fe2ae5d7b7 100644 --- a/SmartDeviceLink/public/SDLCloudAppProperties.m +++ b/SmartDeviceLink/public/SDLCloudAppProperties.m @@ -17,13 +17,25 @@ @implementation SDLCloudAppProperties - (instancetype)initWithAppID:(NSString *)appID { - self = [super init]; + self = [self init]; if (!self) { return nil; } - self.appID = appID; + return self; +} +- (instancetype)initWithAppIDParam:(NSString *)appID nicknames:(nullable NSArray *)nicknames enabled:(nullable NSNumber *)enabled authToken:(nullable NSString *)authToken cloudTransportType:(nullable NSString *)cloudTransportType hybridAppPreference:(nullable SDLHybridAppPreference)hybridAppPreference endpoint:(nullable NSString *)endpoint { + self = [self initWithAppID:appID]; + if (!self) { + return nil; + } + self.nicknames = nicknames; + self.enabled = enabled; + self.authToken = authToken; + self.cloudTransportType = cloudTransportType; + self.hybridAppPreference = hybridAppPreference; + self.endpoint = endpoint; return self; } diff --git a/SmartDeviceLink/public/SDLClusterModeStatus.h b/SmartDeviceLink/public/SDLClusterModeStatus.h index 2a3fa59562..7b8e804645 100644 --- a/SmartDeviceLink/public/SDLClusterModeStatus.h +++ b/SmartDeviceLink/public/SDLClusterModeStatus.h @@ -1,5 +1,34 @@ -// SDLClusterModeStatus.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" @@ -14,6 +43,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLClusterModeStatus : SDLRPCStruct +/** + * @param powerModeActive - @(powerModeActive) + * @param powerModeQualificationStatus - powerModeQualificationStatus + * @param carModeStatus - carModeStatus + * @param powerModeStatus - powerModeStatus + * @return A SDLClusterModeStatus object + */ +- (instancetype)initWithPowerModeActive:(BOOL)powerModeActive powerModeQualificationStatus:(SDLPowerModeQualificationStatus)powerModeQualificationStatus carModeStatus:(SDLCarModeStatus)carModeStatus powerModeStatus:(SDLPowerModeStatus)powerModeStatus; + /** References signal "PowerMode_UB". diff --git a/SmartDeviceLink/public/SDLClusterModeStatus.m b/SmartDeviceLink/public/SDLClusterModeStatus.m index 1558c05226..9944a70524 100644 --- a/SmartDeviceLink/public/SDLClusterModeStatus.m +++ b/SmartDeviceLink/public/SDLClusterModeStatus.m @@ -10,6 +10,18 @@ @implementation SDLClusterModeStatus +- (instancetype)initWithPowerModeActive:(BOOL)powerModeActive powerModeQualificationStatus:(SDLPowerModeQualificationStatus)powerModeQualificationStatus carModeStatus:(SDLCarModeStatus)carModeStatus powerModeStatus:(SDLPowerModeStatus)powerModeStatus { + self = [self init]; + if (!self) { + return nil; + } + self.powerModeActive = @(powerModeActive); + self.powerModeQualificationStatus = powerModeQualificationStatus; + self.carModeStatus = carModeStatus; + self.powerModeStatus = powerModeStatus; + return self; +} + - (void)setPowerModeActive:(NSNumber *)powerModeActive { [self.store sdl_setObject:powerModeActive forName:SDLRPCParameterNamePowerModeActive]; } diff --git a/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.h b/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.h index da54d58e30..bae7e65a65 100644 --- a/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.h +++ b/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.h @@ -1,5 +1,34 @@ -// SDLCreateInteractionChoiceSet.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" @@ -23,12 +52,19 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLCreateInteractionChoiceSet : SDLRPCRequest +/** + * @param interactionChoiceSetID - @(interactionChoiceSetID) + * @param choiceSet - choiceSet + * @return A SDLCreateInteractionChoiceSet object + */ +- (instancetype)initWithInteractionChoiceSetID:(UInt32)interactionChoiceSetID choiceSet:(NSArray *)choiceSet; + /// Convenience init for creating a choice set RPC /// /// @param choiceId A unique ID that identifies the Choice Set /// @param choiceSet Array of choices, which the user can select by menu or voice recognition /// @return An SDLCreateInteractionChoiceSet object -- (instancetype)initWithId:(UInt32)choiceId choiceSet:(NSArray *)choiceSet; +- (instancetype)initWithId:(UInt32)choiceId choiceSet:(NSArray *)choiceSet __deprecated_msg("Use initWithInteractionChoiceSetID:choiceSet: instead"); /** * A unique ID that identifies the Choice Set diff --git a/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.m b/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.m index 00ee170937..7f43d4d5e1 100644 --- a/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.m +++ b/SmartDeviceLink/public/SDLCreateInteractionChoiceSet.m @@ -22,6 +22,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithInteractionChoiceSetID:(UInt32)interactionChoiceSetID choiceSet:(NSArray *)choiceSet { + self = [self init]; + if (!self) { + return nil; + } + self.interactionChoiceSetID = @(interactionChoiceSetID); + self.choiceSet = choiceSet; + return self; +} + - (instancetype)initWithId:(UInt32)choiceId choiceSet:(NSArray *)choiceSet { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLCreateWindow.h b/SmartDeviceLink/public/SDLCreateWindow.h index ad4475ef2c..736582b075 100644 --- a/SmartDeviceLink/public/SDLCreateWindow.h +++ b/SmartDeviceLink/public/SDLCreateWindow.h @@ -1,7 +1,34 @@ -// -// SDLCreateWindow.h -// SmartDeviceLink -// +/* + * 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 "SDLWindowType.h" @@ -16,6 +43,23 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLCreateWindow : SDLRPCRequest +/** + * @param windowID - @(windowID) + * @param windowName - windowName + * @param type - type + * @return A SDLCreateWindow object + */ +- (instancetype)initWithWindowID:(UInt32)windowID windowName:(NSString *)windowName type:(SDLWindowType)type; + +/** + * @param windowID - @(windowID) + * @param windowName - windowName + * @param type - type + * @param associatedServiceType - associatedServiceType + * @param duplicateUpdatesFromWindowID - duplicateUpdatesFromWindowID + * @return A SDLCreateWindow object + */ +- (instancetype)initWithWindowID:(UInt32)windowID windowName:(NSString *)windowName type:(SDLWindowType)type associatedServiceType:(nullable NSString *)associatedServiceType duplicateUpdatesFromWindowID:(nullable NSNumber *)duplicateUpdatesFromWindowID; /** Constructor with the required parameters @@ -24,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN @param windowName The window name to be used by the HMI. @see windowName @param windowType The type of the window to be created. Main window or widget. */ -- (instancetype)initWithId:(NSUInteger)windowId windowName:(NSString *)windowName windowType:(SDLWindowType)windowType; +- (instancetype)initWithId:(NSUInteger)windowId windowName:(NSString *)windowName windowType:(SDLWindowType)windowType __deprecated_msg("Use initWithWindowID:windowName:type:"); /** Convinience constructor with all the parameters. @@ -35,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN @param associatedServiceType Allows an app to create a widget related to a specific service type. @see associatedServiceType @param duplicateUpdatesFromWindowID Optional parameter. Specify whether the content sent to an existing window should be duplicated to the created window. If there isn't a window with the ID, the request will be rejected with `INVALID_DATA`. */ -- (instancetype)initWithId:(NSUInteger)windowId windowName:(NSString *)windowName windowType:(SDLWindowType)windowType associatedServiceType:(nullable NSString *)associatedServiceType duplicateUpdatesFromWindowID:(NSUInteger)duplicateUpdatesFromWindowID; +- (instancetype)initWithId:(NSUInteger)windowId windowName:(NSString *)windowName windowType:(SDLWindowType)windowType associatedServiceType:(nullable NSString *)associatedServiceType duplicateUpdatesFromWindowID:(NSUInteger)duplicateUpdatesFromWindowID __deprecated_msg("Use initWithWindowID:windowName:type:"); /** diff --git a/SmartDeviceLink/public/SDLCreateWindow.m b/SmartDeviceLink/public/SDLCreateWindow.m index b6b55ec177..b91604ff1f 100644 --- a/SmartDeviceLink/public/SDLCreateWindow.m +++ b/SmartDeviceLink/public/SDLCreateWindow.m @@ -21,6 +21,27 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithWindowID:(UInt32)windowID windowName:(NSString *)windowName type:(SDLWindowType)type { + self = [self init]; + if (!self) { + return nil; + } + self.windowID = @(windowID); + self.windowName = windowName; + self.type = type; + return self; +} + +- (instancetype)initWithWindowID:(UInt32)windowID windowName:(NSString *)windowName type:(SDLWindowType)type associatedServiceType:(nullable NSString *)associatedServiceType duplicateUpdatesFromWindowID:(nullable NSNumber *)duplicateUpdatesFromWindowID { + self = [self initWithWindowID:windowID windowName:windowName type:type]; + if (!self) { + return nil; + } + self.associatedServiceType = associatedServiceType; + self.duplicateUpdatesFromWindowID = duplicateUpdatesFromWindowID; + return self; +} + - (instancetype)initWithId:(NSUInteger)windowId windowName:(NSString *)windowName windowType:(SDLWindowType)windowType { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLDIDResult.h b/SmartDeviceLink/public/SDLDIDResult.h index 673ccaaccc..604d15eea9 100644 --- a/SmartDeviceLink/public/SDLDIDResult.h +++ b/SmartDeviceLink/public/SDLDIDResult.h @@ -12,6 +12,21 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDIDResult : SDLRPCStruct +/** + * @param resultCode - resultCode + * @param didLocation - @(didLocation) + * @return A SDLDIDResult object + */ +- (instancetype)initWithResultCode:(SDLVehicleDataResultCode)resultCode didLocation:(UInt16)didLocation; + +/** + * @param resultCode - resultCode + * @param didLocation - @(didLocation) + * @param data - data + * @return A SDLDIDResult object + */ +- (instancetype)initWithResultCode:(SDLVehicleDataResultCode)resultCode didLocation:(UInt16)didLocation data:(nullable NSString *)data; + /** Individual DID result code. diff --git a/SmartDeviceLink/public/SDLDIDResult.m b/SmartDeviceLink/public/SDLDIDResult.m index 4f661d8952..4b82eaac24 100644 --- a/SmartDeviceLink/public/SDLDIDResult.m +++ b/SmartDeviceLink/public/SDLDIDResult.m @@ -10,6 +10,25 @@ @implementation SDLDIDResult +- (instancetype)initWithResultCode:(SDLVehicleDataResultCode)resultCode didLocation:(UInt16)didLocation { + self = [self init]; + if (!self) { + return nil; + } + self.resultCode = resultCode; + self.didLocation = @(didLocation); + return self; +} + +- (instancetype)initWithResultCode:(SDLVehicleDataResultCode)resultCode didLocation:(UInt16)didLocation data:(nullable NSString *)data { + self = [self initWithResultCode:resultCode didLocation:didLocation]; + if (!self) { + return nil; + } + self.data = data; + return self; +} + - (void)setResultCode:(SDLVehicleDataResultCode)resultCode { [self.store sdl_setObject:resultCode forName:SDLRPCParameterNameResultCode]; } diff --git a/SmartDeviceLink/public/SDLDateTime.h b/SmartDeviceLink/public/SDLDateTime.h index 905012f448..d685245300 100644 --- a/SmartDeviceLink/public/SDLDateTime.h +++ b/SmartDeviceLink/public/SDLDateTime.h @@ -1,5 +1,34 @@ -// SDLDateTime.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,12 +39,26 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDateTime : SDLRPCStruct +/** + * @param millisecond - millisecond + * @param second - second + * @param minute - minute + * @param hour - hour + * @param day - day + * @param month - month + * @param year - year + * @param tz_hour - tz_hour + * @param tz_minute - tz_minute + * @return A SDLDateTime object + */ +- (instancetype)initWithMillisecond:(nullable NSNumber *)millisecond second:(nullable NSNumber *)second minute:(nullable NSNumber *)minute hour:(nullable NSNumber *)hour day:(nullable NSNumber *)day month:(nullable NSNumber *)month year:(nullable NSNumber *)year tz_hour:(nullable NSNumber *)tz_hour tz_minute:(nullable NSNumber *)tz_minute; + /// Convenience init for creating a date /// /// @param hour Hour part of time /// @param minute Minutes part of time /// @return An SDLDateTime object -- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute; +- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute __deprecated_msg("Use initWithMillisecond:second:minute:hour:day:month:year:tz_hour:tz_minute:"); /// Convenience init for creating a date /// @@ -24,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param second Seconds part of time /// @param millisecond Milliseconds part of time /// @return An SDLDateTime object -- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond; +- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond __deprecated_msg("Use initWithMillisecond:second:minute:hour:day:month:year:tz_hour:tz_minute:"); /// Convenience init for creating a date /// @@ -36,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param month Month of the year /// @param year The year in YYYY format /// @return An SDLDateTime object -- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond day:(UInt8)day month:(UInt8)month year:(UInt16)year; +- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond day:(UInt8)day month:(UInt8)month year:(UInt16)year __deprecated_msg("Use initWithMillisecond:second:minute:hour:day:month:year:tz_hour:tz_minute:"); /// Convenience init for creating a date with all properties /// @@ -50,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param timezoneMinuteOffset Time zone offset in Min with regard to UTC /// @param timezoneHourOffset Time zone offset in Hours with regard to UTC /// @return An SDLDateTime object -- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond day:(UInt8)day month:(UInt8)month year:(UInt16)year timezoneMinuteOffset:(UInt8)timezoneMinuteOffset timezoneHourOffset:(int)timezoneHourOffset; +- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond day:(UInt8)day month:(UInt8)month year:(UInt16)year timezoneMinuteOffset:(UInt8)timezoneMinuteOffset timezoneHourOffset:(int)timezoneHourOffset __deprecated_msg("Use initWithMillisecond:second:minute:hour:day:month:year:tz_hour:tz_minute:"); /** * Milliseconds part of time @@ -101,19 +144,35 @@ NS_ASSUME_NONNULL_BEGIN */ @property (copy, nonatomic) NSNumber *year; +/** + * Time zone offset in Hours wrt UTC. + * {"num_min_value": -12, "num_max_value": 14, "default_value": 0} + * + * @added in SmartDeviceLink 4.1.0 + */ +@property (nullable, strong, nonatomic) NSNumber *tz_hour; + +/** + * Time zone offset in Min wrt UTC. + * {"num_min_value": 0, "num_max_value": 59, "default_value": 0} + * + * @added in SmartDeviceLink 4.1.0 + */ +@property (nullable, strong, nonatomic) NSNumber *tz_minute; + /** * Time zone offset in Min with regard to UTC * * Optional, Integer 0 - 59 */ -@property (copy, nonatomic) NSNumber *timezoneMinuteOffset; +@property (copy, nonatomic) NSNumber *timezoneMinuteOffset __deprecated_msg("Use tz_minute instead"); /** * Time zone offset in Hours with regard to UTC * * Optional, Integer -12 - 14 */ -@property (copy, nonatomic) NSNumber *timezoneHourOffset; +@property (copy, nonatomic) NSNumber *timezoneHourOffset __deprecated_msg("Use tz_hour instead"); @end diff --git a/SmartDeviceLink/public/SDLDateTime.m b/SmartDeviceLink/public/SDLDateTime.m index c5a45214ad..62fe98e041 100644 --- a/SmartDeviceLink/public/SDLDateTime.m +++ b/SmartDeviceLink/public/SDLDateTime.m @@ -8,6 +8,23 @@ @implementation SDLDateTime +- (instancetype)initWithMillisecond:(nullable NSNumber *)millisecond second:(nullable NSNumber *)second minute:(nullable NSNumber *)minute hour:(nullable NSNumber *)hour day:(nullable NSNumber *)day month:(nullable NSNumber *)month year:(nullable NSNumber *)year tz_hour:(nullable NSNumber *)tz_hour tz_minute:(nullable NSNumber *)tz_minute { + self = [self init]; + if (!self) { + return nil; + } + self.millisecond = millisecond; + self.second = second; + self.minute = minute; + self.hour = hour; + self.day = day; + self.month = month; + self.year = year; + self.tz_hour = tz_hour; + self.tz_minute = tz_minute; + return self; +} + - (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute { self = [self init]; if (!self) { @@ -121,6 +138,22 @@ - (void)setYear:(NSNumber *)year { return [self.store sdl_objectForName:SDLRPCParameterNameYear ofClass:NSNumber.class error:&error]; } +- (void)setTz_hour:(nullable NSNumber *)tz_hour { + [self.store sdl_setObject:tz_hour forName:SDLRPCParameterNameTimezoneHourOffset]; +} + +- (nullable NSNumber *)tz_hour { + return [self.store sdl_objectForName:SDLRPCParameterNameTimezoneHourOffset ofClass:NSNumber.class error:nil]; +} + +- (void)setTz_minute:(nullable NSNumber *)tz_minute { + [self.store sdl_setObject:tz_minute forName:SDLRPCParameterNameTimezoneMinuteOffset]; +} + +- (nullable NSNumber *)tz_minute { + return [self.store sdl_objectForName:SDLRPCParameterNameTimezoneMinuteOffset ofClass:NSNumber.class error:nil]; +} + - (void)setTimezoneMinuteOffset:(NSNumber *)timezoneMinuteOffset { [self.store sdl_setObject:timezoneMinuteOffset forName:SDLRPCParameterNameTimezoneMinuteOffset]; } diff --git a/SmartDeviceLink/public/SDLDeleteCommand.h b/SmartDeviceLink/public/SDLDeleteCommand.h index f6b059c204..8b432568c1 100644 --- a/SmartDeviceLink/public/SDLDeleteCommand.h +++ b/SmartDeviceLink/public/SDLDeleteCommand.h @@ -1,5 +1,34 @@ -// SDLDeleteCommand.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" @@ -21,11 +50,17 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLDeleteCommand : SDLRPCRequest +/** + * @param cmdID - @(cmdID) + * @return A SDLDeleteCommand object + */ +- (instancetype)initWithCmdID:(UInt32)cmdID; + /// Convenience init to remove a command from the menu /// /// @param commandId The Command ID that identifies the Command to be deleted from Command Menu /// @return An SDLDeleteCommand object -- (instancetype)initWithId:(UInt32)commandId; +- (instancetype)initWithId:(UInt32)commandId __deprecated_msg("Use initWithCmdID: instead"); /** * the Command ID that identifies the Command to be deleted from Command Menu diff --git a/SmartDeviceLink/public/SDLDeleteCommand.m b/SmartDeviceLink/public/SDLDeleteCommand.m index 563cde4356..e7b895af38 100644 --- a/SmartDeviceLink/public/SDLDeleteCommand.m +++ b/SmartDeviceLink/public/SDLDeleteCommand.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithCmdID:(UInt32)cmdID { + self = [self init]; + if (!self) { + return nil; + } + self.cmdID = @(cmdID); + return self; +} + - (instancetype)initWithId:(UInt32)commandId { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLDeleteFile.h b/SmartDeviceLink/public/SDLDeleteFile.h index 04e1814a15..7074ce6703 100644 --- a/SmartDeviceLink/public/SDLDeleteFile.h +++ b/SmartDeviceLink/public/SDLDeleteFile.h @@ -1,9 +1,41 @@ -// SDLDeleteFile.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" + +NS_ASSUME_NONNULL_BEGIN + /** * Used to delete a file resident on the SDL module in the app's local cache. * Not supported on first generation SDL vehicles @@ -12,22 +44,32 @@ * Since SmartDeviceLink 2.0
* see SDLPutFile SDLListFiles */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLDeleteFile : SDLRPCRequest +/** + * @param sdlFileName - sdlFileName + * @return A SDLDeleteFile object + */ +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName; + /// Convenience init to delete a file /// /// @param fileName A file reference name /// @return An SDLDeleteFile object -- (instancetype)initWithFileName:(NSString *)fileName; +- (instancetype)initWithFileName:(NSString *)fileName __deprecated_msg("Use initWithSdlFileName: instead"); + + +/** + * File reference name. + * {"string_min_length": 1, "string_max_length": 500} + */ +@property (strong, nonatomic) NSString *sdlFileName; /** * a file reference name * @discussion a String value representing a file reference name */ -@property (strong, nonatomic) NSString *syncFileName; +@property (strong, nonatomic) NSString *syncFileName __deprecated_msg("Use sdlFileName instead"); @end diff --git a/SmartDeviceLink/public/SDLDeleteFile.m b/SmartDeviceLink/public/SDLDeleteFile.m index 8c1a0573ac..f992dc8450 100644 --- a/SmartDeviceLink/public/SDLDeleteFile.m +++ b/SmartDeviceLink/public/SDLDeleteFile.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName { + self = [self init]; + if (!self) { + return nil; + } + self.sdlFileName = sdlFileName; + return self; +} + - (instancetype)initWithFileName:(NSString *)fileName { self = [self init]; if (!self) { @@ -32,6 +41,15 @@ - (instancetype)initWithFileName:(NSString *)fileName { return self; } +- (void)setSdlFileName:(NSString *)sdlFileName { + [self.parameters sdl_setObject:sdlFileName forName:SDLRPCParameterNameSyncFileName]; +} + +- (NSString *)sdlFileName { + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSyncFileName ofClass:NSString.class error:&error]; +} + - (void)setSyncFileName:(NSString *)syncFileName { [self.parameters sdl_setObject:syncFileName forName:SDLRPCParameterNameSyncFileName]; } diff --git a/SmartDeviceLink/public/SDLDeleteFileResponse.h b/SmartDeviceLink/public/SDLDeleteFileResponse.h index c639dcdd75..21e1dbcd76 100644 --- a/SmartDeviceLink/public/SDLDeleteFileResponse.h +++ b/SmartDeviceLink/public/SDLDeleteFileResponse.h @@ -1,5 +1,34 @@ -// SDLDeleteFileResponse.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" @@ -14,6 +43,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDeleteFileResponse : SDLRPCResponse +/** + * @param spaceAvailable - spaceAvailable + * @return A SDLDeleteFileResponse object + */ +- (instancetype)initWithSpaceAvailable:(nullable NSNumber *)spaceAvailable; + /** The remaining available space for your application to store data on the remote system. */ diff --git a/SmartDeviceLink/public/SDLDeleteFileResponse.m b/SmartDeviceLink/public/SDLDeleteFileResponse.m index 17db0cb173..724ffc51b9 100644 --- a/SmartDeviceLink/public/SDLDeleteFileResponse.m +++ b/SmartDeviceLink/public/SDLDeleteFileResponse.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSpaceAvailable:(nullable NSNumber *)spaceAvailable { + self = [self init]; + if (!self) { + return nil; + } + self.spaceAvailable = spaceAvailable; + return self; +} + - (void)setSpaceAvailable:(nullable NSNumber *)spaceAvailable { [self.parameters sdl_setObject:spaceAvailable forName:SDLRPCParameterNameSpaceAvailable]; } diff --git a/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.h b/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.h index 19bbc069f5..37c7df2811 100644 --- a/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.h +++ b/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.h @@ -23,11 +23,17 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLDeleteInteractionChoiceSet : SDLRPCRequest +/** + * @param interactionChoiceSetID - @(interactionChoiceSetID) + * @return A SDLDeleteInteractionChoiceSet object + */ +- (instancetype)initWithInteractionChoiceSetID:(UInt32)interactionChoiceSetID; + /// Convenience init to delete a choice set /// /// @param choiceId A unique ID that identifies the Choice Set /// @return An SDLDeleteInteractionChoiceSet object -- (instancetype)initWithId:(UInt32)choiceId; +- (instancetype)initWithId:(UInt32)choiceId __deprecated_msg("Use initWithInteractionChoiceSetID: instead"); /** * a unique ID that identifies the Choice Set diff --git a/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.m b/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.m index 20174145f8..924a286fc9 100644 --- a/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.m +++ b/SmartDeviceLink/public/SDLDeleteInteractionChoiceSet.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithInteractionChoiceSetID:(UInt32)interactionChoiceSetID { + self = [self init]; + if (!self) { + return nil; + } + self.interactionChoiceSetID = @(interactionChoiceSetID); + return self; +} + - (instancetype)initWithId:(UInt32)choiceId { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLDeleteSubMenu.h b/SmartDeviceLink/public/SDLDeleteSubMenu.h index 5f9bf73ff5..40d17833a9 100644 --- a/SmartDeviceLink/public/SDLDeleteSubMenu.h +++ b/SmartDeviceLink/public/SDLDeleteSubMenu.h @@ -1,9 +1,41 @@ -// SDLDeleteSubMenu.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" + +NS_ASSUME_NONNULL_BEGIN + /** * Deletes a submenu from the Command Menu *

@@ -16,16 +48,19 @@ * Since SmartDeviceLink 1.0
* see SDLAddCommand SDLAddSubMenu SDLDeleteCommand */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLDeleteSubMenu : SDLRPCRequest +/** + * @param menuID - @(menuID) + * @return A SDLDeleteSubMenu object + */ +- (instancetype)initWithMenuID:(UInt32)menuID; + /// Convenience init to delete a submenu /// /// @param menuId Identifies the SDLSubMenu to be delete /// @return An SDLDeleteSubMenu object -- (instancetype)initWithId:(UInt32)menuId; +- (instancetype)initWithId:(UInt32)menuId __deprecated_msg("Use initWithMenuID: instead"); /** * the MenuID that identifies the SDLSubMenu to be delete diff --git a/SmartDeviceLink/public/SDLDeleteSubMenu.m b/SmartDeviceLink/public/SDLDeleteSubMenu.m index dedcff6160..a2f5c9be1d 100644 --- a/SmartDeviceLink/public/SDLDeleteSubMenu.m +++ b/SmartDeviceLink/public/SDLDeleteSubMenu.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithMenuID:(UInt32)menuID { + self = [self init]; + if (!self) { + return nil; + } + self.menuID = @(menuID); + return self; +} + - (instancetype)initWithId:(UInt32)menuId { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLDeleteWindow.h b/SmartDeviceLink/public/SDLDeleteWindow.h index 2561b45c12..44d2ab999b 100644 --- a/SmartDeviceLink/public/SDLDeleteWindow.h +++ b/SmartDeviceLink/public/SDLDeleteWindow.h @@ -1,6 +1,34 @@ -// -// SDLDeleteWindow.h -// SmartDeviceLink +/* + * 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" @@ -13,10 +41,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDeleteWindow : SDLRPCRequest +/** + * @param windowID - @(windowID) + * @return A SDLDeleteWindow object + */ +- (instancetype)initWithWindowID:(UInt32)windowID; + /** @param windowId A unique ID to identify the window. The value of '0' will always be the default main window on the main display and cannot be deleted. */ -- (instancetype)initWithId:(NSUInteger)windowId; +- (instancetype)initWithId:(NSUInteger)windowId __deprecated_msg("Use initWithWindowID: instead"); /** A unique ID to identify the window. diff --git a/SmartDeviceLink/public/SDLDeleteWindow.m b/SmartDeviceLink/public/SDLDeleteWindow.m index d4f6189c86..a781f284e9 100644 --- a/SmartDeviceLink/public/SDLDeleteWindow.m +++ b/SmartDeviceLink/public/SDLDeleteWindow.m @@ -19,6 +19,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithWindowID:(UInt32)windowID { + self = [self init]; + if (!self) { + return nil; + } + self.windowID = @(windowID); + return self; +} + - (instancetype)initWithId:(NSUInteger)windowId { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLDeviceInfo.h b/SmartDeviceLink/public/SDLDeviceInfo.h index f30e2d5989..7cc77f764b 100644 --- a/SmartDeviceLink/public/SDLDeviceInfo.h +++ b/SmartDeviceLink/public/SDLDeviceInfo.h @@ -1,5 +1,34 @@ -// SDLDeviceInfo.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" @@ -10,6 +39,17 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDeviceInfo : SDLRPCStruct +/** + * @param hardware - hardware + * @param firmwareRev - firmwareRev + * @param os - os + * @param osVersion - osVersion + * @param carrier - carrier + * @param maxNumberRFCOMMPorts - maxNumberRFCOMMPorts + * @return A SDLDeviceInfo object + */ +- (instancetype)initWithHardware:(nullable NSString *)hardware firmwareRev:(nullable NSString *)firmwareRev os:(nullable NSString *)os osVersion:(nullable NSString *)osVersion carrier:(nullable NSString *)carrier maxNumberRFCOMMPorts:(nullable NSNumber *)maxNumberRFCOMMPorts; + /// Convenience init. Object will contain all information about the connected device automatically. /// /// @return An SDLDeviceInfo object diff --git a/SmartDeviceLink/public/SDLDeviceInfo.m b/SmartDeviceLink/public/SDLDeviceInfo.m index a28f2759ae..efd11749ad 100644 --- a/SmartDeviceLink/public/SDLDeviceInfo.m +++ b/SmartDeviceLink/public/SDLDeviceInfo.m @@ -14,6 +14,20 @@ @implementation SDLDeviceInfo +- (instancetype)initWithHardware:(nullable NSString *)hardware firmwareRev:(nullable NSString *)firmwareRev os:(nullable NSString *)os osVersion:(nullable NSString *)osVersion carrier:(nullable NSString *)carrier maxNumberRFCOMMPorts:(nullable NSNumber *)maxNumberRFCOMMPorts { + self = [self init]; + if (!self) { + return nil; + } + self.hardware = hardware; + self.firmwareRev = firmwareRev; + self.os = os; + self.osVersion = osVersion; + self.carrier = carrier; + self.maxNumberRFCOMMPorts = maxNumberRFCOMMPorts; + return self; +} + + (instancetype)currentDevice { static SDLDeviceInfo *deviceInfo = nil; if (deviceInfo == nil) { diff --git a/SmartDeviceLink/public/SDLDeviceStatus.h b/SmartDeviceLink/public/SDLDeviceStatus.h index 4764ca2236..5da31c2589 100644 --- a/SmartDeviceLink/public/SDLDeviceStatus.h +++ b/SmartDeviceLink/public/SDLDeviceStatus.h @@ -1,5 +1,34 @@ -// SDLDeviceStatus.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" @@ -7,16 +36,31 @@ #import "SDLPrimaryAudioSource.h" +NS_ASSUME_NONNULL_BEGIN + /** Describes the status related to a connected mobile device or SDL and if or how it is represented in the vehicle. @since SDL 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLDeviceStatus : SDLRPCStruct +/** + * @param voiceRecOn - @(voiceRecOn) + * @param btIconOn - @(btIconOn) + * @param callActive - @(callActive) + * @param phoneRoaming - @(phoneRoaming) + * @param textMsgAvailable - @(textMsgAvailable) + * @param battLevelStatus - battLevelStatus + * @param stereoAudioOutputMuted - @(stereoAudioOutputMuted) + * @param monoAudioOutputMuted - @(monoAudioOutputMuted) + * @param signalLevelStatus - signalLevelStatus + * @param primaryAudioSource - primaryAudioSource + * @param eCallEventActive - @(eCallEventActive) + * @return A SDLDeviceStatus object + */ +- (instancetype)initWithVoiceRecOn:(BOOL)voiceRecOn btIconOn:(BOOL)btIconOn callActive:(BOOL)callActive phoneRoaming:(BOOL)phoneRoaming textMsgAvailable:(BOOL)textMsgAvailable battLevelStatus:(SDLDeviceLevelStatus)battLevelStatus stereoAudioOutputMuted:(BOOL)stereoAudioOutputMuted monoAudioOutputMuted:(BOOL)monoAudioOutputMuted signalLevelStatus:(SDLDeviceLevelStatus)signalLevelStatus primaryAudioSource:(SDLPrimaryAudioSource)primaryAudioSource eCallEventActive:(BOOL)eCallEventActive; + /** * Indicates whether the voice recognition is on or off * diff --git a/SmartDeviceLink/public/SDLDeviceStatus.m b/SmartDeviceLink/public/SDLDeviceStatus.m index 2b91012331..7ec633c437 100644 --- a/SmartDeviceLink/public/SDLDeviceStatus.m +++ b/SmartDeviceLink/public/SDLDeviceStatus.m @@ -12,6 +12,25 @@ @implementation SDLDeviceStatus +- (instancetype)initWithVoiceRecOn:(BOOL)voiceRecOn btIconOn:(BOOL)btIconOn callActive:(BOOL)callActive phoneRoaming:(BOOL)phoneRoaming textMsgAvailable:(BOOL)textMsgAvailable battLevelStatus:(SDLDeviceLevelStatus)battLevelStatus stereoAudioOutputMuted:(BOOL)stereoAudioOutputMuted monoAudioOutputMuted:(BOOL)monoAudioOutputMuted signalLevelStatus:(SDLDeviceLevelStatus)signalLevelStatus primaryAudioSource:(SDLPrimaryAudioSource)primaryAudioSource eCallEventActive:(BOOL)eCallEventActive { + self = [self init]; + if (!self) { + return nil; + } + self.voiceRecOn = @(voiceRecOn); + self.btIconOn = @(btIconOn); + self.callActive = @(callActive); + self.phoneRoaming = @(phoneRoaming); + self.textMsgAvailable = @(textMsgAvailable); + self.battLevelStatus = battLevelStatus; + self.stereoAudioOutputMuted = @(stereoAudioOutputMuted); + self.monoAudioOutputMuted = @(monoAudioOutputMuted); + self.signalLevelStatus = signalLevelStatus; + self.primaryAudioSource = primaryAudioSource; + self.eCallEventActive = @(eCallEventActive); + return self; +} + - (void)setVoiceRecOn:(NSNumber *)voiceRecOn { [self.store sdl_setObject:voiceRecOn forName:SDLRPCParameterNameVoiceRecognitionOn]; } diff --git a/SmartDeviceLink/public/SDLDiagnosticMessage.h b/SmartDeviceLink/public/SDLDiagnosticMessage.h index 385c72b4ff..075e3efdf5 100644 --- a/SmartDeviceLink/public/SDLDiagnosticMessage.h +++ b/SmartDeviceLink/public/SDLDiagnosticMessage.h @@ -1,26 +1,63 @@ -// SDLDiagnosticMessage.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" -/** + +NS_ASSUME_NONNULL_BEGIN + +/** * Non periodic vehicle diagnostic request * * @since SDL 3.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLDiagnosticMessage : SDLRPCRequest +/** + * @param targetID - @(targetID) + * @param messageLength - @(messageLength) + * @param messageData - messageData + * @return A SDLDiagnosticMessage object + */ +- (instancetype)initWithTargetID:(UInt16)targetID messageLength:(UInt16)messageLength messageData:(NSArray *> *)messageData; + /// Convenience init /// /// @param targetId Name of target ECU /// @param length Length of message (in bytes) /// @param data Array of bytes comprising CAN message /// @return An SDLDiagnosticMessage object -- (instancetype)initWithTargetId:(UInt16)targetId length:(UInt16)length data:(NSArray *> *)data; +- (instancetype)initWithTargetId:(UInt16)targetId length:(UInt16)length data:(NSArray *> *)data __deprecated_msg("Use initWithTargetID:messageLength:messageData: instead"); /** * Name of target ECU diff --git a/SmartDeviceLink/public/SDLDiagnosticMessage.m b/SmartDeviceLink/public/SDLDiagnosticMessage.m index adef6c9804..ffd35e6fd7 100644 --- a/SmartDeviceLink/public/SDLDiagnosticMessage.m +++ b/SmartDeviceLink/public/SDLDiagnosticMessage.m @@ -21,6 +21,17 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithTargetID:(UInt16)targetID messageLength:(UInt16)messageLength messageData:(NSArray *> *)messageData { + self = [self init]; + if (!self) { + return nil; + } + self.targetID = @(targetID); + self.messageLength = @(messageLength); + self.messageData = messageData; + return self; +} + - (instancetype)initWithTargetId:(UInt16)targetId length:(UInt16)length data:(NSArray *)data { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLDiagnosticMessageResponse.h b/SmartDeviceLink/public/SDLDiagnosticMessageResponse.h index 2912beafab..8c3ec6d3b9 100644 --- a/SmartDeviceLink/public/SDLDiagnosticMessageResponse.h +++ b/SmartDeviceLink/public/SDLDiagnosticMessageResponse.h @@ -1,5 +1,34 @@ -// SDLDiagnosticMessageResponse.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" @@ -13,6 +42,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDiagnosticMessageResponse : SDLRPCResponse +/** + * @param messageDataResult - messageDataResult + * @return A SDLDiagnosticMessageResponse object + */ +- (instancetype)initWithMessageDataResult:(nullable NSArray *> *)messageDataResult; + /** Array of bytes comprising CAN message result. diff --git a/SmartDeviceLink/public/SDLDiagnosticMessageResponse.m b/SmartDeviceLink/public/SDLDiagnosticMessageResponse.m index dbfaa03a27..36389f4eb2 100644 --- a/SmartDeviceLink/public/SDLDiagnosticMessageResponse.m +++ b/SmartDeviceLink/public/SDLDiagnosticMessageResponse.m @@ -20,6 +20,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithMessageDataResult:(nullable NSArray *> *)messageDataResult { + self = [self init]; + if (!self) { + return nil; + } + self.messageDataResult = messageDataResult; + return self; +} + - (void)setMessageDataResult:(nullable NSArray *)messageDataResult { [self.parameters sdl_setObject:messageDataResult forName:SDLRPCParameterNameMessageDataResult]; } diff --git a/SmartDeviceLink/public/SDLDialNumber.h b/SmartDeviceLink/public/SDLDialNumber.h index 44c6b7751b..252c527283 100644 --- a/SmartDeviceLink/public/SDLDialNumber.h +++ b/SmartDeviceLink/public/SDLDialNumber.h @@ -1,17 +1,45 @@ -// -// SDLDialNumber.h -// SmartDeviceLink-iOS +/* + * 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" + +NS_ASSUME_NONNULL_BEGIN + /** This RPC is used to tell the head unit to use bluetooth to dial a phone number using the phone. - + @since SDL 4.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLDialNumber : SDLRPCRequest /// Convenience init to initiate a dial number request diff --git a/SmartDeviceLink/public/SDLDisplayCapabilities.h b/SmartDeviceLink/public/SDLDisplayCapabilities.h index 42fa9723cc..b5318cb74c 100644 --- a/SmartDeviceLink/public/SDLDisplayCapabilities.h +++ b/SmartDeviceLink/public/SDLDisplayCapabilities.h @@ -1,5 +1,34 @@ -// SDLDisplayCapabilities.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" @@ -20,6 +49,27 @@ NS_ASSUME_NONNULL_BEGIN __deprecated_msg("Use SDLSystemCapabilityManager.defaultMainWindowCapability instead") @interface SDLDisplayCapabilities : SDLRPCStruct +/** + * @param textFields - textFields + * @param mediaClockFormats - mediaClockFormats + * @param graphicSupported - @(graphicSupported) + * @return A SDLDisplayCapabilities object + */ +- (instancetype)initWithTextFields:(NSArray *)textFields mediaClockFormats:(NSArray *)mediaClockFormats graphicSupported:(BOOL)graphicSupported; + +/** + * @param textFields - textFields + * @param mediaClockFormats - mediaClockFormats + * @param graphicSupported - @(graphicSupported) + * @param displayName - displayName + * @param imageFields - imageFields + * @param templatesAvailable - templatesAvailable + * @param screenParams - screenParams + * @param numCustomPresetsAvailable - numCustomPresetsAvailable + * @return A SDLDisplayCapabilities object + */ +- (instancetype)initWithTextFields:(NSArray *)textFields mediaClockFormats:(NSArray *)mediaClockFormats graphicSupported:(BOOL)graphicSupported displayName:(nullable NSString *)displayName imageFields:(nullable NSArray *)imageFields templatesAvailable:(nullable NSArray *)templatesAvailable screenParams:(nullable SDLScreenParams *)screenParams numCustomPresetsAvailable:(nullable NSNumber *)numCustomPresetsAvailable; + /** * The type of display * diff --git a/SmartDeviceLink/public/SDLDisplayCapabilities.m b/SmartDeviceLink/public/SDLDisplayCapabilities.m index 78534d9a2a..01337c73d6 100644 --- a/SmartDeviceLink/public/SDLDisplayCapabilities.m +++ b/SmartDeviceLink/public/SDLDisplayCapabilities.m @@ -15,6 +15,30 @@ #pragma clang diagnostic ignored "-Wdeprecated-implementations" @implementation SDLDisplayCapabilities +- (instancetype)initWithTextFields:(NSArray *)textFields mediaClockFormats:(NSArray *)mediaClockFormats graphicSupported:(BOOL)graphicSupported { + self = [self init]; + if (!self) { + return nil; + } + self.textFields = textFields; + self.mediaClockFormats = mediaClockFormats; + self.graphicSupported = @(graphicSupported); + return self; +} + +- (instancetype)initWithTextFields:(NSArray *)textFields mediaClockFormats:(NSArray *)mediaClockFormats graphicSupported:(BOOL)graphicSupported displayName:(nullable NSString *)displayName imageFields:(nullable NSArray *)imageFields templatesAvailable:(nullable NSArray *)templatesAvailable screenParams:(nullable SDLScreenParams *)screenParams numCustomPresetsAvailable:(nullable NSNumber *)numCustomPresetsAvailable { + self = [self initWithTextFields:textFields mediaClockFormats:mediaClockFormats graphicSupported:graphicSupported]; + if (!self) { + return nil; + } + self.displayName = displayName; + self.imageFields = imageFields; + self.templatesAvailable = templatesAvailable; + self.screenParams = screenParams; + self.numCustomPresetsAvailable = numCustomPresetsAvailable; + return self; +} + - (void)setDisplayType:(SDLDisplayType)displayType { [self.store sdl_setObject:displayType forName:SDLRPCParameterNameDisplayType]; } diff --git a/SmartDeviceLink/public/SDLDisplayCapability.h b/SmartDeviceLink/public/SDLDisplayCapability.h index b021a6a10b..e426aff5a3 100644 --- a/SmartDeviceLink/public/SDLDisplayCapability.h +++ b/SmartDeviceLink/public/SDLDisplayCapability.h @@ -1,6 +1,34 @@ -// -// SDLDisplayCapability.h -// SmartDeviceLink +/* + * 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" @@ -16,12 +44,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLDisplayCapability : SDLRPCStruct +/** + * @param displayName - displayName + * @param windowTypeSupported - windowTypeSupported + * @param windowCapabilities - windowCapabilities + * @return A SDLDisplayCapability object + */ +- (instancetype)initWithDisplayName:(nullable NSString *)displayName windowTypeSupported:(nullable NSArray *)windowTypeSupported windowCapabilities:(nullable NSArray *)windowCapabilities; + /** Init with required properties @param displayName Name of the display. */ -- (instancetype)initWithDisplayName:(NSString *)displayName; +- (instancetype)initWithDisplayName:(NSString *)displayName __deprecated_msg("Use initWithDisplayName:windowTypeSupported:windowCapabilities: instead"); /** Init with all the properities @@ -30,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN @param windowCapabilities Contains a list of capabilities of all windows related to the app. @see windowCapabilities @param windowTypeSupported Informs the application how many windows the app is allowed to create per type. */ -- (instancetype)initWithDisplayName:(NSString *)displayName windowCapabilities:(nullable NSArray *)windowCapabilities windowTypeSupported:(nullable NSArray *)windowTypeSupported; +- (instancetype)initWithDisplayName:(NSString *)displayName windowCapabilities:(nullable NSArray *)windowCapabilities windowTypeSupported:(nullable NSArray *)windowTypeSupported __deprecated_msg("Use initWithDisplayName:windowTypeSupported:windowCapabilities: instead"); /** diff --git a/SmartDeviceLink/public/SDLDisplayCapability.m b/SmartDeviceLink/public/SDLDisplayCapability.m index f70f9c024a..5754ae13ed 100644 --- a/SmartDeviceLink/public/SDLDisplayCapability.m +++ b/SmartDeviceLink/public/SDLDisplayCapability.m @@ -11,11 +11,14 @@ @implementation SDLDisplayCapability -- (instancetype)init { - self = [super init]; +- (instancetype)initWithDisplayName:(nullable NSString *)displayName windowTypeSupported:(nullable NSArray *)windowTypeSupported windowCapabilities:(nullable NSArray *)windowCapabilities { + self = [self init]; if (!self) { return nil; } + self.displayName = displayName; + self.windowTypeSupported = windowTypeSupported; + self.windowCapabilities = windowCapabilities; return self; } diff --git a/SmartDeviceLink/public/SDLECallInfo.h b/SmartDeviceLink/public/SDLECallInfo.h index 4d7ccc4aba..5ce6370575 100644 --- a/SmartDeviceLink/public/SDLECallInfo.h +++ b/SmartDeviceLink/public/SDLECallInfo.h @@ -1,5 +1,34 @@ -// SDLECallInfo.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" @@ -13,6 +42,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLECallInfo : SDLRPCStruct +/** + * @param eCallNotificationStatus - eCallNotificationStatus + * @param auxECallNotificationStatus - auxECallNotificationStatus + * @param eCallConfirmationStatus - eCallConfirmationStatus + * @return A SDLECallInfo object + */ +- (instancetype)initWithECallNotificationStatus:(SDLVehicleDataNotificationStatus)eCallNotificationStatus auxECallNotificationStatus:(SDLVehicleDataNotificationStatus)auxECallNotificationStatus eCallConfirmationStatus:(SDLECallConfirmationStatus)eCallConfirmationStatus; + /** References signal "eCallNotification_4A". See VehicleDataNotificationStatus. diff --git a/SmartDeviceLink/public/SDLECallInfo.m b/SmartDeviceLink/public/SDLECallInfo.m index 61820ed2e9..bed04b61bf 100644 --- a/SmartDeviceLink/public/SDLECallInfo.m +++ b/SmartDeviceLink/public/SDLECallInfo.m @@ -10,6 +10,17 @@ @implementation SDLECallInfo +- (instancetype)initWithECallNotificationStatus:(SDLVehicleDataNotificationStatus)eCallNotificationStatus auxECallNotificationStatus:(SDLVehicleDataNotificationStatus)auxECallNotificationStatus eCallConfirmationStatus:(SDLECallConfirmationStatus)eCallConfirmationStatus { + self = [self init]; + if (!self) { + return nil; + } + self.eCallNotificationStatus = eCallNotificationStatus; + self.auxECallNotificationStatus = auxECallNotificationStatus; + self.eCallConfirmationStatus = eCallConfirmationStatus; + return self; +} + - (void)setECallNotificationStatus:(SDLVehicleDataNotificationStatus)eCallNotificationStatus { [self.store sdl_setObject:eCallNotificationStatus forName:SDLRPCParameterNameECallNotificationStatus]; } diff --git a/SmartDeviceLink/public/SDLEmergencyEvent.h b/SmartDeviceLink/public/SDLEmergencyEvent.h index b4d8f4d310..c29dc3c2be 100644 --- a/SmartDeviceLink/public/SDLEmergencyEvent.h +++ b/SmartDeviceLink/public/SDLEmergencyEvent.h @@ -1,5 +1,34 @@ -// SDLEmergencyEvent.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" @@ -14,6 +43,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLEmergencyEvent : SDLRPCStruct +/** + * @param emergencyEventType - emergencyEventType + * @param fuelCutoffStatus - fuelCutoffStatus + * @param rolloverEvent - rolloverEvent + * @param maximumChangeVelocity - @(maximumChangeVelocity) + * @param multipleEvents - multipleEvents + * @return A SDLEmergencyEvent object + */ +- (instancetype)initWithEmergencyEventType:(SDLEmergencyEventType)emergencyEventType fuelCutoffStatus:(SDLFuelCutoffStatus)fuelCutoffStatus rolloverEvent:(SDLVehicleDataEventStatus)rolloverEvent maximumChangeVelocity:(UInt8)maximumChangeVelocity multipleEvents:(SDLVehicleDataEventStatus)multipleEvents; + /** References signal "VedsEvntType_D_Ltchd". See EmergencyEventType. diff --git a/SmartDeviceLink/public/SDLEmergencyEvent.m b/SmartDeviceLink/public/SDLEmergencyEvent.m index 0052ac078f..8552930933 100644 --- a/SmartDeviceLink/public/SDLEmergencyEvent.m +++ b/SmartDeviceLink/public/SDLEmergencyEvent.m @@ -10,6 +10,19 @@ @implementation SDLEmergencyEvent +- (instancetype)initWithEmergencyEventType:(SDLEmergencyEventType)emergencyEventType fuelCutoffStatus:(SDLFuelCutoffStatus)fuelCutoffStatus rolloverEvent:(SDLVehicleDataEventStatus)rolloverEvent maximumChangeVelocity:(UInt8)maximumChangeVelocity multipleEvents:(SDLVehicleDataEventStatus)multipleEvents { + self = [self init]; + if (!self) { + return nil; + } + self.emergencyEventType = emergencyEventType; + self.fuelCutoffStatus = fuelCutoffStatus; + self.rolloverEvent = rolloverEvent; + self.maximumChangeVelocity = @(maximumChangeVelocity); + self.multipleEvents = multipleEvents; + return self; +} + - (void)setEmergencyEventType:(SDLEmergencyEventType)emergencyEventType { [self.store sdl_setObject:emergencyEventType forName:SDLRPCParameterNameEmergencyEventType]; } diff --git a/SmartDeviceLink/public/SDLEncodedSyncPData.h b/SmartDeviceLink/public/SDLEncodedSyncPData.h index 8f81d002b0..2793e3c217 100644 --- a/SmartDeviceLink/public/SDLEncodedSyncPData.h +++ b/SmartDeviceLink/public/SDLEncodedSyncPData.h @@ -1,20 +1,54 @@ -// SDLEncodedSyncPData.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" +NS_ASSUME_NONNULL_BEGIN + /** * Allows encoded data in the form of SyncP packets to be sent to the SYNC module. Legacy / v1 Protocol implementation; use SyncPData instead. * * *** DEPRECATED *** */ - -NS_ASSUME_NONNULL_BEGIN - __deprecated @interface SDLEncodedSyncPData : SDLRPCRequest +/** + * @param data - data + * @return A SDLEncodedSyncPData object + */ +- (instancetype)initWithData:(NSArray *)data; + /** * Contains base64 encoded string of SyncP packets. * diff --git a/SmartDeviceLink/public/SDLEncodedSyncPData.m b/SmartDeviceLink/public/SDLEncodedSyncPData.m index 6db36b6fe7..73a34b6197 100644 --- a/SmartDeviceLink/public/SDLEncodedSyncPData.m +++ b/SmartDeviceLink/public/SDLEncodedSyncPData.m @@ -24,6 +24,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithData:(NSArray *)data { + self = [self init]; + if (!self) { + return nil; + } + self.data = data; + return self; +} + - (void)setData:(NSArray *)data { [self.parameters sdl_setObject:data forName:SDLRPCParameterNameData]; } diff --git a/SmartDeviceLink/public/SDLEqualizerSettings.h b/SmartDeviceLink/public/SDLEqualizerSettings.h index c42db47d20..babcb50cbd 100644 --- a/SmartDeviceLink/public/SDLEqualizerSettings.h +++ b/SmartDeviceLink/public/SDLEqualizerSettings.h @@ -1,5 +1,34 @@ -// SDLEqualizerSettings.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,11 +41,19 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLEqualizerSettings : SDLRPCStruct /// Convenience init -/// +/// /// @param channelId Read-only channel / frequency name /// @param channelSetting Reflects the setting, from 0%-100%. - (instancetype)initWithChannelId:(UInt8)channelId channelSetting:(UInt8)channelSetting; +/** + * @param channelId - @(channelId) + * @param channelSetting - @(channelSetting) + * @param channelName - channelName + * @return A SDLEqualizerSettings object + */ +- (instancetype)initWithChannelId:(UInt8)channelId channelSetting:(UInt8)channelSetting channelName:(nullable NSString *)channelName; + /** * @abstract Read-only channel / frequency name * (e.i. "Treble, Midrange, Bass" or "125 Hz") diff --git a/SmartDeviceLink/public/SDLEqualizerSettings.m b/SmartDeviceLink/public/SDLEqualizerSettings.m index 7db9a35971..279e1cd213 100644 --- a/SmartDeviceLink/public/SDLEqualizerSettings.m +++ b/SmartDeviceLink/public/SDLEqualizerSettings.m @@ -11,13 +11,20 @@ @implementation SDLEqualizerSettings - (instancetype)initWithChannelId:(UInt8)channelId channelSetting:(UInt8)channelSetting { self = [self init]; - if(!self) { + if (!self) { return nil; } - self.channelId = @(channelId); self.channelSetting = @(channelSetting); + return self; +} +- (instancetype)initWithChannelId:(UInt8)channelId channelSetting:(UInt8)channelSetting channelName:(nullable NSString *)channelName { + self = [self initWithChannelId:channelId channelSetting:channelSetting]; + if (!self) { + return nil; + } + self.channelName = channelName; return self; } diff --git a/SmartDeviceLink/public/SDLFuelRange.h b/SmartDeviceLink/public/SDLFuelRange.h index 981ecd94bb..6225879516 100644 --- a/SmartDeviceLink/public/SDLFuelRange.h +++ b/SmartDeviceLink/public/SDLFuelRange.h @@ -1,10 +1,34 @@ -// -// SDLFuelRange.h -// SmartDeviceLink -// -// Created by Nicole on 6/20/18. -// Copyright © 2018 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 "SDLCapacityUnit.h" #import "SDLComponentVolumeStatus.h" @@ -18,6 +42,17 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLFuelRange : SDLRPCStruct +/** + * @param type - type + * @param range - range + * @param level - level + * @param levelState - levelState + * @param capacity - capacity + * @param capacityUnit - capacityUnit + * @return A SDLFuelRange object + */ +- (instancetype)initWithTypeParam:(nullable SDLFuelType)type range:(nullable NSNumber *)range level:(nullable NSNumber *)level levelState:(nullable SDLComponentVolumeStatus)levelState capacity:(nullable NSNumber *)capacity capacityUnit:(nullable SDLCapacityUnit)capacityUnit __deprecated; + /** * @param type - type * @param range - @(range) @@ -27,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN * @param capacityUnit - capacityUnit * @return A SDLFuelRange object */ -- (instancetype)initWithType:(nullable SDLFuelType)type range:(float)range level:(float)level levelState:(nullable SDLComponentVolumeStatus)levelState capacity:(float)capacity capacityUnit:(nullable SDLCapacityUnit)capacityUnit; +- (instancetype)initWithType:(nullable SDLFuelType)type range:(float)range level:(float)level levelState:(nullable SDLComponentVolumeStatus)levelState capacity:(float)capacity capacityUnit:(nullable SDLCapacityUnit)capacityUnit __deprecated; /** * The absolute capacity of this fuel type. diff --git a/SmartDeviceLink/public/SDLFuelRange.m b/SmartDeviceLink/public/SDLFuelRange.m index f8e54736d9..041b23bd34 100644 --- a/SmartDeviceLink/public/SDLFuelRange.m +++ b/SmartDeviceLink/public/SDLFuelRange.m @@ -15,6 +15,20 @@ @implementation SDLFuelRange +- (instancetype)initWithTypeParam:(nullable SDLFuelType)type range:(nullable NSNumber *)range level:(nullable NSNumber *)level levelState:(nullable SDLComponentVolumeStatus)levelState capacity:(nullable NSNumber *)capacity capacityUnit:(nullable SDLCapacityUnit)capacityUnit { + self = [self init]; + if (!self) { + return nil; + } + self.type = type; + self.range = range; + self.level = level; + self.levelState = levelState; + self.capacity = capacity; + self.capacityUnit = capacityUnit; + return self; +} + - (instancetype)initWithType:(nullable SDLFuelType)type range:(float)range level:(float)level levelState:(nullable SDLComponentVolumeStatus)levelState capacity:(float)capacity capacityUnit:(nullable SDLCapacityUnit)capacityUnit { self = [super init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGPSData.h b/SmartDeviceLink/public/SDLGPSData.h index 417a99ac38..7ac85d13ed 100644 --- a/SmartDeviceLink/public/SDLGPSData.h +++ b/SmartDeviceLink/public/SDLGPSData.h @@ -1,5 +1,34 @@ -// SDLGPSData.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" @@ -7,16 +36,46 @@ #import "SDLDimension.h" +NS_ASSUME_NONNULL_BEGIN + /** * Describes the GPS data. Not all data will be available on all carlines. - * + * * @since SDL 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLGPSData : SDLRPCStruct +/** + * @param longitudeDegrees - @(longitudeDegrees) + * @param latitudeDegrees - @(latitudeDegrees) + * @return A SDLGPSData object + */ +- (instancetype)initWithLongitudeDegrees:(float)longitudeDegrees latitudeDegrees:(float)latitudeDegrees; + +/** + * @param longitudeDegrees - @(longitudeDegrees) + * @param latitudeDegrees - @(latitudeDegrees) + * @param utcYear - utcYear + * @param utcMonth - utcMonth + * @param utcDay - utcDay + * @param utcHours - utcHours + * @param utcMinutes - utcMinutes + * @param utcSeconds - utcSeconds + * @param compassDirection - compassDirection + * @param pdop - pdop + * @param hdop - hdop + * @param vdop - vdop + * @param actual - actual + * @param satellites - satellites + * @param dimension - dimension + * @param altitude - altitude + * @param heading - heading + * @param speed - speed + * @param shifted - shifted + * @return A SDLGPSData object + */ +- (instancetype)initWithLongitudeDegrees:(float)longitudeDegrees latitudeDegrees:(float)latitudeDegrees utcYear:(nullable NSNumber *)utcYear utcMonth:(nullable NSNumber *)utcMonth utcDay:(nullable NSNumber *)utcDay utcHours:(nullable NSNumber *)utcHours utcMinutes:(nullable NSNumber *)utcMinutes utcSeconds:(nullable NSNumber *)utcSeconds compassDirection:(nullable SDLCompassDirection)compassDirection pdop:(nullable NSNumber *)pdop hdop:(nullable NSNumber *)hdop vdop:(nullable NSNumber *)vdop actual:(nullable NSNumber *)actual satellites:(nullable NSNumber *)satellites dimension:(nullable SDLDimension)dimension altitude:(nullable NSNumber *)altitude heading:(nullable NSNumber *)heading speed:(nullable NSNumber *)speed shifted:(nullable NSNumber *)shifted; + /** * longitude degrees * diff --git a/SmartDeviceLink/public/SDLGPSData.m b/SmartDeviceLink/public/SDLGPSData.m index e70c6ff328..fb12cc0a7a 100644 --- a/SmartDeviceLink/public/SDLGPSData.m +++ b/SmartDeviceLink/public/SDLGPSData.m @@ -10,6 +10,41 @@ @implementation SDLGPSData +- (instancetype)initWithLongitudeDegrees:(float)longitudeDegrees latitudeDegrees:(float)latitudeDegrees { + self = [self init]; + if (!self) { + return nil; + } + self.longitudeDegrees = @(longitudeDegrees); + self.latitudeDegrees = @(latitudeDegrees); + return self; +} + +- (instancetype)initWithLongitudeDegrees:(float)longitudeDegrees latitudeDegrees:(float)latitudeDegrees utcYear:(nullable NSNumber *)utcYear utcMonth:(nullable NSNumber *)utcMonth utcDay:(nullable NSNumber *)utcDay utcHours:(nullable NSNumber *)utcHours utcMinutes:(nullable NSNumber *)utcMinutes utcSeconds:(nullable NSNumber *)utcSeconds compassDirection:(nullable SDLCompassDirection)compassDirection pdop:(nullable NSNumber *)pdop hdop:(nullable NSNumber *)hdop vdop:(nullable NSNumber *)vdop actual:(nullable NSNumber *)actual satellites:(nullable NSNumber *)satellites dimension:(nullable SDLDimension)dimension altitude:(nullable NSNumber *)altitude heading:(nullable NSNumber *)heading speed:(nullable NSNumber *)speed shifted:(nullable NSNumber *)shifted { + self = [self initWithLongitudeDegrees:longitudeDegrees latitudeDegrees:latitudeDegrees]; + if (!self) { + return nil; + } + self.utcYear = utcYear; + self.utcMonth = utcMonth; + self.utcDay = utcDay; + self.utcHours = utcHours; + self.utcMinutes = utcMinutes; + self.utcSeconds = utcSeconds; + self.compassDirection = compassDirection; + self.pdop = pdop; + self.hdop = hdop; + self.vdop = vdop; + self.actual = actual; + self.satellites = satellites; + self.dimension = dimension; + self.altitude = altitude; + self.heading = heading; + self.speed = speed; + self.shifted = shifted; + return self; +} + - (void)setLongitudeDegrees:(NSNumber *)longitudeDegrees { [self.store sdl_setObject:longitudeDegrees forName:SDLRPCParameterNameLongitudeDegrees]; } diff --git a/SmartDeviceLink/public/SDLGetAppServiceData.h b/SmartDeviceLink/public/SDLGetAppServiceData.h index e1882a350d..6a97f34136 100644 --- a/SmartDeviceLink/public/SDLGetAppServiceData.h +++ b/SmartDeviceLink/public/SDLGetAppServiceData.h @@ -18,6 +18,19 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLGetAppServiceData : SDLRPCRequest +/** + * @param serviceType - serviceType + * @return A SDLGetAppServiceData object + */ +- (instancetype)initWithServiceType:(NSString *)serviceType; + +/** + * @param serviceType - serviceType + * @param subscribe - subscribe + * @return A SDLGetAppServiceData object + */ +- (instancetype)initWithServiceType:(NSString *)serviceType subscribe:(nullable NSNumber *)subscribe; + /** * Convenience init for service type. * diff --git a/SmartDeviceLink/public/SDLGetAppServiceData.m b/SmartDeviceLink/public/SDLGetAppServiceData.m index 55efbbdd9c..861bf69a67 100644 --- a/SmartDeviceLink/public/SDLGetAppServiceData.m +++ b/SmartDeviceLink/public/SDLGetAppServiceData.m @@ -25,36 +25,43 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType { +- (instancetype)initWithServiceType:(NSString *)serviceType { self = [self init]; if (!self) { return nil; } - self.serviceType = serviceType; - return self; } -- (instancetype)initAndSubscribeToAppServiceType:(SDLAppServiceType)serviceType { - return [self initWithServiceType:serviceType subscribe:YES]; -} - -- (instancetype)initAndUnsubscribeToAppServiceType:(SDLAppServiceType)serviceType { - return [self initWithServiceType:serviceType subscribe:NO]; +- (instancetype)initWithServiceType:(NSString *)serviceType subscribe:(nullable NSNumber *)subscribe { + self = [self initWithServiceType:serviceType]; + if (!self) { + return nil; + } + self.subscribe = subscribe; + return self; } -- (instancetype)initWithServiceType:(SDLAppServiceType)serviceType subscribe:(BOOL)subscribe { - self = [self initWithAppServiceType:serviceType]; +- (instancetype)initWithAppServiceType:(SDLAppServiceType)serviceType { + self = [self init]; if (!self) { return nil; } - self.subscribe = @(subscribe); + self.serviceType = serviceType; return self; } +- (instancetype)initAndSubscribeToAppServiceType:(SDLAppServiceType)serviceType { + return [self initWithServiceType:serviceType subscribe:@YES]; +} + +- (instancetype)initAndUnsubscribeToAppServiceType:(SDLAppServiceType)serviceType { + return [self initWithServiceType:serviceType subscribe:@NO]; +} + - (void)setServiceType:(NSString *)serviceType { [self.parameters sdl_setObject:serviceType forName:SDLRPCParameterNameServiceType]; } diff --git a/SmartDeviceLink/public/SDLGetAppServiceDataResponse.h b/SmartDeviceLink/public/SDLGetAppServiceDataResponse.h index 30b2c6cc83..15d1b20a60 100644 --- a/SmartDeviceLink/public/SDLGetAppServiceDataResponse.h +++ b/SmartDeviceLink/public/SDLGetAppServiceDataResponse.h @@ -1,10 +1,34 @@ -// -// SDLGetAppServiceDataResponse.h -// SmartDeviceLink -// -// Created by Nicole on 2/6/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 "SDLRPCResponse.h" @@ -17,13 +41,19 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLGetAppServiceDataResponse : SDLRPCResponse +/** + * @param serviceData - serviceData + * @return A SDLGetAppServiceDataResponse object + */ +- (instancetype)initWithServiceData:(nullable SDLAppServiceData *)serviceData; + /** * Convenience init. * * @param serviceData Contains all the current data of the app service * @return A SDLGetAppServiceDataResponse object */ -- (instancetype)initWithAppServiceData:(SDLAppServiceData *)serviceData; +- (instancetype)initWithAppServiceData:(SDLAppServiceData *)serviceData __deprecated_msg("Use initWithServiceData: instead"); /** * Contains all the current data of the app service. diff --git a/SmartDeviceLink/public/SDLGetAppServiceDataResponse.m b/SmartDeviceLink/public/SDLGetAppServiceDataResponse.m index 110d6732a5..2665a36115 100644 --- a/SmartDeviceLink/public/SDLGetAppServiceDataResponse.m +++ b/SmartDeviceLink/public/SDLGetAppServiceDataResponse.m @@ -26,6 +26,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithServiceData:(nullable SDLAppServiceData *)serviceData { + self = [self init]; + if (!self) { + return nil; + } + self.serviceData = serviceData; + return self; +} + - (instancetype)initWithAppServiceData:(SDLAppServiceData *)serviceData { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.h b/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.h index 356bd32e02..8a487182c3 100644 --- a/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.h +++ b/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.h @@ -1,10 +1,35 @@ -// -// SDLGetCloudAppPropertiesResponse.h -// SmartDeviceLink -// -// Created by Nicole on 2/26/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 "SDLRPCResponse.h" @@ -24,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN * @param properties The requested cloud application properties * @return A SDLGetCloudAppPropertiesResponse object */ -- (instancetype)initWithProperties:(SDLCloudAppProperties *)properties; +- (instancetype)initWithProperties:(nullable SDLCloudAppProperties *)properties; /** * The requested cloud application properties. diff --git a/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.m b/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.m index 6114c46364..4f31d63c94 100644 --- a/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.m +++ b/SmartDeviceLink/public/SDLGetCloudAppPropertiesResponse.m @@ -27,7 +27,7 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithProperties:(SDLCloudAppProperties *)properties { +- (instancetype)initWithProperties:(nullable SDLCloudAppProperties *)properties { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/public/SDLGetDTCs.h b/SmartDeviceLink/public/SDLGetDTCs.h index 2ba8339d58..3943c7afe1 100644 --- a/SmartDeviceLink/public/SDLGetDTCs.h +++ b/SmartDeviceLink/public/SDLGetDTCs.h @@ -1,9 +1,40 @@ -// SDLGetDTCs.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" +NS_ASSUME_NONNULL_BEGIN + /** * This RPC allows to request diagnostic module trouble codes from a certain * vehicle module @@ -13,23 +44,33 @@ * HMILevel needs to be FULL, LIMITED or BACKGROUND *

*/ +@interface SDLGetDTCs : SDLRPCRequest -NS_ASSUME_NONNULL_BEGIN +/** + * @param ecuName - @(ecuName) + * @return A SDLGetDTCs object + */ +- (instancetype)initWithEcuName:(UInt16)ecuName; -@interface SDLGetDTCs : SDLRPCRequest +/** + * @param ecuName - @(ecuName) + * @param dtcMask - dtcMask + * @return A SDLGetDTCs object + */ +- (instancetype)initWithEcuName:(UInt16)ecuName dtcMask:(nullable NSNumber *)dtcMask; /// Convenience init /// /// @param name Name of the module to receive the DTC form /// @return An SDLGetDTCs object -- (instancetype)initWithECUName:(UInt16)name; +- (instancetype)initWithECUName:(UInt16)name __deprecated_msg("Use initWithEcuName: instead"); /// Convenience init with all properties /// /// @param name Name of the module to receive the DTC form /// @param mask DTC Mask Byte to be sent in diagnostic request to module /// @return An SDLGetDTCs object -- (instancetype)initWithECUName:(UInt16)name mask:(UInt8)mask; +- (instancetype)initWithECUName:(UInt16)name mask:(UInt8)mask __deprecated_msg("Use initWithEcuName: instead"); /** * a name of the module to receive the DTC form diff --git a/SmartDeviceLink/public/SDLGetDTCs.m b/SmartDeviceLink/public/SDLGetDTCs.m index 95fcff1b82..8fe959ead1 100644 --- a/SmartDeviceLink/public/SDLGetDTCs.m +++ b/SmartDeviceLink/public/SDLGetDTCs.m @@ -21,6 +21,24 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithEcuName:(UInt16)ecuName { + self = [self init]; + if (!self) { + return nil; + } + self.ecuName = @(ecuName); + return self; +} + +- (instancetype)initWithEcuName:(UInt16)ecuName dtcMask:(nullable NSNumber *)dtcMask { + self = [self initWithEcuName:ecuName]; + if (!self) { + return nil; + } + self.dtcMask = dtcMask; + return self; +} + - (instancetype)initWithECUName:(UInt16)name mask:(UInt8)mask { self = [self initWithECUName:name]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGetDTCsResponse.h b/SmartDeviceLink/public/SDLGetDTCsResponse.h index fd05f41968..c6757ac7d1 100644 --- a/SmartDeviceLink/public/SDLGetDTCsResponse.h +++ b/SmartDeviceLink/public/SDLGetDTCsResponse.h @@ -1,19 +1,55 @@ -// SDLGetDTCsResponse.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 SDLGetDTCs - + Since SmartDeviceLink 2.0 */ -NS_ASSUME_NONNULL_BEGIN - @interface SDLGetDTCsResponse : SDLRPCResponse +/** + * @param ecuHeader - ecuHeader + * @param dtc - dtc + * @return A SDLGetDTCsResponse object + */ +- (instancetype)initWithEcuHeader:(nullable NSNumber *)ecuHeader dtc:(nullable NSArray *)dtc; + /** 2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf) diff --git a/SmartDeviceLink/public/SDLGetDTCsResponse.m b/SmartDeviceLink/public/SDLGetDTCsResponse.m index 3d141c96a9..953b3403a7 100644 --- a/SmartDeviceLink/public/SDLGetDTCsResponse.m +++ b/SmartDeviceLink/public/SDLGetDTCsResponse.m @@ -21,6 +21,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithEcuHeader:(nullable NSNumber *)ecuHeader dtc:(nullable NSArray *)dtc { + self = [self init]; + if (!self) { + return nil; + } + self.ecuHeader = ecuHeader; + self.dtc = dtc; + return self; +} + - (void)setEcuHeader:(nullable NSNumber *)ecuHeader { [self.parameters sdl_setObject:ecuHeader forName:SDLRPCParameterNameECUHeader]; } diff --git a/SmartDeviceLink/public/SDLGetFile.h b/SmartDeviceLink/public/SDLGetFile.h index bdc7936d94..10b614089b 100644 --- a/SmartDeviceLink/public/SDLGetFile.h +++ b/SmartDeviceLink/public/SDLGetFile.h @@ -24,6 +24,16 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithFileName:(NSString *)fileName; +/** + * @param fileName - fileName + * @param appServiceId - appServiceId + * @param fileType - fileType + * @param offset - offset + * @param length - length + * @return A SDLGetFile object + */ +- (instancetype)initWithFileNameParam:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType offset:(nullable NSNumber *)offset length:(nullable NSNumber *)length __deprecated_msg("This will eventually be replaced with a non-param initializer"); + /** * Convenience init for sending a small file. * @@ -32,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN * @param fileType Selected file type * @return A SDLGetFile object */ -- (instancetype)initWithFileName:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType; +- (instancetype)initWithFileName:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType __deprecated_msg("Use initWithFileName: instead"); /** * Convenience init for sending a large file in multiple data chunks. @@ -44,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN * @param length Length in bytes for resuming partial data chunks * @return A SDLGetFile object */ -- (instancetype)initWithFileName:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType offset:(UInt32)offset length:(UInt32)length; +- (instancetype)initWithFileName:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType offset:(UInt32)offset length:(UInt32)length __deprecated_msg("The parameter types will eventually change"); /** * File name that should be retrieved. diff --git a/SmartDeviceLink/public/SDLGetFile.m b/SmartDeviceLink/public/SDLGetFile.m index b39dce9ace..210b0b33c6 100644 --- a/SmartDeviceLink/public/SDLGetFile.m +++ b/SmartDeviceLink/public/SDLGetFile.m @@ -31,9 +31,19 @@ - (instancetype)initWithFileName:(NSString *)fileName { if (!self) { return nil; } - self.fileName = fileName; + return self; +} +- (instancetype)initWithFileNameParam:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType offset:(nullable NSNumber *)offset length:(nullable NSNumber *)length { + self = [self initWithFileName:fileName]; + if (!self) { + return nil; + } + self.appServiceId = appServiceId; + self.fileType = fileType; + self.offset = offset; + self.length = length; return self; } @@ -50,11 +60,13 @@ - (instancetype)initWithFileName:(NSString *)fileName appServiceId:(nullable NSS } - (instancetype)initWithFileName:(NSString *)fileName appServiceId:(nullable NSString *)appServiceId fileType:(nullable SDLFileType)fileType offset:(UInt32)offset length:(UInt32)length { - self = [self initWithFileName:fileName appServiceId:appServiceId fileType:fileType]; + self = [self initWithFileName:fileName]; if (!self) { return nil; } + self.appServiceId = appServiceId; + self.fileType = fileType; self.offset = @(offset); self.length = @(length); diff --git a/SmartDeviceLink/public/SDLGetFileResponse.h b/SmartDeviceLink/public/SDLGetFileResponse.h index 52a2fb5f4c..e42c372b08 100644 --- a/SmartDeviceLink/public/SDLGetFileResponse.h +++ b/SmartDeviceLink/public/SDLGetFileResponse.h @@ -1,10 +1,34 @@ -// -// SDLGetFileResponse.h -// SmartDeviceLink -// -// Created by Nicole on 2/7/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 "SDLRPCResponse.h" @@ -17,6 +41,15 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 5.1 @interface SDLGetFileResponse : SDLRPCResponse +/** + * @param offset - offset + * @param length - length + * @param fileType - fileType + * @param crc - crc + * @return A SDLGetFileResponse object + */ +- (instancetype)initWithOffsetParam:(nullable NSNumber *)offset length:(nullable NSNumber *)length fileType:(nullable SDLFileType)fileType crc:(nullable NSNumber *)crc __deprecated_msg("This will eventually be replaced with a non-param version"); + /** * Convenience init for all parameters. * @@ -26,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN * @param crc Additional CRC32 checksum to protect data integrity up to 512 Mbits * @return A SDLGetFileResponse object */ -- (instancetype)initWithOffset:(UInt32)offset length:(UInt32)length fileType:(nullable SDLFileType)fileType crc:(UInt32)crc; +- (instancetype)initWithOffset:(UInt32)offset length:(UInt32)length fileType:(nullable SDLFileType)fileType crc:(UInt32)crc __deprecated_msg("This will eventually be replaced with a similar initializer with different parameter types"); /** * Optional offset in bytes for resuming partial data chunks. diff --git a/SmartDeviceLink/public/SDLGetFileResponse.m b/SmartDeviceLink/public/SDLGetFileResponse.m index 57a2b3f7f1..4891c35ac8 100644 --- a/SmartDeviceLink/public/SDLGetFileResponse.m +++ b/SmartDeviceLink/public/SDLGetFileResponse.m @@ -25,6 +25,18 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithOffsetParam:(nullable NSNumber *)offset length:(nullable NSNumber *)length fileType:(nullable SDLFileType)fileType crc:(nullable NSNumber *)crc { + self = [self init]; + if (!self) { + return nil; + } + self.offset = offset; + self.length = length; + self.fileType = fileType; + self.crc = crc; + return self; +} + - (instancetype)initWithOffset:(UInt32)offset length:(UInt32)length fileType:(nullable SDLFileType)fileType crc:(UInt32)crc { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGetInteriorVehicleData.h b/SmartDeviceLink/public/SDLGetInteriorVehicleData.h index 2f0e087839..543393defb 100644 --- a/SmartDeviceLink/public/SDLGetInteriorVehicleData.h +++ b/SmartDeviceLink/public/SDLGetInteriorVehicleData.h @@ -1,11 +1,41 @@ -// -// SDLGetInteriorVehicleData.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" #import "SDLModuleInfo.h" +NS_ASSUME_NONNULL_BEGIN + /** * Reads the current status value of specified remote control module (type). * When subscribe is true, subscribes for specific remote control module data items. @@ -13,31 +43,42 @@ * Once subscribed, the application will be notified by the onInteriorVehicleData RPC notification * whenever new data is available for the module. */ +@interface SDLGetInteriorVehicleData : SDLRPCRequest -NS_ASSUME_NONNULL_BEGIN +/** + * @param moduleType - moduleType + * @return A SDLGetInteriorVehicleData object + */ +- (instancetype)initWithModuleType:(SDLModuleType)moduleType; -@interface SDLGetInteriorVehicleData : SDLRPCRequest +/** + * @param moduleType - moduleType + * @param moduleId - moduleId + * @param subscribe - subscribe + * @return A SDLGetInteriorVehicleData object + */ +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId subscribe:(nullable NSNumber *)subscribe; /// Convenience init to get information of a particular module type with a module ID. /// /// @param moduleType The type of a RC module to retrieve module data from the vehicle /// @param moduleId Id of a module, published by System Capability /// @return An SDLGetInteriorVehicleData object -- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId __deprecated_msg("Use initWithModuleType:moduleId:subscribe: instead"); /// Convenience init to get information and subscribe to a particular module type with a module ID. /// /// @param moduleType The type of a RC module to retrieve module data from the vehicle /// @param moduleId Id of a module, published by System Capability /// @return An SDLGetInteriorVehicleData object -- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; +- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId __deprecated_msg("Use initWithModuleType:moduleId:subscribe: instead"); /// Convenience init to unsubscribe from particular module with a module ID. /// /// @param moduleType The type of a RC module to retrieve module data from the vehicle /// @param moduleId Id of a module, published by System Capability /// @return An SDLGetInteriorVehicleData object -- (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; +- (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId __deprecated_msg("Use initWithModuleType:moduleId:subscribe: instead"); /** * The type of a RC module to retrieve module data from the vehicle. diff --git a/SmartDeviceLink/public/SDLGetInteriorVehicleData.m b/SmartDeviceLink/public/SDLGetInteriorVehicleData.m index 5206221641..7cec97dce6 100755 --- a/SmartDeviceLink/public/SDLGetInteriorVehicleData.m +++ b/SmartDeviceLink/public/SDLGetInteriorVehicleData.m @@ -20,6 +20,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithModuleType:(SDLModuleType)moduleType { + self = [self init]; + if (!self) { + return nil; + } + self.moduleType = moduleType; + return self; +} + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId subscribe:(nullable NSNumber *)subscribe { + self = [self initWithModuleType:moduleType]; + if (!self) { + return nil; + } + self.moduleId = moduleId; + self.subscribe = subscribe; + return self; +} + - (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.h b/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.h index cbe315df2e..798dd41095 100644 --- a/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.h +++ b/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.h @@ -1,10 +1,34 @@ -// -// SDLGetInteriorVehicleDataConsentResponse.h -// SmartDeviceLink -// -// Created by standa1 on 7/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 "SDLRPCResponse.h" @@ -15,6 +39,12 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 6.0 @interface SDLGetInteriorVehicleDataConsentResponse : SDLRPCResponse +/** + * @param allowed - allowed + * @return A SDLGetInteriorVehicleDataConsentResponse object + */ +- (instancetype)initWithAllowed:(nullable NSArray *> *)allowed; + /** This array has the same size as "moduleIds" in the request; each element corresponding to one moduleId "true" - if SDL grants the permission for the requested module diff --git a/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.m b/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.m index 369b636452..1cc6d82d20 100644 --- a/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.m +++ b/SmartDeviceLink/public/SDLGetInteriorVehicleDataConsentResponse.m @@ -22,6 +22,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithAllowed:(nullable NSArray *> *)allowed { + self = [self init]; + if (!self) { + return nil; + } + self.allowed = allowed; + return self; +} + - (void)setAllowed:(nullable NSArray *)allowed { [self.parameters sdl_setObject:allowed forName:SDLRPCParameterNameAllowed]; } diff --git a/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.h b/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.h index 5ab234ed07..3592020317 100644 --- a/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.h @@ -1,6 +1,34 @@ -// -// SDLGetInteriorVehicleDataResponse.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" @class SDLModuleData; @@ -9,9 +37,18 @@ NS_ASSUME_NONNULL_BEGIN /** A response to SDLGetInteriorVehicleData + + @added in SmartDeviceLink 4.5.0 */ @interface SDLGetInteriorVehicleDataResponse : SDLRPCResponse +/** + * @param moduleData - moduleData + * @param isSubscribed - isSubscribed + * @return A SDLGetInteriorVehicleDataResponse object + */ +- (instancetype)initWithModuleData:(nullable SDLModuleData *)moduleData isSubscribed:(nullable NSNumber *)isSubscribed; + /** The requested data diff --git a/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.m b/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.m index c729e66ee5..a2215f89d9 100644 --- a/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLGetInteriorVehicleDataResponse.m @@ -22,6 +22,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithModuleData:(nullable SDLModuleData *)moduleData isSubscribed:(nullable NSNumber *)isSubscribed { + self = [self init]; + if (!self) { + return nil; + } + self.moduleData = moduleData; + self.isSubscribed = isSubscribed; + return self; +} + - (void)setModuleData:(nullable SDLModuleData *)moduleData { [self.parameters sdl_setObject:moduleData forName:SDLRPCParameterNameModuleData]; } diff --git a/SmartDeviceLink/public/SDLGetSystemCapability.h b/SmartDeviceLink/public/SDLGetSystemCapability.h index 004074ea5f..5bdb54afb5 100644 --- a/SmartDeviceLink/public/SDLGetSystemCapability.h +++ b/SmartDeviceLink/public/SDLGetSystemCapability.h @@ -1,10 +1,34 @@ -// -// SDLGetSystemCapability.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/11/17. -// Copyright © 2017 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 @@ -20,13 +44,26 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLGetSystemCapability : SDLRPCRequest +/** + * @param systemCapabilityType - systemCapabilityType + * @return A SDLGetSystemCapability object + */ +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType; + +/** + * @param systemCapabilityType - systemCapabilityType + * @param subscribe - subscribe + * @return A SDLGetSystemCapability object + */ +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType subscribe:(nullable NSNumber *)subscribe; + /** * Convenience init * * @param type The type of system capability * @return A SDLSystemCapabilityType object */ -- (instancetype)initWithType:(SDLSystemCapabilityType)type; +- (instancetype)initWithType:(SDLSystemCapabilityType)type __deprecated_msg("Use initWithSystemCapabilityType: instead"); /** * Convenience init @@ -35,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN * @param subscribe Whether or not to subscribe to updates of the supplied service capability type * @return A SDLSystemCapabilityType object */ -- (instancetype)initWithType:(SDLSystemCapabilityType)type subscribe:(BOOL)subscribe; +- (instancetype)initWithType:(SDLSystemCapabilityType)type subscribe:(BOOL)subscribe __deprecated_msg("Use initWithSystemCapabilityType:subscribe: instead"); /** * The type of system capability to get more information on diff --git a/SmartDeviceLink/public/SDLGetSystemCapability.m b/SmartDeviceLink/public/SDLGetSystemCapability.m index 0e966de18a..77c04c1a8c 100644 --- a/SmartDeviceLink/public/SDLGetSystemCapability.m +++ b/SmartDeviceLink/public/SDLGetSystemCapability.m @@ -26,6 +26,24 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType { + self = [self init]; + if (!self) { + return nil; + } + self.systemCapabilityType = systemCapabilityType; + return self; +} + +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType subscribe:(nullable NSNumber *)subscribe { + self = [self initWithSystemCapabilityType:systemCapabilityType]; + if (!self) { + return nil; + } + self.subscribe = subscribe; + return self; +} + - (instancetype)initWithType:(SDLSystemCapabilityType)type { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.h b/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.h index 215a4c4099..133b840db6 100644 --- a/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.h +++ b/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.h @@ -1,10 +1,34 @@ -// -// SDLGetSystemCapabilityResponse.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/11/17. -// Copyright © 2017 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 @@ -20,6 +44,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLGetSystemCapabilityResponse : SDLRPCResponse +/** + * @param systemCapability - systemCapability + * @return A SDLGetSystemCapabilityResponse object + */ +- (instancetype)initWithSystemCapability:(nullable SDLSystemCapability *)systemCapability; + /** The requested system capability, of the type that was sent in the request diff --git a/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.m b/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.m index 730f74c71d..d3ee854fa2 100644 --- a/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.m +++ b/SmartDeviceLink/public/SDLGetSystemCapabilityResponse.m @@ -30,6 +30,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSystemCapability:(nullable SDLSystemCapability *)systemCapability { + self = [self init]; + if (!self) { + return nil; + } + self.systemCapability = systemCapability; + return self; +} + - (void)setSystemCapability:(nullable SDLSystemCapability *)systemCapability { [self.parameters sdl_setObject:systemCapability forName:SDLRPCParameterNameSystemCapability]; } diff --git a/SmartDeviceLink/public/SDLGetVehicleData.h b/SmartDeviceLink/public/SDLGetVehicleData.h index e8c30889c0..36091ffe95 100644 --- a/SmartDeviceLink/public/SDLGetVehicleData.h +++ b/SmartDeviceLink/public/SDLGetVehicleData.h @@ -18,41 +18,40 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLGetVehicleData : SDLRPCRequest /** - * Convenience init for getting data for all possible vehicle data items. - * - * @param accelerationPedalPosition Get accelerationPedalPosition data - * @param airbagStatus Get airbagStatus data - * @param beltStatus Get beltStatus data - * @param bodyInformation Get bodyInformation data - * @param cloudAppVehicleID Get cloudAppVehicleID data - * @param clusterModeStatus Get clusterModeStatus data - * @param deviceStatus Get deviceStatus data - * @param driverBraking Get driverBraking data - * @param eCallInfo Get eCallInfo data - * @param electronicParkBrakeStatus Get electronicParkBrakeStatus data - * @param emergencyEvent Get emergencyEvent data - * @param engineOilLife Get engineOilLife data - * @param engineTorque Get engineTorque data - * @param externalTemperature Get externalTemperature data - * @param fuelLevel Get fuelLevel data - * @param fuelLevelState Get fuelLevelState data - * @param fuelRange Get fuelRange data - * @param gps Get gps data - * @param headLampStatus Get headLampStatus data - * @param instantFuelConsumption Get instantFuelConsumption data - * @param myKey Get myKey data - * @param odometer Get odometer data - * @param prndl Get prndl data - * @param rpm Get rpm data - * @param speed Get speed data - * @param steeringWheelAngle Get steeringWheelAngle data - * @param tirePressure Get tirePressure data - * @param turnSignal Get turnSignal data - * @param vin Get vin data - * @param wiperStatus Get wiperStatus data - * @return A SDLGetVehicleData object + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param vin - vin + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModeStatus - clusterModeStatus + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLGetVehicleData object */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus: instead"); +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal vin:(nullable NSNumber *)vin gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey windowStatus:(nullable NSNumber *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering; /** * Convenience init for getting data for all possible vehicle data items. @@ -90,7 +89,44 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLGetVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal vin:(nullable NSNumber *)vin gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSNumber *)windowStatus; +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal vin:(nullable NSNumber *)vin gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSNumber *)windowStatus __deprecated; + +/** + * Convenience init for getting data for all possible vehicle data items. + * + * @param accelerationPedalPosition Get accelerationPedalPosition data + * @param airbagStatus Get airbagStatus data + * @param beltStatus Get beltStatus data + * @param bodyInformation Get bodyInformation data + * @param cloudAppVehicleID Get cloudAppVehicleID data + * @param clusterModeStatus Get clusterModeStatus data + * @param deviceStatus Get deviceStatus data + * @param driverBraking Get driverBraking data + * @param eCallInfo Get eCallInfo data + * @param electronicParkBrakeStatus Get electronicParkBrakeStatus data + * @param emergencyEvent Get emergencyEvent data + * @param engineOilLife Get engineOilLife data + * @param engineTorque Get engineTorque data + * @param externalTemperature Get externalTemperature data + * @param fuelLevel Get fuelLevel data + * @param fuelLevelState Get fuelLevelState data + * @param fuelRange Get fuelRange data + * @param gps Get gps data + * @param headLampStatus Get headLampStatus data + * @param instantFuelConsumption Get instantFuelConsumption data + * @param myKey Get myKey data + * @param odometer Get odometer data + * @param prndl Get prndl data + * @param rpm Get rpm data + * @param speed Get speed data + * @param steeringWheelAngle Get steeringWheelAngle data + * @param tirePressure Get tirePressure data + * @param turnSignal Get turnSignal data + * @param vin Get vin data + * @param wiperStatus Get wiperStatus data + * @return A SDLGetVehicleData object + */ +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus: instead"); /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLGetVehicleData.m b/SmartDeviceLink/public/SDLGetVehicleData.m index abae28008f..7dd1e89564 100644 --- a/SmartDeviceLink/public/SDLGetVehicleData.m +++ b/SmartDeviceLink/public/SDLGetVehicleData.m @@ -23,6 +23,45 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal vin:(nullable NSNumber *)vin gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey windowStatus:(nullable NSNumber *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.vin = vin; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModeStatus = clusterModeStatus; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus { self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) vin:@(vin) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:nil windowStatus:nil]; if (self) { diff --git a/SmartDeviceLink/public/SDLGetVehicleDataResponse.h b/SmartDeviceLink/public/SDLGetVehicleDataResponse.h index 6f24221b49..76630ffd77 100644 --- a/SmartDeviceLink/public/SDLGetVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLGetVehicleDataResponse.h @@ -1,5 +1,34 @@ -// SDLGetVehicleDataResponse.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" @@ -37,6 +66,42 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLGetVehicleDataResponse : SDLRPCResponse +/** + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param vin - vin + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModeStatus - clusterModeStatus + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLGetVehicleDataResponse object + */ +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering; + /** * Convenience init for initializing data for all possible vehicle data items. * @@ -73,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLGetVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSArray *)windowStatus; +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSArray *)windowStatus __deprecated; /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLGetVehicleDataResponse.m b/SmartDeviceLink/public/SDLGetVehicleDataResponse.m index 47f5a66eb8..28057edc3f 100644 --- a/SmartDeviceLink/public/SDLGetVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLGetVehicleDataResponse.m @@ -38,6 +38,45 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.vin = vin; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModeStatus = clusterModeStatus; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSArray *)windowStatus { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLGetWayPoints.h b/SmartDeviceLink/public/SDLGetWayPoints.h index 331acc3a0f..3f632566b7 100644 --- a/SmartDeviceLink/public/SDLGetWayPoints.h +++ b/SmartDeviceLink/public/SDLGetWayPoints.h @@ -1,5 +1,34 @@ -// SDLGetWaypoints.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" @@ -12,11 +41,22 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 4.1 @interface SDLGetWayPoints : SDLRPCRequest +/** + * @param wayPointType - wayPointType + * @return A SDLGetWayPoints object + */ +- (instancetype)initWithWayPointType:(SDLWayPointType)wayPointType; + /// Convenience init to get waypoints. /// /// @param type To request for either the destination only or for all waypoints including destination /// @return An SDLGetWayPoints object -- (instancetype)initWithType:(SDLWayPointType)type; +- (instancetype)initWithType:(SDLWayPointType)type __deprecated_msg("Use initWithWayPointType: instead"); + +/** + * To request for either the destination only or for all waypoints including destination + */ +@property (strong, nonatomic) SDLWayPointType wayPointType; /** * To request for either the destination @@ -24,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN * * Required */ -@property (nullable, strong, nonatomic) SDLWayPointType waypointType; +@property (nullable, strong, nonatomic) SDLWayPointType waypointType __deprecated_msg("Use wayPointType instead"); @end diff --git a/SmartDeviceLink/public/SDLGetWayPoints.m b/SmartDeviceLink/public/SDLGetWayPoints.m index 6e7f7a4896..349aadc4c0 100644 --- a/SmartDeviceLink/public/SDLGetWayPoints.m +++ b/SmartDeviceLink/public/SDLGetWayPoints.m @@ -20,6 +20,14 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithWayPointType:(SDLWayPointType)wayPointType { + self = [self init]; + if (!self) { + return nil; + } + self.wayPointType = wayPointType; + return self; +} - (instancetype)initWithType:(SDLWayPointType)type { self = [self init]; @@ -32,6 +40,15 @@ - (instancetype)initWithType:(SDLWayPointType)type { return self; } +- (void)setWayPointType:(SDLWayPointType)wayPointType { + [self.parameters sdl_setObject:wayPointType forName:SDLRPCParameterNameWayPointType]; +} + +- (SDLWayPointType)wayPointType { + NSError *error = nil; + return [self.parameters sdl_enumForName:SDLRPCParameterNameWayPointType error:&error]; +} + - (void)setWaypointType:(nullable SDLWayPointType)waypointType { [self.parameters sdl_setObject:waypointType forName:SDLRPCParameterNameWayPointType]; } diff --git a/SmartDeviceLink/public/SDLGetWayPointsResponse.h b/SmartDeviceLink/public/SDLGetWayPointsResponse.h index 3a22fce5a9..99ba4033e1 100644 --- a/SmartDeviceLink/public/SDLGetWayPointsResponse.h +++ b/SmartDeviceLink/public/SDLGetWayPointsResponse.h @@ -1,5 +1,34 @@ -// SDLGetWaypointsResponse.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" @@ -12,12 +41,24 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLGetWayPointsResponse : SDLRPCResponse +/** + * @param wayPoints - wayPoints + * @return A SDLGetWayPointsResponse object + */ +- (instancetype)initWithWayPoints:(nullable NSArray *)wayPoints; + +/** + * See LocationDetails + * {"array_min_size": 1, "array_max_size": 10} + */ +@property (nullable, strong, nonatomic) NSArray *wayPoints; + /** Provides additional human readable info regarding the result. Optional, Array size 1 - 10 */ -@property (nullable, strong, nonatomic) NSArray *waypoints; +@property (nullable, strong, nonatomic) NSArray *waypoints __deprecated_msg("Use wayPoints instead"); @end diff --git a/SmartDeviceLink/public/SDLGetWayPointsResponse.m b/SmartDeviceLink/public/SDLGetWayPointsResponse.m index fec11281af..46369bfccd 100644 --- a/SmartDeviceLink/public/SDLGetWayPointsResponse.m +++ b/SmartDeviceLink/public/SDLGetWayPointsResponse.m @@ -21,6 +21,23 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithWayPoints:(nullable NSArray *)wayPoints { + self = [self init]; + if (!self) { + return nil; + } + self.wayPoints = wayPoints; + return self; +} + +- (void)setWayPoints:(nullable NSArray *)wayPoints { + [self.parameters sdl_setObject:wayPoints forName:SDLRPCParameterNameWayPoints]; +} + +- (nullable NSArray *)wayPoints { + return [self.parameters sdl_objectsForName:SDLRPCParameterNameWayPoints ofClass:SDLLocationDetails.class error:nil]; +} + - (void)setWaypoints:(nullable NSArray *)waypoints { [self.parameters sdl_setObject:waypoints forName:SDLRPCParameterNameWayPoints]; } diff --git a/SmartDeviceLink/public/SDLGlobalProperty.h b/SmartDeviceLink/public/SDLGlobalProperty.h index 60dfef02f2..1655b3fa34 100644 --- a/SmartDeviceLink/public/SDLGlobalProperty.h +++ b/SmartDeviceLink/public/SDLGlobalProperty.h @@ -1,5 +1,34 @@ -// SDLGlobalProperty.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLGrid.h b/SmartDeviceLink/public/SDLGrid.h index 64ad01e2f1..eb55d276a0 100644 --- a/SmartDeviceLink/public/SDLGrid.h +++ b/SmartDeviceLink/public/SDLGrid.h @@ -1,10 +1,34 @@ -// -// SDLGrid.h -// SmartDeviceLink -// -// Created by standa1 on 7/10/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 "SDLRPCMessage.h" @@ -15,6 +39,24 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLGrid : SDLRPCStruct +/** + * @param col - @(col) + * @param row - @(row) + * @return A SDLGrid object + */ +- (instancetype)initWithCol:(UInt8)col row:(UInt8)row; + +/** + * @param col - @(col) + * @param row - @(row) + * @param level - level + * @param colspan - colspan + * @param rowspan - rowspan + * @param levelspan - levelspan + * @return A SDLGrid object + */ +- (instancetype)initWithCol:(UInt8)col row:(UInt8)row level:(nullable NSNumber *)level colspan:(nullable NSNumber *)colspan rowspan:(nullable NSNumber *)rowspan levelspan:(nullable NSNumber *)levelspan; + /** * * Required, Integer, -1 - 100 diff --git a/SmartDeviceLink/public/SDLGrid.m b/SmartDeviceLink/public/SDLGrid.m index f0e5d333d0..e03c147a9b 100644 --- a/SmartDeviceLink/public/SDLGrid.m +++ b/SmartDeviceLink/public/SDLGrid.m @@ -13,6 +13,28 @@ @implementation SDLGrid +- (instancetype)initWithCol:(UInt8)col row:(UInt8)row { + self = [self init]; + if (!self) { + return nil; + } + self.col = @(col); + self.row = @(row); + return self; +} + +- (instancetype)initWithCol:(UInt8)col row:(UInt8)row level:(nullable NSNumber *)level colspan:(nullable NSNumber *)colspan rowspan:(nullable NSNumber *)rowspan levelspan:(nullable NSNumber *)levelspan { + self = [self initWithCol:col row:row]; + if (!self) { + return nil; + } + self.level = level; + self.colspan = colspan; + self.rowspan = rowspan; + self.levelspan = levelspan; + return self; +} + - (void)setCol:(NSNumber *)col { [self.store sdl_setObject:col forName:SDLRPCParameterNameCol]; } diff --git a/SmartDeviceLink/public/SDLHMILevel.h b/SmartDeviceLink/public/SDLHMILevel.h index 700afd4c47..f3db294b1a 100644 --- a/SmartDeviceLink/public/SDLHMILevel.h +++ b/SmartDeviceLink/public/SDLHMILevel.h @@ -1,5 +1,34 @@ -// SDLHMILevel.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLHMIPermissions.h b/SmartDeviceLink/public/SDLHMIPermissions.h index fa91517cd4..554efbc9b2 100644 --- a/SmartDeviceLink/public/SDLHMIPermissions.h +++ b/SmartDeviceLink/public/SDLHMIPermissions.h @@ -1,21 +1,57 @@ -// SDLHMIPermissions.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 "SDLHMILevel.h" + +NS_ASSUME_NONNULL_BEGIN + /** * Defining sets of HMI levels, which are permitted or prohibited for a given RPC. - * + * * @since SDL 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLHMIPermissions : SDLRPCStruct +/** + * @param allowed - allowed + * @param userDisallowed - userDisallowed + * @return A SDLHMIPermissions object + */ +- (instancetype)initWithAllowed:(NSArray *)allowed userDisallowed:(NSArray *)userDisallowed; + /** * A set of all HMI levels that are permitted for this given RPC * diff --git a/SmartDeviceLink/public/SDLHMIPermissions.m b/SmartDeviceLink/public/SDLHMIPermissions.m index 5cd8bb8a79..6830aa837d 100644 --- a/SmartDeviceLink/public/SDLHMIPermissions.m +++ b/SmartDeviceLink/public/SDLHMIPermissions.m @@ -11,6 +11,16 @@ @implementation SDLHMIPermissions +- (instancetype)initWithAllowed:(NSArray *)allowed userDisallowed:(NSArray *)userDisallowed { + self = [self init]; + if (!self) { + return nil; + } + self.allowed = allowed; + self.userDisallowed = userDisallowed; + return self; +} + - (void)setAllowed:(NSArray *)allowed { [self.store sdl_setObject:allowed forName:SDLRPCParameterNameAllowed]; } diff --git a/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.h b/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.h index d86e284f58..5d6cbd4fc1 100644 --- a/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.h +++ b/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.h @@ -1,5 +1,34 @@ -// SDLHMISettingsControlCapabilities.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" @@ -11,6 +40,22 @@ NS_ASSUME_NONNULL_BEGIN /// @since 5.0 @interface SDLHMISettingsControlCapabilities : SDLRPCStruct +/** + * @param moduleName - moduleName + * @return A SDLHMISettingsControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName; + +/** + * @param moduleName - moduleName + * @param moduleInfo - moduleInfo + * @param distanceUnitAvailable - distanceUnitAvailable + * @param temperatureUnitAvailable - temperatureUnitAvailable + * @param displayModeUnitAvailable - displayModeUnitAvailable + * @return A SDLHMISettingsControlCapabilities object + */ +- (instancetype)initWithModuleNameParam:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo distanceUnitAvailable:(nullable NSNumber *)distanceUnitAvailable temperatureUnitAvailable:(nullable NSNumber *)temperatureUnitAvailable displayModeUnitAvailable:(nullable NSNumber *)displayModeUnitAvailable __deprecated_msg("An initialier without 'param' will eventually be added"); + /** Constructs a newly allocated SDLHMISettingsControlCapabilities object with moduleName @@ -19,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo __deprecated_msg("Use initWithModuleName: instead"); /** Constructs a newly allocated SDLHMISettingsControlCapabilities object with given parameters @@ -32,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable __deprecated_msg("An initializer with different parameter types will eventually be added"); /** * @abstract The short friendly name of the hmi setting module. diff --git a/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.m b/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.m index c0117b7931..d1db2d2efa 100644 --- a/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.m +++ b/SmartDeviceLink/public/SDLHMISettingsControlCapabilities.m @@ -9,6 +9,27 @@ @implementation SDLHMISettingsControlCapabilities +- (instancetype)initWithModuleName:(NSString *)moduleName { + self = [self init]; + if (!self) { + return nil; + } + self.moduleName = moduleName; + return self; +} + +- (instancetype)initWithModuleNameParam:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo distanceUnitAvailable:(nullable NSNumber *)distanceUnitAvailable temperatureUnitAvailable:(nullable NSNumber *)temperatureUnitAvailable displayModeUnitAvailable:(nullable NSNumber *)displayModeUnitAvailable { + self = [self initWithModuleName:moduleName]; + if (!self) { + return nil; + } + self.moduleInfo = moduleInfo; + self.distanceUnitAvailable = distanceUnitAvailable; + self.temperatureUnitAvailable = temperatureUnitAvailable; + self.displayModeUnitAvailable = displayModeUnitAvailable; + return self; +} + - (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo { self = [self init]; if(!self) { diff --git a/SmartDeviceLink/public/SDLHMISettingsControlData.h b/SmartDeviceLink/public/SDLHMISettingsControlData.h index c16afb7d7a..dd1f8a27ae 100644 --- a/SmartDeviceLink/public/SDLHMISettingsControlData.h +++ b/SmartDeviceLink/public/SDLHMISettingsControlData.h @@ -1,5 +1,34 @@ -// SDLHMISettingsControlData.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 "SDLDisplayMode.h" @@ -14,6 +43,14 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLHMISettingsControlData : SDLRPCStruct +/** + * @param displayMode - displayMode + * @param temperatureUnit - temperatureUnit + * @param distanceUnit - distanceUnit + * @return A SDLHMISettingsControlData object + */ +- (instancetype)initWithDisplayMode:(nullable SDLDisplayMode)displayMode temperatureUnit:(nullable SDLTemperatureUnit)temperatureUnit distanceUnit:(nullable SDLDistanceUnit)distanceUnit; + /** Constructs a newly allocated SDLHMISettingsControlCapabilities object with given parameters @@ -22,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN @param distanceUnit distance unit used in HMI setting @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithDisplaymode:(SDLDisplayMode)displayMode temperatureUnit:(SDLTemperatureUnit)temperatureUnit distanceUnit:(SDLDistanceUnit)distanceUnit; +- (instancetype)initWithDisplaymode:(SDLDisplayMode)displayMode temperatureUnit:(SDLTemperatureUnit)temperatureUnit distanceUnit:(SDLDistanceUnit)distanceUnit __deprecated_msg("Use initWithDisplayMode:temperatureUnit:distanceUnit: instead"); /** * @abstract Display the Display Mode used HMI setting diff --git a/SmartDeviceLink/public/SDLHMISettingsControlData.m b/SmartDeviceLink/public/SDLHMISettingsControlData.m index df7982e858..834b821430 100644 --- a/SmartDeviceLink/public/SDLHMISettingsControlData.m +++ b/SmartDeviceLink/public/SDLHMISettingsControlData.m @@ -9,6 +9,17 @@ @implementation SDLHMISettingsControlData +- (instancetype)initWithDisplayMode:(nullable SDLDisplayMode)displayMode temperatureUnit:(nullable SDLTemperatureUnit)temperatureUnit distanceUnit:(nullable SDLDistanceUnit)distanceUnit { + self = [self init]; + if (!self) { + return nil; + } + self.displayMode = displayMode; + self.temperatureUnit = temperatureUnit; + self.distanceUnit = distanceUnit; + return self; +} + - (instancetype)initWithDisplaymode:(SDLDisplayMode)displayMode temperatureUnit:(SDLTemperatureUnit)temperatureUnit distanceUnit:(SDLDistanceUnit)distanceUnit { self = [self init]; if(!self) { diff --git a/SmartDeviceLink/public/SDLHMIZoneCapabilities.h b/SmartDeviceLink/public/SDLHMIZoneCapabilities.h index b5ba446569..0263770545 100644 --- a/SmartDeviceLink/public/SDLHMIZoneCapabilities.h +++ b/SmartDeviceLink/public/SDLHMIZoneCapabilities.h @@ -1,6 +1,34 @@ -// SDLHmiZoneCapabilities.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLHapticRect.h b/SmartDeviceLink/public/SDLHapticRect.h index ca7182ade1..a280bb0b56 100644 --- a/SmartDeviceLink/public/SDLHapticRect.h +++ b/SmartDeviceLink/public/SDLHapticRect.h @@ -1,10 +1,34 @@ -// -// SDLHapticRect.h -// SmartDeviceLink-iOS -// -// Created by Nicole on 8/3/17. -// Copyright © 2017 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 @@ -19,19 +43,32 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLHapticRect : SDLRPCStruct +/** + * @param idParam - @(idParam) + * @param rect - rect + * @return A SDLHapticRect object + */ +- (instancetype)initWithIdParam:(UInt32)idParam rect:(SDLRectangle *)rect; + /// Convenience init with all parameters /// /// @param id A user control spatial identifier /// @param rect The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs /// @return An SDLHapticRect object -- (instancetype)initWithId:(UInt32)id rect:(SDLRectangle *)rect; +- (instancetype)initWithId:(UInt32)id rect:(SDLRectangle *)rect __deprecated_msg("Use initWithIdParam:rect:"); + +/** + * A user control spatial identifier + * {"num_min_value": 0, "num_max_value": 2000000000} + */ +@property (strong, nonatomic) NSNumber *idParam; /** A user control spatial identifier Required, Integer, 0 - 2,000,000,000 */ -@property (strong, nonatomic) NSNumber *id; +@property (strong, nonatomic) NSNumber *id __deprecated_msg("Use idParam instead"); /** The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs. diff --git a/SmartDeviceLink/public/SDLHapticRect.m b/SmartDeviceLink/public/SDLHapticRect.m index 6641f528c5..e762e488f0 100644 --- a/SmartDeviceLink/public/SDLHapticRect.m +++ b/SmartDeviceLink/public/SDLHapticRect.m @@ -15,6 +15,16 @@ @implementation SDLHapticRect +- (instancetype)initWithIdParam:(UInt32)idParam rect:(SDLRectangle *)rect { + self = [self init]; + if (!self) { + return nil; + } + self.idParam = @(idParam); + self.rect = rect; + return self; +} + - (instancetype)initWithId:(UInt32)id rect:(nonnull SDLRectangle *)rect { self = [self init]; if (!self) { @@ -27,6 +37,15 @@ - (instancetype)initWithId:(UInt32)id rect:(nonnull SDLRectangle *)rect { return self; } +- (void)setIdParam:(NSNumber *)idParam { + [self.store sdl_setObject:idParam forName:SDLRPCParameterNameId]; +} + +- (NSNumber *)idParam { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameId ofClass:NSNumber.class error:&error]; +} + - (void)setId:(NSNumber *)id { [self.store sdl_setObject:id forName:SDLRPCParameterNameId]; } diff --git a/SmartDeviceLink/public/SDLHeadLampStatus.h b/SmartDeviceLink/public/SDLHeadLampStatus.h index 8fff2ed219..07506f0a39 100644 --- a/SmartDeviceLink/public/SDLHeadLampStatus.h +++ b/SmartDeviceLink/public/SDLHeadLampStatus.h @@ -1,5 +1,34 @@ -// SDLHeadLampStatus.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" @@ -13,6 +42,21 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLHeadLampStatus : SDLRPCStruct +/** + * @param lowBeamsOn - @(lowBeamsOn) + * @param highBeamsOn - @(highBeamsOn) + * @return A SDLHeadLampStatus object + */ +- (instancetype)initWithLowBeamsOn:(BOOL)lowBeamsOn highBeamsOn:(BOOL)highBeamsOn; + +/** + * @param lowBeamsOn - @(lowBeamsOn) + * @param highBeamsOn - @(highBeamsOn) + * @param ambientLightSensorStatus - ambientLightSensorStatus + * @return A SDLHeadLampStatus object + */ +- (instancetype)initWithLowBeamsOn:(BOOL)lowBeamsOn highBeamsOn:(BOOL)highBeamsOn ambientLightSensorStatus:(nullable SDLAmbientLightStatus)ambientLightSensorStatus; + /** Low beams are on or off. diff --git a/SmartDeviceLink/public/SDLHeadLampStatus.m b/SmartDeviceLink/public/SDLHeadLampStatus.m index e9f018f021..6c7fe4db6e 100644 --- a/SmartDeviceLink/public/SDLHeadLampStatus.m +++ b/SmartDeviceLink/public/SDLHeadLampStatus.m @@ -11,6 +11,25 @@ @implementation SDLHeadLampStatus +- (instancetype)initWithLowBeamsOn:(BOOL)lowBeamsOn highBeamsOn:(BOOL)highBeamsOn { + self = [self init]; + if (!self) { + return nil; + } + self.lowBeamsOn = @(lowBeamsOn); + self.highBeamsOn = @(highBeamsOn); + return self; +} + +- (instancetype)initWithLowBeamsOn:(BOOL)lowBeamsOn highBeamsOn:(BOOL)highBeamsOn ambientLightSensorStatus:(nullable SDLAmbientLightStatus)ambientLightSensorStatus { + self = [self initWithLowBeamsOn:lowBeamsOn highBeamsOn:highBeamsOn]; + if (!self) { + return nil; + } + self.ambientLightSensorStatus = ambientLightSensorStatus; + return self; +} + - (void)setLowBeamsOn:(NSNumber *)lowBeamsOn { [self.store sdl_setObject:lowBeamsOn forName:SDLRPCParameterNameLowBeamsOn]; } diff --git a/SmartDeviceLink/public/SDLHybridAppPreference.h b/SmartDeviceLink/public/SDLHybridAppPreference.h index 6b1a56dba6..50ab0c1ef7 100644 --- a/SmartDeviceLink/public/SDLHybridAppPreference.h +++ b/SmartDeviceLink/public/SDLHybridAppPreference.h @@ -1,10 +1,34 @@ -// -// SDLHybridAppPreference.h -// SmartDeviceLink -// -// Created by Nicole on 2/26/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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLIgnitionStableStatus.h b/SmartDeviceLink/public/SDLIgnitionStableStatus.h index 9216e7d223..c4e48a3c2b 100644 --- a/SmartDeviceLink/public/SDLIgnitionStableStatus.h +++ b/SmartDeviceLink/public/SDLIgnitionStableStatus.h @@ -1,5 +1,34 @@ -// SDLIgnitionStableStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLIgnitionStatus.h b/SmartDeviceLink/public/SDLIgnitionStatus.h index 94d7c47e28..d8cc35b719 100644 --- a/SmartDeviceLink/public/SDLIgnitionStatus.h +++ b/SmartDeviceLink/public/SDLIgnitionStatus.h @@ -1,5 +1,34 @@ -// SDLIgnitionStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLImage.h b/SmartDeviceLink/public/SDLImage.h index 6fba849dac..8fafdd1752 100644 --- a/SmartDeviceLink/public/SDLImage.h +++ b/SmartDeviceLink/public/SDLImage.h @@ -16,6 +16,29 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLImage : SDLRPCStruct +/** + * @param valueParam - valueParam + * @param imageType - imageType + * @return A SDLImage object + */ +- (instancetype)initWithValueParam:(NSString *)valueParam imageType:(SDLImageType)imageType; + +/** + * @param valueParam - valueParam + * @param imageType - imageType + * @param isTemplate - isTemplate + * @return A SDLImage object + */ +- (instancetype)initWithValueParam:(NSString *)valueParam imageType:(SDLImageType)imageType isTemplate:(nullable NSNumber *)isTemplate; + +/** + * Convenience init for displaying a static image. Static images are already on-board SDL Core and can be used by providing the image's value. + * + * @param staticIconName A SDLStaticIconName value + * @return A SDLImage object + */ +- (instancetype)initWithStaticIconName:(SDLStaticIconName)staticIconName; + /** * Convenience init for displaying a dynamic image. The image must be uploaded to SDL Core before being displayed. * @@ -24,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN * @param isTemplate Whether or not the image is a template that can be (re)colored by the SDL HMI. Static images are templates by default. * @return A SDLImage object */ -- (instancetype)initWithName:(NSString *)name ofType:(SDLImageType)imageType isTemplate:(BOOL)isTemplate; +- (instancetype)initWithName:(NSString *)name ofType:(SDLImageType)imageType isTemplate:(BOOL)isTemplate __deprecated_msg("Use initWithValueParam:imageType:isTemplate: instead"); /** * Convenience init for displaying a dynamic image. The image must be uploaded to SDL Core before being displayed. @@ -33,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN * @param isTemplate Whether or not the image is a template that can be (re)colored by the SDL HMI * @return A SDLImage object */ -- (instancetype)initWithName:(NSString *)name isTemplate:(BOOL)isTemplate; +- (instancetype)initWithName:(NSString *)name isTemplate:(BOOL)isTemplate __deprecated_msg("Use initWithValueParam:imageType:isTemplate: instead"); /** * Convenience init for displaying a static image. Static images are already on-board SDL Core and can be used by providing the image's value. @@ -41,22 +64,20 @@ NS_ASSUME_NONNULL_BEGIN * @param staticImageValue The image value assigned to the static image * @return A SDLImage object */ -- (instancetype)initWithStaticImageValue:(UInt16)staticImageValue; +- (instancetype)initWithStaticImageValue:(UInt16)staticImageValue __deprecated_msg("Use initWithStaticIconName: instead"); /** - * Convenience init for displaying a static image. Static images are already on-board SDL Core and can be used by providing the image's value. - * - * @param staticIconName A SDLStaticIconName value - * @return A SDLImage object + * Either the static hex icon value or the binary image file name identifier (sent by PutFile). + * {"string_min_length": 0, "string_max_length": 65535} */ -- (instancetype)initWithStaticIconName:(SDLStaticIconName)staticIconName; +@property (strong, nonatomic) NSString *valueParam; /** * The static hex icon value or the binary image file name identifier (sent by SDLPutFile) * * Required, max length = 65535 */ -@property (strong, nonatomic) NSString *value; +@property (strong, nonatomic) NSString *value __deprecated_msg("Use valueParam instead"); /** * Describes whether the image is static or dynamic diff --git a/SmartDeviceLink/public/SDLImage.m b/SmartDeviceLink/public/SDLImage.m index 19c46cffed..63053feebc 100644 --- a/SmartDeviceLink/public/SDLImage.m +++ b/SmartDeviceLink/public/SDLImage.m @@ -10,6 +10,25 @@ @implementation SDLImage +- (instancetype)initWithValueParam:(NSString *)valueParam imageType:(SDLImageType)imageType { + self = [self init]; + if (!self) { + return nil; + } + self.valueParam = valueParam; + self.imageType = imageType; + return self; +} + +- (instancetype)initWithValueParam:(NSString *)valueParam imageType:(SDLImageType)imageType isTemplate:(nullable NSNumber *)isTemplate { + self = [self initWithValueParam:valueParam imageType:imageType]; + if (!self) { + return nil; + } + self.isTemplate = isTemplate; + return self; +} + - (instancetype)initWithName:(NSString *)name ofType:(SDLImageType)imageType isTemplate:(BOOL)isTemplate { self = [self init]; if (!self) { @@ -34,11 +53,20 @@ - (instancetype)initWithStaticImageValue:(UInt16)staticImageValue { } - (instancetype)initWithStaticIconName:(SDLStaticIconName)staticIconName { - return [self initWithName:staticIconName ofType:SDLImageTypeStatic isTemplate:YES]; + return [self initWithValueParam:staticIconName imageType:SDLImageTypeStatic isTemplate:@YES]; } #pragma mark - Getters / Setters +- (void)setValueParam:(NSString *)valueParam { + [self.store sdl_setObject:valueParam forName:SDLRPCParameterNameValue]; +} + +- (NSString *)valueParam { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameValue ofClass:NSString.class error:&error]; +} + - (void)setValue:(NSString *)value { [self.store sdl_setObject:value forName:SDLRPCParameterNameValue]; } diff --git a/SmartDeviceLink/public/SDLImageField.h b/SmartDeviceLink/public/SDLImageField.h index 610b1a55cc..0754db01c3 100644 --- a/SmartDeviceLink/public/SDLImageField.h +++ b/SmartDeviceLink/public/SDLImageField.h @@ -1,5 +1,34 @@ -// SDLImageField.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,12 +44,38 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLImageField : SDLRPCStruct +/** + * @param nameParam - nameParam + * @param imageTypeSupported - imageTypeSupported + * @return A SDLImageField object + */ +- (instancetype)initWithNameParam:(SDLImageFieldName)nameParam imageTypeSupported:(NSArray *)imageTypeSupported; + +/** + * @param nameParam - nameParam + * @param imageTypeSupported - imageTypeSupported + * @param imageResolution - imageResolution + * @return A SDLImageField object + */ +- (instancetype)initWithNameParam:(SDLImageFieldName)nameParam imageTypeSupported:(NSArray *)imageTypeSupported imageResolution:(nullable SDLImageResolution *)imageResolution; + +/// Convenience initalizer for the ImageField RPC struct +/// @param name The name identifying this image field +/// @param imageTypeSupported The image data types this field supports +/// @param imageResolution The native resolution of this image field +- (instancetype)initWithName:(SDLImageFieldName)name imageTypeSupported:(NSArray *)imageTypeSupported imageResolution:(nullable SDLImageResolution *)imageResolution __deprecated_msg("Use initWithNameParam:imageTypeSupported:imageResolution: instead"); + +/** + * The name that identifies the field. See ImageFieldName. + */ +@property (strong, nonatomic) SDLImageFieldName nameParam; + /** The name that identifies the field. Required */ -@property (strong, nonatomic) SDLImageFieldName name; +@property (strong, nonatomic) SDLImageFieldName name __deprecated_msg("Use nameParam instead"); /** The image types that are supported in this field. @@ -36,12 +91,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) SDLImageResolution *imageResolution; -/// Convenience initalizer for the ImageField RPC struct -/// @param name The name identifying this image field -/// @param imageTypeSupported The image data types this field supports -/// @param imageResolution The native resolution of this image field -- (instancetype)initWithName:(SDLImageFieldName)name imageTypeSupported:(NSArray *)imageTypeSupported imageResolution:(nullable SDLImageResolution *)imageResolution; - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLImageField.m b/SmartDeviceLink/public/SDLImageField.m index 85532ff80c..908ce6a5ec 100644 --- a/SmartDeviceLink/public/SDLImageField.m +++ b/SmartDeviceLink/public/SDLImageField.m @@ -12,6 +12,34 @@ @implementation SDLImageField +- (instancetype)initWithNameParam:(SDLImageFieldName)nameParam imageTypeSupported:(NSArray *)imageTypeSupported { + self = [self init]; + if (!self) { + return nil; + } + self.nameParam = nameParam; + self.imageTypeSupported = imageTypeSupported; + return self; +} + +- (instancetype)initWithNameParam:(SDLImageFieldName)nameParam imageTypeSupported:(NSArray *)imageTypeSupported imageResolution:(nullable SDLImageResolution *)imageResolution { + self = [self initWithNameParam:nameParam imageTypeSupported:imageTypeSupported]; + if (!self) { + return nil; + } + self.imageResolution = imageResolution; + return self; +} + +- (void)setNameParam:(SDLImageFieldName)nameParam { + [self.store sdl_setObject:nameParam forName:SDLRPCParameterNameName]; +} + +- (SDLImageFieldName)nameParam { + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameName error:&error]; +} + - (void)setName:(SDLImageFieldName)name { [self.store sdl_setObject:name forName:SDLRPCParameterNameName]; } diff --git a/SmartDeviceLink/public/SDLImageResolution.h b/SmartDeviceLink/public/SDLImageResolution.h index bd9a82ae44..dc31bf4bf1 100644 --- a/SmartDeviceLink/public/SDLImageResolution.h +++ b/SmartDeviceLink/public/SDLImageResolution.h @@ -1,5 +1,34 @@ -// SDLImageResolution.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" @@ -11,6 +40,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLImageResolution : SDLRPCStruct +/** + * @param resolutionWidth - @(resolutionWidth) + * @param resolutionHeight - @(resolutionHeight) + * @return A SDLImageResolution object + */ +- (instancetype)initWithResolutionWidth:(UInt16)resolutionWidth resolutionHeight:(UInt16)resolutionHeight; + +/// Convenience init with all parameters +/// +/// @param width Resolution width +/// @param height Resolution height +/// @return An SDLImageResolution object +- (instancetype)initWithWidth:(uint16_t)width height:(uint16_t)height __deprecated_msg("Use initWithResolutionWidth:resolutionHeight:"); + /** Resolution width @@ -25,13 +68,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) NSNumber *resolutionHeight; -/// Convenience init with all parameters -/// -/// @param width Resolution width -/// @param height Resolution height -/// @return An SDLImageResolution object -- (instancetype)initWithWidth:(uint16_t)width height:(uint16_t)height; - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLImageResolution.m b/SmartDeviceLink/public/SDLImageResolution.m index b94e819967..18ee70dca6 100644 --- a/SmartDeviceLink/public/SDLImageResolution.m +++ b/SmartDeviceLink/public/SDLImageResolution.m @@ -11,6 +11,16 @@ @implementation SDLImageResolution +- (instancetype)initWithResolutionWidth:(UInt16)resolutionWidth resolutionHeight:(UInt16)resolutionHeight { + self = [self init]; + if (!self) { + return nil; + } + self.resolutionWidth = @(resolutionWidth); + self.resolutionHeight = @(resolutionHeight); + return self; +} + - (instancetype)initWithWidth:(uint16_t)width height:(uint16_t)height { self = [self init]; if (!self) { return nil; } diff --git a/SmartDeviceLink/public/SDLImageType.h b/SmartDeviceLink/public/SDLImageType.h index 06c27b78a9..33f998f8ae 100644 --- a/SmartDeviceLink/public/SDLImageType.h +++ b/SmartDeviceLink/public/SDLImageType.h @@ -1,5 +1,34 @@ -// SDLImageType.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLInteractionMode.h b/SmartDeviceLink/public/SDLInteractionMode.h index 326195f431..4ce93647fe 100644 --- a/SmartDeviceLink/public/SDLInteractionMode.h +++ b/SmartDeviceLink/public/SDLInteractionMode.h @@ -1,5 +1,34 @@ -// SDLInteractionMode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLKeyboardEvent.h b/SmartDeviceLink/public/SDLKeyboardEvent.h index 1ac7b67e48..8773104d1c 100644 --- a/SmartDeviceLink/public/SDLKeyboardEvent.h +++ b/SmartDeviceLink/public/SDLKeyboardEvent.h @@ -1,5 +1,34 @@ -// SDLKeyboardEvent.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLKeyboardLayout.h b/SmartDeviceLink/public/SDLKeyboardLayout.h index 4b4e97550d..5c025b2952 100644 --- a/SmartDeviceLink/public/SDLKeyboardLayout.h +++ b/SmartDeviceLink/public/SDLKeyboardLayout.h @@ -1,5 +1,34 @@ -// SDLKeyboardLayout.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLKeyboardProperties.h b/SmartDeviceLink/public/SDLKeyboardProperties.h index a538b52bdd..fce47030d7 100644 --- a/SmartDeviceLink/public/SDLKeyboardProperties.h +++ b/SmartDeviceLink/public/SDLKeyboardProperties.h @@ -1,5 +1,34 @@ -// SDLKeyboardProperties.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" @@ -14,6 +43,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLKeyboardProperties : SDLRPCStruct +/** + * @param language - language + * @param keyboardLayout - keyboardLayout + * @param keypressMode - keypressMode + * @param limitedCharacterList - limitedCharacterList + * @param autoCompleteList - autoCompleteList + * @return A SDLKeyboardProperties object + */ +- (instancetype)initWithLanguage:(nullable SDLLanguage)language keyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteList:(nullable NSArray *)autoCompleteList; + /** Create a Keyboard Properties RPC object @@ -25,19 +64,7 @@ NS_ASSUME_NONNULL_BEGIN @param autoCompleteList A list of strings to show the user to complete what they are typing. @return The RPC object */ -- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray *)autoCompleteList __deprecated_msg("Use initWithLanguage:keyboardLayout:keypressMode:limitedCharacterList:autoCompleteList: instead"); - -/** - * Convenience init with all properties. - * - * @param language - language - * @param keyboardLayout - keyboardLayout - * @param keypressMode - keypressMode - * @param limitedCharacterList - limitedCharacterList - * @param autoCompleteList - autoCompleteList - * @return A SDLKeyboardProperties object - */ -- (instancetype)initWithLanguage:(nullable SDLLanguage)language keyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteList:(nullable NSArray *)autoCompleteList; +- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray *)autoCompleteList __deprecated_msg("Use initWithLanguage:keyboardLayout:keypressMode:limitedCharacterList:autocompleteList:"); /** The keyboard language diff --git a/SmartDeviceLink/public/SDLKeyboardProperties.m b/SmartDeviceLink/public/SDLKeyboardProperties.m index c21c91bc7c..a6db33dc55 100644 --- a/SmartDeviceLink/public/SDLKeyboardProperties.m +++ b/SmartDeviceLink/public/SDLKeyboardProperties.m @@ -10,25 +10,23 @@ @implementation SDLKeyboardProperties -- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray *)autoCompleteList { - self = [[self init] initWithLanguage:language keyboardLayout:layout keypressMode:keypressMode limitedCharacterList:limitedCharacterList autoCompleteList:autoCompleteList]; - if (!self) { return nil; } - self.autoCompleteText = autoCompleteText; - - return self; -} - - (instancetype)initWithLanguage:(nullable SDLLanguage)language keyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteList:(nullable NSArray *)autoCompleteList { self = [self init]; if (!self) { return nil; } - self.language = language; self.keyboardLayout = keyboardLayout; self.keypressMode = keypressMode; self.limitedCharacterList = limitedCharacterList; self.autoCompleteList = autoCompleteList; + return self; +} + +- (instancetype)initWithLanguage:(nullable SDLLanguage)language layout:(nullable SDLKeyboardLayout)layout keypressMode:(nullable SDLKeypressMode)keypressMode limitedCharacterList:(nullable NSArray *)limitedCharacterList autoCompleteText:(nullable NSString *)autoCompleteText autoCompleteList:(nullable NSArray *)autoCompleteList { + self = [[self init] initWithLanguage:language keyboardLayout:layout keypressMode:keypressMode limitedCharacterList:limitedCharacterList autoCompleteList:autoCompleteList]; + if (!self) { return nil; } + self.autoCompleteText = autoCompleteText; return self; } diff --git a/SmartDeviceLink/public/SDLKeypressMode.h b/SmartDeviceLink/public/SDLKeypressMode.h index 7607c4d3ed..f0080c7ccc 100644 --- a/SmartDeviceLink/public/SDLKeypressMode.h +++ b/SmartDeviceLink/public/SDLKeypressMode.h @@ -1,6 +1,34 @@ -// SDLKeypressMode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLLanguage.h b/SmartDeviceLink/public/SDLLanguage.h index 98a962625b..4343be4dac 100644 --- a/SmartDeviceLink/public/SDLLanguage.h +++ b/SmartDeviceLink/public/SDLLanguage.h @@ -1,5 +1,34 @@ -// SDLLanguage.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLLayoutMode.h b/SmartDeviceLink/public/SDLLayoutMode.h index 583a325783..c6a61b837f 100644 --- a/SmartDeviceLink/public/SDLLayoutMode.h +++ b/SmartDeviceLink/public/SDLLayoutMode.h @@ -1,5 +1,34 @@ -// SDLLayoutMode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLLightCapabilities.h b/SmartDeviceLink/public/SDLLightCapabilities.h index 19f3024eb7..7a16980bc3 100644 --- a/SmartDeviceLink/public/SDLLightCapabilities.h +++ b/SmartDeviceLink/public/SDLLightCapabilities.h @@ -1,5 +1,34 @@ -// SDLLightCapabilities.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,13 +41,28 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 5.0 @interface SDLLightCapabilities : SDLRPCStruct +/** + * @param nameParam - nameParam + * @return A SDLLightCapabilities object + */ +- (instancetype)initWithNameParam:(SDLLightName)nameParam; + +/** + * @param nameParam - nameParam + * @param statusAvailable - statusAvailable + * @param densityAvailable - densityAvailable + * @param rgbColorSpaceAvailable - rgbColorSpaceAvailable + * @return A SDLLightCapabilities object + */ +- (instancetype)initWithNameParam:(SDLLightName)nameParam statusAvailable:(nullable NSNumber *)statusAvailable densityAvailable:(nullable NSNumber *)densityAvailable rgbColorSpaceAvailable:(nullable NSNumber *)rgbColorSpaceAvailable; + /** Constructs a newly allocated SDLLightCapabilities object with the name of the light or group of lights @param name The name of a light or a group of lights @return An instance of the SDLLightCapabilities class */ -- (instancetype)initWithName:(SDLLightName)name; +- (instancetype)initWithName:(SDLLightName)name __deprecated_msg("Use initWithNameParam: instead"); /** Constructs a newly allocated SDLLightCapabilities object with given parameters @@ -30,14 +74,21 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLLightCapabilities class */ -- (instancetype)initWithName:(SDLLightName)name densityAvailable:(BOOL)densityAvailable colorAvailable:(BOOL)colorAvailable statusAvailable:(BOOL)statusAvailable; +- (instancetype)initWithName:(SDLLightName)name densityAvailable:(BOOL)densityAvailable colorAvailable:(BOOL)colorAvailable statusAvailable:(BOOL)statusAvailable __deprecated_msg("Use initWithNameParam: instead"); + +/** + * @abstract The name of a light or a group of lights + * + * Required, SDLLightName + */ +@property (strong, nonatomic) SDLLightName nameParam; /** * @abstract The name of a light or a group of lights * * Required, SDLLightName */ -@property (strong, nonatomic) SDLLightName name; +@property (strong, nonatomic) SDLLightName name __deprecated_msg("Use nameParam instead"); /** * @abstract Indicates if the light's density can be set remotely (similar to a dimmer). @@ -46,12 +97,17 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *densityAvailable; +/** + * Indicates if the light's color can be set remotely by using the sRGB color space. + */ +@property (nullable, strong, nonatomic) NSNumber *rgbColorSpaceAvailable; + /** * @abstract Indicates if the light's color can be set remotely by using the RGB color space. * * Optional, Boolean */ -@property (nullable, strong, nonatomic) NSNumber *colorAvailable; +@property (nullable, strong, nonatomic) NSNumber *colorAvailable __deprecated_msg("Use rgbColorSpaceAvailable instead"); /** * @abstract Indicates if the status (ON/OFF) can be set remotely. diff --git a/SmartDeviceLink/public/SDLLightCapabilities.m b/SmartDeviceLink/public/SDLLightCapabilities.m index e2ea777939..0d7c35cf29 100644 --- a/SmartDeviceLink/public/SDLLightCapabilities.m +++ b/SmartDeviceLink/public/SDLLightCapabilities.m @@ -9,6 +9,26 @@ @implementation SDLLightCapabilities +- (instancetype)initWithNameParam:(SDLLightName)nameParam { + self = [self init]; + if (!self) { + return nil; + } + self.nameParam = nameParam; + return self; +} + +- (instancetype)initWithNameParam:(SDLLightName)nameParam statusAvailable:(nullable NSNumber *)statusAvailable densityAvailable:(nullable NSNumber *)densityAvailable rgbColorSpaceAvailable:(nullable NSNumber *)rgbColorSpaceAvailable { + self = [self initWithNameParam:nameParam]; + if (!self) { + return nil; + } + self.statusAvailable = statusAvailable; + self.densityAvailable = densityAvailable; + self.rgbColorSpaceAvailable = rgbColorSpaceAvailable; + return self; +} + - (instancetype)initWithName:(SDLLightName)name { self = [self init]; if(!self) { @@ -32,6 +52,15 @@ - (instancetype)initWithName:(SDLLightName)name densityAvailable:(BOOL)densityAv return self; } +- (void)setNameParam:(SDLLightName)nameParam { + [self.store sdl_setObject:nameParam forName:SDLRPCParameterNameName]; +} + +- (SDLLightName)nameParam { + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameName error:&error]; +} + - (void)setName:(SDLLightName)name { [self.store sdl_setObject:name forName:SDLRPCParameterNameName]; } @@ -49,6 +78,14 @@ - (void)setDensityAvailable:(nullable NSNumber *)densityAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameDensityAvailable ofClass:NSNumber.class error:nil]; } +- (void)setRgbColorSpaceAvailable:(nullable NSNumber *)rgbColorSpaceAvailable { + [self.store sdl_setObject:rgbColorSpaceAvailable forName:SDLRPCParameterNameRGBColorSpaceAvailable]; +} + +- (nullable NSNumber *)rgbColorSpaceAvailable { + return [self.store sdl_objectForName:SDLRPCParameterNameRGBColorSpaceAvailable ofClass:NSNumber.class error:nil]; +} + - (void)setColorAvailable:(nullable NSNumber *)colorAvailable { [self.store sdl_setObject:colorAvailable forName:SDLRPCParameterNameRGBColorSpaceAvailable]; } diff --git a/SmartDeviceLink/public/SDLLightControlCapabilities.h b/SmartDeviceLink/public/SDLLightControlCapabilities.h index b062f3afa1..dd39245618 100644 --- a/SmartDeviceLink/public/SDLLightControlCapabilities.h +++ b/SmartDeviceLink/public/SDLLightControlCapabilities.h @@ -1,5 +1,34 @@ -// SDLLightControlCapabilities.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,6 +42,21 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 5.0 @interface SDLLightControlCapabilities : SDLRPCStruct +/** + * @param moduleName - moduleName + * @param supportedLights - supportedLights + * @return A SDLLightControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArray *)supportedLights; + +/** + * @param moduleName - moduleName + * @param supportedLights - supportedLights + * @param moduleInfo - moduleInfo + * @return A SDLLightControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArray *)supportedLights moduleInfo:(nullable SDLModuleInfo *)moduleInfo; + /** Constructs a newly allocated SDLLightControlCapabilities object with given parameters @@ -22,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN @param supportedLights array of available LightCapabilities @return An instance of the SDLLightControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights __deprecated_msg("Use initWithModuleName:supportedLights:moduleInfo: instead"); /** * @abstract The short friendly name of the light control module. diff --git a/SmartDeviceLink/public/SDLLightControlCapabilities.m b/SmartDeviceLink/public/SDLLightControlCapabilities.m index 759283647b..7cba3982d6 100644 --- a/SmartDeviceLink/public/SDLLightControlCapabilities.m +++ b/SmartDeviceLink/public/SDLLightControlCapabilities.m @@ -10,6 +10,25 @@ @implementation SDLLightControlCapabilities +- (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArray *)supportedLights { + self = [self init]; + if (!self) { + return nil; + } + self.moduleName = moduleName; + self.supportedLights = supportedLights; + return self; +} + +- (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArray *)supportedLights moduleInfo:(nullable SDLModuleInfo *)moduleInfo { + self = [self initWithModuleName:moduleName supportedLights:supportedLights]; + if (!self) { + return nil; + } + self.moduleInfo = moduleInfo; + return self; +} + - (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights { self = [self init]; if(!self) { diff --git a/SmartDeviceLink/public/SDLLightControlData.h b/SmartDeviceLink/public/SDLLightControlData.h index a76d4c7276..28148f8296 100644 --- a/SmartDeviceLink/public/SDLLightControlData.h +++ b/SmartDeviceLink/public/SDLLightControlData.h @@ -1,5 +1,34 @@ -// SDLLightControlData.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,13 +41,19 @@ NS_ASSUME_NONNULL_BEGIN /// @since SDL 5.0 @interface SDLLightControlData : SDLRPCStruct +/** + * @param lightState - lightState + * @return A SDLLightControlData object + */ +- (instancetype)initWithLightState:(NSArray *)lightState; + /** Constructs a newly allocated SDLLightControlData object with lightState @param lightState An array of LightNames and their current or desired status @return An instance of the SDLLightControlData class */ -- (instancetype)initWithLightStates:(NSArray *)lightState; +- (instancetype)initWithLightStates:(NSArray *)lightState __deprecated_msg("Use initWithLightState: instead"); /** * @abstract An array of LightNames and their current or desired status. diff --git a/SmartDeviceLink/public/SDLLightControlData.m b/SmartDeviceLink/public/SDLLightControlData.m index f9699d805d..a610317851 100644 --- a/SmartDeviceLink/public/SDLLightControlData.m +++ b/SmartDeviceLink/public/SDLLightControlData.m @@ -10,7 +10,16 @@ @implementation SDLLightControlData --(instancetype)initWithLightStates:(NSArray *)lightState { +- (instancetype)initWithLightState:(NSArray *)lightState { + self = [self init]; + if (!self) { + return nil; + } + self.lightState = lightState; + return self; +} + +- (instancetype)initWithLightStates:(NSArray *)lightState { self = [self init]; if(!self) { return nil; diff --git a/SmartDeviceLink/public/SDLLightName.h b/SmartDeviceLink/public/SDLLightName.h index 15cda053b9..0d348affff 100644 --- a/SmartDeviceLink/public/SDLLightName.h +++ b/SmartDeviceLink/public/SDLLightName.h @@ -1,5 +1,34 @@ -// SDLLightName.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLLightState.h b/SmartDeviceLink/public/SDLLightState.h index 296fbceee1..6a3a12ac89 100644 --- a/SmartDeviceLink/public/SDLLightState.h +++ b/SmartDeviceLink/public/SDLLightState.h @@ -1,5 +1,35 @@ -// SDLLightState.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 #import "SDLRPCMessage.h" @@ -15,6 +45,22 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 5.0 @interface SDLLightState : SDLRPCStruct +/** + * @param idParam - idParam + * @param status - status + * @return A SDLLightState object + */ +- (instancetype)initWithIdParam:(SDLLightName)idParam status:(SDLLightStatus)status; + +/** + * @param idParam - idParam + * @param status - status + * @param density - density + * @param color - color + * @return A SDLLightState object + */ +- (instancetype)initWithIdParam:(SDLLightName)idParam status:(SDLLightStatus)status density:(nullable NSNumber *)density color:(nullable SDLRGBColor *)color; + /** Constructs a newly allocated SDLLightState object with given parameters @@ -22,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN @param status Reflects the status of Light. @return An instance of the SDLLightState class */ -- (instancetype)initWithId:(SDLLightName)id status:(SDLLightStatus)status; +- (instancetype)initWithId:(SDLLightName)id status:(SDLLightStatus)status __deprecated_msg("Use initWithIdParam:status: instead"); /** Constructs a newly allocated SDLLightState object with given parameters @@ -33,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN @param color Reflects the color of Light. @return An instance of the SDLLightState class */ -- (instancetype)initWithId:(SDLLightName)id status:(SDLLightStatus)status density:(double)density color:(SDLRGBColor *)color; +- (instancetype)initWithId:(SDLLightName)id status:(SDLLightStatus)status density:(double)density color:(SDLRGBColor *)color __deprecated_msg("Use initWithIdParam:status: instead"); /** Constructs a newly allocated SDLLightState object with given parameters @@ -44,14 +90,19 @@ NS_ASSUME_NONNULL_BEGIN @param lightColor Reflects the color of Light. @return An instance of the SDLLightState class */ -- (instancetype)initWithId:(SDLLightName)id lightStatus:(SDLLightStatus)lightStatus lightDensity:(double)lightDensity lightColor:(UIColor *)lightColor; +- (instancetype)initWithId:(SDLLightName)id lightStatus:(SDLLightStatus)lightStatus lightDensity:(double)lightDensity lightColor:(UIColor *)lightColor __deprecated_msg("Use initWithIdParam:status: instead"); + +/** + * The name of a light or a group of lights. + */ +@property (strong, nonatomic) SDLLightName idParam; /** * @abstract The name of a light or a group of lights * * Required, SDLLightName */ -@property (strong, nonatomic) SDLLightName id; +@property (strong, nonatomic) SDLLightName id __deprecated_msg("Use idParam instead"); /** * @abstract Reflects the status of Light. diff --git a/SmartDeviceLink/public/SDLLightState.m b/SmartDeviceLink/public/SDLLightState.m index cfd13c2f9d..1a08efcb84 100644 --- a/SmartDeviceLink/public/SDLLightState.m +++ b/SmartDeviceLink/public/SDLLightState.m @@ -10,6 +10,26 @@ @implementation SDLLightState +- (instancetype)initWithIdParam:(SDLLightName)idParam status:(SDLLightStatus)status { + self = [self init]; + if (!self) { + return nil; + } + self.idParam = idParam; + self.status = status; + return self; +} + +- (instancetype)initWithIdParam:(SDLLightName)idParam status:(SDLLightStatus)status density:(nullable NSNumber *)density color:(nullable SDLRGBColor *)color { + self = [self initWithIdParam:idParam status:status]; + if (!self) { + return nil; + } + self.density = density; + self.color = color; + return self; +} + - (instancetype)initWithId:(SDLLightName)id status:(SDLLightStatus)status{ self = [self init]; if(!self) { @@ -47,6 +67,15 @@ - (instancetype)initWithId:(SDLLightName)id lightStatus:(SDLLightStatus)lightSta return self; } +- (void)setIdParam:(SDLLightName)idParam { + [self.store sdl_setObject:idParam forName:SDLRPCParameterNameId]; +} + +- (SDLLightName)idParam { + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameId error:&error]; +} + - (void)setId:(SDLLightName)id { [self.store sdl_setObject:id forName:SDLRPCParameterNameId]; } diff --git a/SmartDeviceLink/public/SDLLightStatus.h b/SmartDeviceLink/public/SDLLightStatus.h index 108cd420df..570391f0f0 100644 --- a/SmartDeviceLink/public/SDLLightStatus.h +++ b/SmartDeviceLink/public/SDLLightStatus.h @@ -1,5 +1,34 @@ -// SDLLightStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLListFiles.h b/SmartDeviceLink/public/SDLListFiles.h index 28bf706b8f..895a8fe268 100644 --- a/SmartDeviceLink/public/SDLListFiles.h +++ b/SmartDeviceLink/public/SDLListFiles.h @@ -1,19 +1,45 @@ -// SDLListFiles.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" +NS_ASSUME_NONNULL_BEGIN + /** - * Requests the current list of resident filenames for the registered app. Not - * supported on First generation SDL vehicles - *

+ * Requests the current list of resident filenames for the registered app. Not supported on first generation SDL enabled vehicles. * - * Since SmartDeviceLink 2.0 + * @added in SmartDeviceLink 3.0.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLListFiles : SDLRPCRequest @end diff --git a/SmartDeviceLink/public/SDLListFilesResponse.h b/SmartDeviceLink/public/SDLListFilesResponse.h index b5ddef16e7..ce29219e7d 100644 --- a/SmartDeviceLink/public/SDLListFilesResponse.h +++ b/SmartDeviceLink/public/SDLListFilesResponse.h @@ -1,19 +1,54 @@ -// SDLListFilesResponse.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" -/** - Response to SDLListFiles - - Since SmartDeviceLink 2.0 - */ - NS_ASSUME_NONNULL_BEGIN +/** + * Returns the current list of resident filenames for the registered app along with the current space available Not supported on First generation SDL enabled vehicles. + * + * @added in SmartDeviceLink 3.0.0 + */ @interface SDLListFilesResponse : SDLRPCResponse +/** + * @param filenames - filenames + * @param spaceAvailable - spaceAvailable + * @return A SDLListFilesResponse object + */ +- (instancetype)initWithFilenames:(nullable NSArray *)filenames spaceAvailable:(nullable NSNumber *)spaceAvailable; + /** An array of all filenames resident on the module for the given registered app. If omitted, then no files currently reside on the system. */ diff --git a/SmartDeviceLink/public/SDLListFilesResponse.m b/SmartDeviceLink/public/SDLListFilesResponse.m index a70c842b15..9d1b274108 100644 --- a/SmartDeviceLink/public/SDLListFilesResponse.m +++ b/SmartDeviceLink/public/SDLListFilesResponse.m @@ -21,6 +21,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithFilenames:(nullable NSArray *)filenames spaceAvailable:(nullable NSNumber *)spaceAvailable { + self = [self init]; + if (!self) { + return nil; + } + self.filenames = filenames; + self.spaceAvailable = spaceAvailable; + return self; +} + - (void)setFilenames:(nullable NSArray *)filenames { [self.parameters sdl_setObject:filenames forName:SDLRPCParameterNameFilenames]; } diff --git a/SmartDeviceLink/public/SDLLocationDetails.h b/SmartDeviceLink/public/SDLLocationDetails.h index 4b41d3f4dd..b756080a27 100644 --- a/SmartDeviceLink/public/SDLLocationDetails.h +++ b/SmartDeviceLink/public/SDLLocationDetails.h @@ -1,5 +1,34 @@ -// SDLLocationDetails.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" @@ -14,14 +43,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLLocationDetails : SDLRPCStruct -/** - * Convenience init for location coordinate. - * - * @param coordinate Latitude/Longitude of the location - * @return A SDLLocationDetails object - */ -- (instancetype)initWithCoordinate:(SDLLocationCoordinate *)coordinate NS_DESIGNATED_INITIALIZER; - /** * Convenience init for all parameters. * @@ -34,7 +55,15 @@ NS_ASSUME_NONNULL_BEGIN * @param searchAddress Address to be used by navigation engines for search * @return A SDLLocationDetails object */ -- (instancetype)initWithCoordinate:(SDLLocationCoordinate *)coordinate locationName:(nullable NSString *)locationName addressLines:(nullable NSArray *)addressLines locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString*)phoneNumber locationImage:(nullable SDLImage *)locationImage searchAddress:(nullable SDLOasisAddress *)searchAddress; +- (instancetype)initWithCoordinate:(nullable SDLLocationCoordinate *)coordinate locationName:(nullable NSString *)locationName addressLines:(nullable NSArray *)addressLines locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString*)phoneNumber locationImage:(nullable SDLImage *)locationImage searchAddress:(nullable SDLOasisAddress *)searchAddress; + +/** + * Convenience init for location coordinate. + * + * @param coordinate Latitude/Longitude of the location + * @return A SDLLocationDetails object + */ +- (instancetype)initWithCoordinate:(SDLLocationCoordinate *)coordinate __deprecated_msg("Use initWithCoordinate:locationName:addressLines:locationDescription:phoneNumber:locationImage:searchAddress: instead"); /** * Latitude/Longitude of the location diff --git a/SmartDeviceLink/public/SDLLocationDetails.m b/SmartDeviceLink/public/SDLLocationDetails.m index 6d34852e88..238e847a49 100644 --- a/SmartDeviceLink/public/SDLLocationDetails.m +++ b/SmartDeviceLink/public/SDLLocationDetails.m @@ -24,19 +24,18 @@ - (instancetype)initWithCoordinate:(SDLLocationCoordinate *)coordinate { return self; } -- (instancetype)initWithCoordinate:(SDLLocationCoordinate *)coordinate locationName:(nullable NSString *)locationName addressLines:(nullable NSArray *)addressLines locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString*)phoneNumber locationImage:(nullable SDLImage *)locationImage searchAddress:(nullable SDLOasisAddress *)searchAddress { - self = [self initWithCoordinate:coordinate]; +- (instancetype)initWithCoordinate:(nullable SDLLocationCoordinate *)coordinate locationName:(nullable NSString *)locationName addressLines:(nullable NSArray *)addressLines locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString *)phoneNumber locationImage:(nullable SDLImage *)locationImage searchAddress:(nullable SDLOasisAddress *)searchAddress { + self = [self init]; if (!self) { return nil; } - + self.coordinate = coordinate; self.locationName = locationName; self.addressLines = addressLines; self.locationDescription = locationDescription; self.phoneNumber = phoneNumber; self.locationImage = locationImage; self.searchAddress = searchAddress; - return self; } diff --git a/SmartDeviceLink/public/SDLMaintenanceModeStatus.h b/SmartDeviceLink/public/SDLMaintenanceModeStatus.h index ffc7b39ea9..a6f081e6c3 100644 --- a/SmartDeviceLink/public/SDLMaintenanceModeStatus.h +++ b/SmartDeviceLink/public/SDLMaintenanceModeStatus.h @@ -1,5 +1,34 @@ -// SDLMaintenanceModeStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMassageCushion.h b/SmartDeviceLink/public/SDLMassageCushion.h index a6242ae9af..e19112bd9f 100644 --- a/SmartDeviceLink/public/SDLMassageCushion.h +++ b/SmartDeviceLink/public/SDLMassageCushion.h @@ -1,5 +1,34 @@ -// SDLMassageCushion.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMassageCushionFirmness.h b/SmartDeviceLink/public/SDLMassageCushionFirmness.h index d8bb5d48ca..dab1697c77 100644 --- a/SmartDeviceLink/public/SDLMassageCushionFirmness.h +++ b/SmartDeviceLink/public/SDLMassageCushionFirmness.h @@ -1,5 +1,34 @@ -// SDLMassageCushionFirmness.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" #import "SDLMassageCushion.h" @@ -10,6 +39,12 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLMassageCushionFirmness : SDLRPCStruct +/** + * @param cushion - cushion + * @param firmness - @(firmness) + * @return A SDLMassageCushionFirmness object + */ +- (instancetype)initWithCushion:(SDLMassageCushion)cushion firmness:(UInt8)firmness; /** Constructs a newly allocated SDLMassageCushionFirmness object with cushion and firmness @@ -18,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN @param firmness The firmness value for the multi-contour massage seat, MinValue: 0 MaxValue: 100 @return An instance of the SDLMassageCushionFirmness class */ -- (instancetype)initWithMassageCushion:(SDLMassageCushion)cushion firmness:(UInt8)firmness; +- (instancetype)initWithMassageCushion:(SDLMassageCushion)cushion firmness:(UInt8)firmness __deprecated_msg("Use initWithCushion:firmness: instead"); /** * @abstract cushion of a multi-contour massage seat. diff --git a/SmartDeviceLink/public/SDLMassageCushionFirmness.m b/SmartDeviceLink/public/SDLMassageCushionFirmness.m index 96dacd0fc9..531a3c69ba 100644 --- a/SmartDeviceLink/public/SDLMassageCushionFirmness.m +++ b/SmartDeviceLink/public/SDLMassageCushionFirmness.m @@ -9,6 +9,16 @@ @implementation SDLMassageCushionFirmness +- (instancetype)initWithCushion:(SDLMassageCushion)cushion firmness:(UInt8)firmness { + self = [self init]; + if (!self) { + return nil; + } + self.cushion = cushion; + self.firmness = @(firmness); + return self; +} + - (instancetype)initWithMassageCushion:(SDLMassageCushion)cushion firmness:(UInt8)firmness { self = [super init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLMassageMode.h b/SmartDeviceLink/public/SDLMassageMode.h index d2f85c805b..466e6f4b58 100644 --- a/SmartDeviceLink/public/SDLMassageMode.h +++ b/SmartDeviceLink/public/SDLMassageMode.h @@ -1,5 +1,34 @@ -// SDLMassageMode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMassageModeData.h b/SmartDeviceLink/public/SDLMassageModeData.h index 25d3d0dfa1..0cbd6c0dc5 100644 --- a/SmartDeviceLink/public/SDLMassageModeData.h +++ b/SmartDeviceLink/public/SDLMassageModeData.h @@ -1,22 +1,59 @@ -// SDLMassageModeData.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" #import "SDLMassageZone.h" #import "SDLMassageMode.h" +NS_ASSUME_NONNULL_BEGIN + /** * Specify the mode of a massage zone. + * + * @added in SmartDeviceLink 5.0.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLMassageModeData : SDLRPCStruct +/** + * @param massageZone - massageZone + * @param massageMode - massageMode + * @return A SDLMassageModeData object + */ +- (instancetype)initWithMassageZone:(SDLMassageZone)massageZone massageMode:(SDLMassageMode)massageMode; + /** * @abstract Constructs a newly allocated SDLMassageModeData object with massageMode and massageZone */ -- (instancetype)initWithMassageMode:(SDLMassageMode)massageMode massageZone:(SDLMassageZone)massageZone; +- (instancetype)initWithMassageMode:(SDLMassageMode)massageMode massageZone:(SDLMassageZone)massageZone __deprecated_msg("Use initWithMassageZone:massageMode: instead"); /** * @abstract mode of a massage zone diff --git a/SmartDeviceLink/public/SDLMassageModeData.m b/SmartDeviceLink/public/SDLMassageModeData.m index fbcd4dde7b..96fa73e128 100644 --- a/SmartDeviceLink/public/SDLMassageModeData.m +++ b/SmartDeviceLink/public/SDLMassageModeData.m @@ -9,6 +9,16 @@ @implementation SDLMassageModeData +- (instancetype)initWithMassageZone:(SDLMassageZone)massageZone massageMode:(SDLMassageMode)massageMode { + self = [self init]; + if (!self) { + return nil; + } + self.massageZone = massageZone; + self.massageMode = massageMode; + return self; +} + - (instancetype)initWithMassageMode:(SDLMassageMode)massageMode massageZone:(SDLMassageZone)massageZone { self = [super init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLMassageZone.h b/SmartDeviceLink/public/SDLMassageZone.h index 434dd39415..419730b7f2 100644 --- a/SmartDeviceLink/public/SDLMassageZone.h +++ b/SmartDeviceLink/public/SDLMassageZone.h @@ -1,5 +1,34 @@ -// SDLMassageZone.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMediaClockFormat.h b/SmartDeviceLink/public/SDLMediaClockFormat.h index ea45f78f21..1a0c91ca77 100644 --- a/SmartDeviceLink/public/SDLMediaClockFormat.h +++ b/SmartDeviceLink/public/SDLMediaClockFormat.h @@ -1,5 +1,34 @@ -// SDLMediaClockFormat.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMediaServiceData.h b/SmartDeviceLink/public/SDLMediaServiceData.h index 84ce78d1b6..212cdd138d 100644 --- a/SmartDeviceLink/public/SDLMediaServiceData.h +++ b/SmartDeviceLink/public/SDLMediaServiceData.h @@ -1,10 +1,34 @@ -// -// SDLMediaServiceData.h -// SmartDeviceLink -// -// Created by Nicole on 2/8/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" #import "SDLMediaType.h" @@ -19,6 +43,24 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLMediaServiceData : SDLRPCStruct +/** + * @param mediaType - mediaType + * @param mediaTitle - mediaTitle + * @param mediaArtist - mediaArtist + * @param mediaAlbum - mediaAlbum + * @param playlistName - playlistName + * @param isExplicit - isExplicit + * @param trackPlaybackProgress - trackPlaybackProgress + * @param trackPlaybackDuration - trackPlaybackDuration + * @param queuePlaybackProgress - queuePlaybackProgress + * @param queuePlaybackDuration - queuePlaybackDuration + * @param queueCurrentTrackNumber - queueCurrentTrackNumber + * @param queueTotalTrackCount - queueTotalTrackCount + * @param mediaImage - mediaImage + * @return A SDLMediaServiceData object + */ +- (instancetype)initWithMediaType:(nullable SDLMediaType)mediaType mediaTitle:(nullable NSString *)mediaTitle mediaArtist:(nullable NSString *)mediaArtist mediaAlbum:(nullable NSString *)mediaAlbum playlistName:(nullable NSString *)playlistName isExplicit:(nullable NSNumber *)isExplicit trackPlaybackProgress:(nullable NSNumber *)trackPlaybackProgress trackPlaybackDuration:(nullable NSNumber *)trackPlaybackDuration queuePlaybackProgress:(nullable NSNumber *)queuePlaybackProgress queuePlaybackDuration:(nullable NSNumber *)queuePlaybackDuration queueCurrentTrackNumber:(nullable NSNumber *)queueCurrentTrackNumber queueTotalTrackCount:(nullable NSNumber *)queueTotalTrackCount mediaImage:(nullable SDLImage *)mediaImage; + /** * Convenience init * @@ -37,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN * @param queueTotalTrackCount The total number of tracks in the playback queue * @return A SDLMediaServiceData object */ -- (instancetype)initWithMediaType:(nullable SDLMediaType)mediaType mediaImage:(nullable SDLImage *)mediaImage mediaTitle:(nullable NSString *)mediaTitle mediaArtist:(nullable NSString *)mediaArtist mediaAlbum:(nullable NSString *)mediaAlbum playlistName:(nullable NSString *)playlistName isExplicit:(BOOL)isExplicit trackPlaybackProgress:(UInt32)trackPlaybackProgress trackPlaybackDuration:(UInt32)trackPlaybackDuration queuePlaybackProgress:(UInt32)queuePlaybackProgress queuePlaybackDuration:(UInt32)queuePlaybackDuration queueCurrentTrackNumber:(UInt32)queueCurrentTrackNumber queueTotalTrackCount:(UInt32)queueTotalTrackCount; +- (instancetype)initWithMediaType:(nullable SDLMediaType)mediaType mediaImage:(nullable SDLImage *)mediaImage mediaTitle:(nullable NSString *)mediaTitle mediaArtist:(nullable NSString *)mediaArtist mediaAlbum:(nullable NSString *)mediaAlbum playlistName:(nullable NSString *)playlistName isExplicit:(BOOL)isExplicit trackPlaybackProgress:(UInt32)trackPlaybackProgress trackPlaybackDuration:(UInt32)trackPlaybackDuration queuePlaybackProgress:(UInt32)queuePlaybackProgress queuePlaybackDuration:(UInt32)queuePlaybackDuration queueCurrentTrackNumber:(UInt32)queueCurrentTrackNumber queueTotalTrackCount:(UInt32)queueTotalTrackCount __deprecated_msg("Use another initializer instead"); /** * Sets the media image associated with the currently playing media diff --git a/SmartDeviceLink/public/SDLMediaServiceData.m b/SmartDeviceLink/public/SDLMediaServiceData.m index 7b8e44f3d5..ed8718e575 100644 --- a/SmartDeviceLink/public/SDLMediaServiceData.m +++ b/SmartDeviceLink/public/SDLMediaServiceData.m @@ -16,6 +16,27 @@ @implementation SDLMediaServiceData +- (instancetype)initWithMediaType:(nullable SDLMediaType)mediaType mediaTitle:(nullable NSString *)mediaTitle mediaArtist:(nullable NSString *)mediaArtist mediaAlbum:(nullable NSString *)mediaAlbum playlistName:(nullable NSString *)playlistName isExplicit:(nullable NSNumber *)isExplicit trackPlaybackProgress:(nullable NSNumber *)trackPlaybackProgress trackPlaybackDuration:(nullable NSNumber *)trackPlaybackDuration queuePlaybackProgress:(nullable NSNumber *)queuePlaybackProgress queuePlaybackDuration:(nullable NSNumber *)queuePlaybackDuration queueCurrentTrackNumber:(nullable NSNumber *)queueCurrentTrackNumber queueTotalTrackCount:(nullable NSNumber *)queueTotalTrackCount mediaImage:(nullable SDLImage *)mediaImage { + self = [self init]; + if (!self) { + return nil; + } + self.mediaType = mediaType; + self.mediaTitle = mediaTitle; + self.mediaArtist = mediaArtist; + self.mediaAlbum = mediaAlbum; + self.playlistName = playlistName; + self.isExplicit = isExplicit; + self.trackPlaybackProgress = trackPlaybackProgress; + self.trackPlaybackDuration = trackPlaybackDuration; + self.queuePlaybackProgress = queuePlaybackProgress; + self.queuePlaybackDuration = queuePlaybackDuration; + self.queueCurrentTrackNumber = queueCurrentTrackNumber; + self.queueTotalTrackCount = queueTotalTrackCount; + self.mediaImage = mediaImage; + return self; +} + - (instancetype)initWithMediaType:(nullable SDLMediaType)mediaType mediaImage:(nullable SDLImage *)mediaImage mediaTitle:(nullable NSString *)mediaTitle mediaArtist:(nullable NSString *)mediaArtist mediaAlbum:(nullable NSString *)mediaAlbum playlistName:(nullable NSString *)playlistName isExplicit:(BOOL)isExplicit trackPlaybackProgress:(UInt32)trackPlaybackProgress trackPlaybackDuration:(UInt32)trackPlaybackDuration queuePlaybackProgress:(UInt32)queuePlaybackProgress queuePlaybackDuration:(UInt32)queuePlaybackDuration queueCurrentTrackNumber:(UInt32)queueCurrentTrackNumber queueTotalTrackCount:(UInt32)queueTotalTrackCount { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLMediaServiceManifest.h b/SmartDeviceLink/public/SDLMediaServiceManifest.h index a3b931c98f..e3ce3f0acc 100644 --- a/SmartDeviceLink/public/SDLMediaServiceManifest.h +++ b/SmartDeviceLink/public/SDLMediaServiceManifest.h @@ -1,10 +1,34 @@ -// -// SDLMediaServiceManifest.h -// SmartDeviceLink -// -// Created by Nicole on 2/11/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" diff --git a/SmartDeviceLink/public/SDLMediaType.h b/SmartDeviceLink/public/SDLMediaType.h index e90d941977..b6ec78cf64 100644 --- a/SmartDeviceLink/public/SDLMediaType.h +++ b/SmartDeviceLink/public/SDLMediaType.h @@ -1,10 +1,34 @@ -// -// SDLMediaType.h -// SmartDeviceLink -// -// Created by Nicole on 2/8/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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMenuLayout.h b/SmartDeviceLink/public/SDLMenuLayout.h index c4904f5d7f..7fe7e5aeca 100644 --- a/SmartDeviceLink/public/SDLMenuLayout.h +++ b/SmartDeviceLink/public/SDLMenuLayout.h @@ -1,10 +1,34 @@ -// -// SDLMenuLayout.h -// SmartDeviceLink -// -// Created by Joel Fischer on 7/12/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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMenuParams.h b/SmartDeviceLink/public/SDLMenuParams.h index 89d807f9ec..05321ff738 100644 --- a/SmartDeviceLink/public/SDLMenuParams.h +++ b/SmartDeviceLink/public/SDLMenuParams.h @@ -1,5 +1,34 @@ -// SDLMenuParams.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" @@ -14,19 +43,27 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLMenuParams : SDLRPCStruct -/// Convenience init with required parameters. -/// -/// @param menuName The menu name -/// @return An instance of the add submenu class +/** + * @param menuName - menuName + * @return A SDLMenuParams object + */ - (instancetype)initWithMenuName:(NSString *)menuName; +/** + * @param menuName - menuName + * @param parentID - parentID + * @param position - position + * @return A SDLMenuParams object + */ +- (instancetype)initWithMenuName:(NSString *)menuName parentID:(nullable NSNumber *)parentID position:(nullable NSNumber *)position; + /// Convenience init with all parameters. /// /// @param menuName The menu name /// @param parentId The unique ID of an existing submenu to which a command will be added /// @param position The position within the items of the parent Command Menu /// @return An instance of the add submenu class -- (instancetype)initWithMenuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position; +- (instancetype)initWithMenuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position __deprecated_msg("Use initWithMenuName:parentID:position: instead"); /** * The unique ID of an existing submenu to which a command will be added diff --git a/SmartDeviceLink/public/SDLMenuParams.m b/SmartDeviceLink/public/SDLMenuParams.m index 85cf5880a1..0174e96b15 100644 --- a/SmartDeviceLink/public/SDLMenuParams.m +++ b/SmartDeviceLink/public/SDLMenuParams.m @@ -11,25 +11,33 @@ @implementation SDLMenuParams -- (instancetype)initWithMenuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position { - self = [self initWithMenuName:menuName]; +- (instancetype)initWithMenuName:(NSString *)menuName { + self = [self init]; if (!self) { return nil; } + self.menuName = menuName; + return self; +} - self.parentID = @(parentId); - self.position = @(position); - +- (instancetype)initWithMenuName:(NSString *)menuName parentID:(nullable NSNumber *)parentID position:(nullable NSNumber *)position { + self = [self initWithMenuName:menuName]; + if (!self) { + return nil; + } + self.parentID = parentID; + self.position = position; return self; } -- (instancetype)initWithMenuName:(NSString *)menuName { - self = [self init]; +- (instancetype)initWithMenuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position { + self = [self initWithMenuName:menuName]; if (!self) { return nil; } - self.menuName = menuName; + self.parentID = @(parentId); + self.position = @(position); return self; } diff --git a/SmartDeviceLink/public/SDLMetadataTags.h b/SmartDeviceLink/public/SDLMetadataTags.h index 4b875b848d..6da2a53036 100644 --- a/SmartDeviceLink/public/SDLMetadataTags.h +++ b/SmartDeviceLink/public/SDLMetadataTags.h @@ -1,26 +1,61 @@ -// -// SDLMetadataTags.h -// SmartDeviceLink-iOS -// -// Created by Brett McIsaac on 8/3/17. -// Copyright © 2017 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 "SDLRPCMessage.h" #import "SDLMetadataType.h" NS_ASSUME_NONNULL_BEGIN -/// Metadata for Show fields +/** + * @added in SmartDeviceLink 4.5.0 + */ @interface SDLMetadataTags : SDLRPCStruct +/** + * @param mainField1 - mainField1 + * @param mainField2 - mainField2 + * @param mainField3 - mainField3 + * @param mainField4 - mainField4 + * @return A SDLMetadataTags object + */ +- (instancetype)initWithMainField1:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2 mainField3:(nullable NSArray *)mainField3 mainField4:(nullable NSArray *)mainField4; + /** Constructs a newly allocated SDLMetadataType object with NSArrays */ -- (instancetype)initWithTextFieldTypes:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2; +- (instancetype)initWithTextFieldTypes:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2 __deprecated_msg("Use initWithMainField1:mainField2:mainField3:mainField4: instead"); /// Constructs a newly allocated SDLMetadataType with all parameters -- (instancetype)initWithTextFieldTypes:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2 mainField3:(nullable NSArray *)mainField3 mainField4:(nullable NSArray *)mainField4; +- (instancetype)initWithTextFieldTypes:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2 mainField3:(nullable NSArray *)mainField3 mainField4:(nullable NSArray *)mainField4 __deprecated_msg("Use initWithMainField1:mainField2:mainField3:mainField4: instead"); /** The type of data contained in the "mainField1" text field. diff --git a/SmartDeviceLink/public/SDLMetadataTags.m b/SmartDeviceLink/public/SDLMetadataTags.m index d61d7237a6..74b700ad8e 100644 --- a/SmartDeviceLink/public/SDLMetadataTags.m +++ b/SmartDeviceLink/public/SDLMetadataTags.m @@ -15,6 +15,18 @@ @implementation SDLMetadataTags +- (instancetype)initWithMainField1:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2 mainField3:(nullable NSArray *)mainField3 mainField4:(nullable NSArray *)mainField4 { + self = [self init]; + if (!self) { + return nil; + } + self.mainField1 = mainField1; + self.mainField2 = mainField2; + self.mainField3 = mainField3; + self.mainField4 = mainField4; + return self; +} + - (instancetype)initWithTextFieldTypes:(nullable NSArray *)mainField1 mainField2:(nullable NSArray *)mainField2 { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLMetadataType.h b/SmartDeviceLink/public/SDLMetadataType.h index 0a57a6e08f..b5fac4bc37 100644 --- a/SmartDeviceLink/public/SDLMetadataType.h +++ b/SmartDeviceLink/public/SDLMetadataType.h @@ -1,11 +1,34 @@ - -// -// SDLMetadataType.h -// SmartDeviceLink-iOS -// -// Created by Brett McIsaac on 8/2/17. -// Copyright © 2017 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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLModuleData.h b/SmartDeviceLink/public/SDLModuleData.h index 3ed7bfd15c..438379adc5 100644 --- a/SmartDeviceLink/public/SDLModuleData.h +++ b/SmartDeviceLink/public/SDLModuleData.h @@ -1,6 +1,34 @@ -// -// SDLModuleData.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 "SDLModuleType.h" @@ -16,10 +44,31 @@ NS_ASSUME_NONNULL_BEGIN /** - Describes a remote control module's data + * The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist + * + * @added in SmartDeviceLink 4.5.0 */ @interface SDLModuleData : SDLRPCStruct +/** + * @param moduleType - moduleType + * @return A SDLModuleData object + */ +- (instancetype)initWithModuleType:(SDLModuleType)moduleType; + +/** + * @param moduleType - moduleType + * @param moduleId - moduleId + * @param radioControlData - radioControlData + * @param climateControlData - climateControlData + * @param seatControlData - seatControlData + * @param audioControlData - audioControlData + * @param lightControlData - lightControlData + * @param hmiSettingsControlData - hmiSettingsControlData + * @return A SDLModuleData object + */ +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId radioControlData:(nullable SDLRadioControlData *)radioControlData climateControlData:(nullable SDLClimateControlData *)climateControlData seatControlData:(nullable SDLSeatControlData *)seatControlData audioControlData:(nullable SDLAudioControlData *)audioControlData lightControlData:(nullable SDLLightControlData *)lightControlData hmiSettingsControlData:(nullable SDLHMISettingsControlData *)hmiSettingsControlData; + /** Constructs a newly allocated SDLModuleData object with radio control data diff --git a/SmartDeviceLink/public/SDLModuleData.m b/SmartDeviceLink/public/SDLModuleData.m index 9595deb4cd..00fe7bd5de 100644 --- a/SmartDeviceLink/public/SDLModuleData.m +++ b/SmartDeviceLink/public/SDLModuleData.m @@ -16,6 +16,30 @@ @implementation SDLModuleData +- (instancetype)initWithModuleType:(SDLModuleType)moduleType { + self = [self init]; + if (!self) { + return nil; + } + self.moduleType = moduleType; + return self; +} + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId radioControlData:(nullable SDLRadioControlData *)radioControlData climateControlData:(nullable SDLClimateControlData *)climateControlData seatControlData:(nullable SDLSeatControlData *)seatControlData audioControlData:(nullable SDLAudioControlData *)audioControlData lightControlData:(nullable SDLLightControlData *)lightControlData hmiSettingsControlData:(nullable SDLHMISettingsControlData *)hmiSettingsControlData { + self = [self initWithModuleType:moduleType]; + if (!self) { + return nil; + } + self.moduleId = moduleId; + self.radioControlData = radioControlData; + self.climateControlData = climateControlData; + self.seatControlData = seatControlData; + self.audioControlData = audioControlData; + self.lightControlData = lightControlData; + self.hmiSettingsControlData = hmiSettingsControlData; + return self; +} + - (instancetype)initWithRadioControlData:(SDLRadioControlData *)radioControlData { self = [self init]; if(!self){ diff --git a/SmartDeviceLink/public/SDLModuleInfo.h b/SmartDeviceLink/public/SDLModuleInfo.h index f8dabce60c..2d81e3facf 100644 --- a/SmartDeviceLink/public/SDLModuleInfo.h +++ b/SmartDeviceLink/public/SDLModuleInfo.h @@ -1,10 +1,34 @@ -// -// SDLModuleInfo.h -// SmartDeviceLink -// -// Created by standa1 on 7/8/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 "SDLRPCMessage.h" #import "SDLGrid.h" @@ -16,6 +40,21 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLModuleInfo : SDLRPCStruct +/** + * @param moduleId - moduleId + * @return A SDLModuleInfo object + */ +- (instancetype)initWithModuleId:(NSString *)moduleId; + +/** + * @param moduleId - moduleId + * @param location - location + * @param serviceArea - serviceArea + * @param allowMultipleAccess - allowMultipleAccess + * @return A SDLModuleInfo object + */ +- (instancetype)initWithModuleId:(NSString *)moduleId location:(nullable SDLGrid *)location serviceArea:(nullable SDLGrid *)serviceArea allowMultipleAccess:(nullable NSNumber *)allowMultipleAccess; + /** * UUID of a module. "moduleId + moduleType" uniquely identify a module. * diff --git a/SmartDeviceLink/public/SDLModuleInfo.m b/SmartDeviceLink/public/SDLModuleInfo.m index 46a95e697c..409cca1ed8 100644 --- a/SmartDeviceLink/public/SDLModuleInfo.m +++ b/SmartDeviceLink/public/SDLModuleInfo.m @@ -13,6 +13,26 @@ @implementation SDLModuleInfo +- (instancetype)initWithModuleId:(NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + self.moduleId = moduleId; + return self; +} + +- (instancetype)initWithModuleId:(NSString *)moduleId location:(nullable SDLGrid *)location serviceArea:(nullable SDLGrid *)serviceArea allowMultipleAccess:(nullable NSNumber *)allowMultipleAccess { + self = [self initWithModuleId:moduleId]; + if (!self) { + return nil; + } + self.location = location; + self.serviceArea = serviceArea; + self.allowMultipleAccess = allowMultipleAccess; + return self; +} + - (void)setModuleId:(NSString *)moduleId { [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } diff --git a/SmartDeviceLink/public/SDLModuleType.h b/SmartDeviceLink/public/SDLModuleType.h index a4091f41d0..3cec8636b4 100644 --- a/SmartDeviceLink/public/SDLModuleType.h +++ b/SmartDeviceLink/public/SDLModuleType.h @@ -1,6 +1,34 @@ -// -// SDLModuleType.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLMsgVersion.h b/SmartDeviceLink/public/SDLMsgVersion.h index 03b033a08e..a00c1aa1e6 100644 --- a/SmartDeviceLink/public/SDLMsgVersion.h +++ b/SmartDeviceLink/public/SDLMsgVersion.h @@ -16,6 +16,21 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLMsgVersion : SDLRPCStruct +/** + * @param majorVersion - @(majorVersion) + * @param minorVersion - @(minorVersion) + * @return A SDLSdlMsgVersion object + */ +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt16)minorVersion; + +/** + * @param majorVersion - @(majorVersion) + * @param minorVersion - @(minorVersion) + * @param patchVersion - patchVersion + * @return A SDLSdlMsgVersion object + */ +- (instancetype)initWithMajorVersionParam:(UInt8)majorVersion minorVersion:(UInt16)minorVersion patchVersion:(nullable NSNumber *)patchVersion __deprecated_msg("Eventually an initializer without param will be added"); + /** * Convenience init for all parameters. * @@ -24,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN * @param patchVersion Patch version * @return A SDLMsgVersion object */ -- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion; +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion __deprecated_msg("Eventually an initializer with different parameter types will be added"); /** * The major version indicates versions that is not-compatible to previous versions diff --git a/SmartDeviceLink/public/SDLMsgVersion.m b/SmartDeviceLink/public/SDLMsgVersion.m index ee0dc04fa1..3b948b0eb9 100644 --- a/SmartDeviceLink/public/SDLMsgVersion.m +++ b/SmartDeviceLink/public/SDLMsgVersion.m @@ -12,6 +12,25 @@ @implementation SDLMsgVersion +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt16)minorVersion { + self = [self init]; + if (!self) { + return nil; + } + self.majorVersion = @(majorVersion); + self.minorVersion = @(minorVersion); + return self; +} + +- (instancetype)initWithMajorVersionParam:(UInt8)majorVersion minorVersion:(UInt16)minorVersion patchVersion:(nullable NSNumber *)patchVersion { + self = [self initWithMajorVersion:majorVersion minorVersion:minorVersion]; + if (!self) { + return nil; + } + self.patchVersion = patchVersion; + return self; +} + - (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLMyKey.h b/SmartDeviceLink/public/SDLMyKey.h index e9f53aab41..72f761c4d9 100644 --- a/SmartDeviceLink/public/SDLMyKey.h +++ b/SmartDeviceLink/public/SDLMyKey.h @@ -1,5 +1,34 @@ -// SDLMyKey.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 "SDLVehicleDataStatus.h" @@ -7,10 +36,16 @@ NS_ASSUME_NONNULL_BEGIN /** - Vehicle Data struct + * @added in SmartDeviceLink 2.0.0 */ @interface SDLMyKey : SDLRPCStruct +/** + * @param e911Override - e911Override + * @return A SDLMyKey object + */ +- (instancetype)initWithE911Override:(SDLVehicleDataStatus)e911Override; + /** Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus. */ diff --git a/SmartDeviceLink/public/SDLMyKey.m b/SmartDeviceLink/public/SDLMyKey.m index 6ed384039c..062d42a7af 100644 --- a/SmartDeviceLink/public/SDLMyKey.m +++ b/SmartDeviceLink/public/SDLMyKey.m @@ -11,6 +11,15 @@ @implementation SDLMyKey +- (instancetype)initWithE911Override:(SDLVehicleDataStatus)e911Override { + self = [self init]; + if (!self) { + return nil; + } + self.e911Override = e911Override; + return self; +} + - (void)setE911Override:(SDLVehicleDataStatus)e911Override { [self.store sdl_setObject:e911Override forName:SDLRPCParameterNameE911Override]; } diff --git a/SmartDeviceLink/public/SDLNavigationAction.h b/SmartDeviceLink/public/SDLNavigationAction.h index 7d6ff194a5..582e5b0239 100644 --- a/SmartDeviceLink/public/SDLNavigationAction.h +++ b/SmartDeviceLink/public/SDLNavigationAction.h @@ -1,10 +1,34 @@ -// -// SDLNavigationAction.h -// SmartDeviceLink -// -// Created by Nicole on 2/22/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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLNavigationCapability.h b/SmartDeviceLink/public/SDLNavigationCapability.h index 91fad71462..ef65213a4b 100644 --- a/SmartDeviceLink/public/SDLNavigationCapability.h +++ b/SmartDeviceLink/public/SDLNavigationCapability.h @@ -1,10 +1,34 @@ -// -// SDLNavigationCapability.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/11/17. -// Copyright © 2017 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 "SDLRPCStruct.h" @@ -15,6 +39,13 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLNavigationCapability : SDLRPCStruct +/** + * @param sendLocationEnabled - sendLocationEnabled + * @param getWayPointsEnabled - getWayPointsEnabled + * @return A SDLNavigationCapability object + */ +- (instancetype)initWithSendLocationEnabled:(nullable NSNumber *)sendLocationEnabled getWayPointsEnabled:(nullable NSNumber *)getWayPointsEnabled; + /// Convenience init with all parameters /// /// @param sendLocationEnabled Whether or not the SendLocation RPC is enabled diff --git a/SmartDeviceLink/public/SDLNavigationCapability.m b/SmartDeviceLink/public/SDLNavigationCapability.m index 7f536bc5ac..98ea76fbad 100644 --- a/SmartDeviceLink/public/SDLNavigationCapability.m +++ b/SmartDeviceLink/public/SDLNavigationCapability.m @@ -15,6 +15,16 @@ @implementation SDLNavigationCapability +- (instancetype)initWithSendLocationEnabled:(nullable NSNumber *)sendLocationEnabled getWayPointsEnabled:(nullable NSNumber *)getWayPointsEnabled { + self = [self init]; + if (!self) { + return nil; + } + self.sendLocationEnabled = sendLocationEnabled; + self.getWayPointsEnabled = getWayPointsEnabled; + return self; +} + - (instancetype)initWithSendLocation:(BOOL)sendLocationEnabled waypoints:(BOOL)waypointsEnabled { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLNavigationInstruction.h b/SmartDeviceLink/public/SDLNavigationInstruction.h index a04cf6ef93..87e4031d6b 100644 --- a/SmartDeviceLink/public/SDLNavigationInstruction.h +++ b/SmartDeviceLink/public/SDLNavigationInstruction.h @@ -1,10 +1,34 @@ -// -// SDLNavigationInstruction.h -// SmartDeviceLink -// -// Created by Nicole on 2/22/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 "SDLRPCMessage.h" @@ -20,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN /** - * A navigation instruction. + * @added in SmartDeviceLink 5.1.0 */ @interface SDLNavigationInstruction : SDLRPCStruct @@ -31,7 +55,20 @@ NS_ASSUME_NONNULL_BEGIN * @param action The navigation action * @return A SDLNavigationInstruction object */ -- (instancetype)initWithLocationDetails:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithLocationDetails:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action; + +/** + * @param locationDetails - locationDetails + * @param action - action + * @param eta - eta + * @param bearing - bearing + * @param junctionType - junctionType + * @param drivingSide - drivingSide + * @param details - details + * @param image - image + * @return A SDLNavigationInstruction object + */ +- (instancetype)initWithLocationDetailsParam:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action eta:(nullable SDLDateTime *)eta bearing:(nullable NSNumber *)bearing junctionType:(nullable SDLNavigationJunction)junctionType drivingSide:(nullable SDLDirection)drivingSide details:(nullable NSString *)details image:(nullable SDLImage *)image __deprecated_msg("An initializer without param will eventually be added instead"); /** * Convenience init for all parameters. @@ -46,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN * @param image An image representation of this instruction * @return A SDLNavigationInstruction object */ -- (instancetype)initWithLocationDetails:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action eta:(nullable SDLDateTime *)eta bearing:(UInt16)bearing junctionType:(nullable SDLNavigationJunction)junctionType drivingSide:(nullable SDLDirection)drivingSide details:(nullable NSString *)details image:(nullable SDLImage *)image; +- (instancetype)initWithLocationDetails:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action eta:(nullable SDLDateTime *)eta bearing:(UInt16)bearing junctionType:(nullable SDLNavigationJunction)junctionType drivingSide:(nullable SDLDirection)drivingSide details:(nullable NSString *)details image:(nullable SDLImage *)image __deprecated_msg("An initializer with different parameter types will eventually be added instead"); /** * The location details. diff --git a/SmartDeviceLink/public/SDLNavigationInstruction.m b/SmartDeviceLink/public/SDLNavigationInstruction.m index d6e8e66d03..d88046b6d0 100644 --- a/SmartDeviceLink/public/SDLNavigationInstruction.m +++ b/SmartDeviceLink/public/SDLNavigationInstruction.m @@ -31,6 +31,20 @@ - (instancetype)initWithLocationDetails:(SDLLocationDetails *)locationDetails ac return self; } +- (instancetype)initWithLocationDetailsParam:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action eta:(nullable SDLDateTime *)eta bearing:(nullable NSNumber *)bearing junctionType:(nullable SDLNavigationJunction)junctionType drivingSide:(nullable SDLDirection)drivingSide details:(nullable NSString *)details image:(nullable SDLImage *)image { + self = [self initWithLocationDetails:locationDetails action:action]; + if (!self) { + return nil; + } + self.eta = eta; + self.bearing = bearing; + self.junctionType = junctionType; + self.drivingSide = drivingSide; + self.details = details; + self.image = image; + return self; +} + - (instancetype)initWithLocationDetails:(SDLLocationDetails *)locationDetails action:(SDLNavigationAction)action eta:(nullable SDLDateTime *)eta bearing:(UInt16)bearing junctionType:(nullable SDLNavigationJunction)junctionType drivingSide:(nullable SDLDirection)drivingSide details:(nullable NSString *)details image:(nullable SDLImage *)image { self = [self initWithLocationDetails:locationDetails action:action]; if (!self) { diff --git a/SmartDeviceLink/public/SDLNavigationJunction.h b/SmartDeviceLink/public/SDLNavigationJunction.h index 5ae7ec2984..8f15870852 100644 --- a/SmartDeviceLink/public/SDLNavigationJunction.h +++ b/SmartDeviceLink/public/SDLNavigationJunction.h @@ -1,10 +1,34 @@ -// -// SDLNavigationJunction.h -// SmartDeviceLink -// -// Created by Nicole on 2/22/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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLNavigationServiceData.h b/SmartDeviceLink/public/SDLNavigationServiceData.h index 0f090fc96d..c1eae7fe82 100644 --- a/SmartDeviceLink/public/SDLNavigationServiceData.h +++ b/SmartDeviceLink/public/SDLNavigationServiceData.h @@ -1,10 +1,34 @@ -// -// SDLNavigationServiceData.h -// SmartDeviceLink -// -// Created by Nicole on 2/22/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 "SDLRPCMessage.h" @@ -19,13 +43,33 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLNavigationServiceData : SDLRPCStruct +/** + * @param timeStamp - timeStamp + * @return A SDLNavigationServiceData object + */ +- (instancetype)initWithTimeStamp:(SDLDateTime *)timeStamp; + +/** + * @param timeStamp - timeStamp + * @param origin - origin + * @param destination - destination + * @param destinationETA - destinationETA + * @param instructions - instructions + * @param nextInstructionETA - nextInstructionETA + * @param nextInstructionDistance - nextInstructionDistance + * @param nextInstructionDistanceScale - nextInstructionDistanceScale + * @param prompt - prompt + * @return A SDLNavigationServiceData object + */ +- (instancetype)initWithTimeStamp:(SDLDateTime *)timeStamp origin:(nullable SDLLocationDetails *)origin destination:(nullable SDLLocationDetails *)destination destinationETA:(nullable SDLDateTime *)destinationETA instructions:(nullable NSArray *)instructions nextInstructionETA:(nullable SDLDateTime *)nextInstructionETA nextInstructionDistance:(nullable NSNumber *)nextInstructionDistance nextInstructionDistanceScale:(nullable NSNumber *)nextInstructionDistanceScale prompt:(nullable NSString *)prompt; + /** * Convenience init for required parameters. * * @param timestamp Timestamp of when the data was generated * @return A SDLNavigationServiceData object */ -- (instancetype)initWithTimestamp:(SDLDateTime *)timestamp NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithTimestamp:(SDLDateTime *)timestamp __deprecated_msg("Use initWithTimeStamp: instead"); /** * Convenience init for all parameters. @@ -41,14 +85,19 @@ NS_ASSUME_NONNULL_BEGIN * @param prompt This is a prompt message that should be conveyed to the user through either display or voice (TTS) * @return A SDLNavigationServiceData object */ -- (instancetype)initWithTimestamp:(SDLDateTime *)timestamp origin:(nullable SDLLocationDetails *)origin destination:(nullable SDLLocationDetails *)destination destinationETA:(nullable SDLDateTime *)destinationETA instructions:(nullable NSArray *)instructions nextInstructionETA:(nullable SDLDateTime *)nextInstructionETA nextInstructionDistance:(float)nextInstructionDistance nextInstructionDistanceScale:(float)nextInstructionDistanceScale prompt:(nullable NSString *)prompt; +- (instancetype)initWithTimestamp:(SDLDateTime *)timestamp origin:(nullable SDLLocationDetails *)origin destination:(nullable SDLLocationDetails *)destination destinationETA:(nullable SDLDateTime *)destinationETA instructions:(nullable NSArray *)instructions nextInstructionETA:(nullable SDLDateTime *)nextInstructionETA nextInstructionDistance:(float)nextInstructionDistance nextInstructionDistanceScale:(float)nextInstructionDistanceScale prompt:(nullable NSString *)prompt __deprecated_msg("Use initWithTimeStamp:origin:destination:destinationETA:instructions:nextInstructionETA:nextInstructionDistance:nextInstructionDistanceScale:prompt: instead"); + +/** + * This is the timestamp of when the data was generated. This is to ensure any time or distance given in the data can accurately be adjusted if necessary. + */ +@property (strong, nonatomic) SDLDateTime *timeStamp; /** * This is the timestamp of when the data was generated. This is to ensure any time or distance given in the data can accurately be adjusted if necessary. * * SDLDateTime, Required */ -@property (strong, nonatomic) SDLDateTime *timestamp; +@property (strong, nonatomic) SDLDateTime *timestamp __deprecated_msg("Use timeStamp instead"); /** * The start location. diff --git a/SmartDeviceLink/public/SDLNavigationServiceData.m b/SmartDeviceLink/public/SDLNavigationServiceData.m index 6143c47eeb..e60c4d166b 100644 --- a/SmartDeviceLink/public/SDLNavigationServiceData.m +++ b/SmartDeviceLink/public/SDLNavigationServiceData.m @@ -18,6 +18,31 @@ @implementation SDLNavigationServiceData +- (instancetype)initWithTimeStamp:(SDLDateTime *)timeStamp { + self = [self init]; + if (!self) { + return nil; + } + self.timeStamp = timeStamp; + return self; +} + +- (instancetype)initWithTimeStamp:(SDLDateTime *)timeStamp origin:(nullable SDLLocationDetails *)origin destination:(nullable SDLLocationDetails *)destination destinationETA:(nullable SDLDateTime *)destinationETA instructions:(nullable NSArray *)instructions nextInstructionETA:(nullable SDLDateTime *)nextInstructionETA nextInstructionDistance:(nullable NSNumber *)nextInstructionDistance nextInstructionDistanceScale:(nullable NSNumber *)nextInstructionDistanceScale prompt:(nullable NSString *)prompt { + self = [self initWithTimeStamp:timeStamp]; + if (!self) { + return nil; + } + self.origin = origin; + self.destination = destination; + self.destinationETA = destinationETA; + self.instructions = instructions; + self.nextInstructionETA = nextInstructionETA; + self.nextInstructionDistance = nextInstructionDistance; + self.nextInstructionDistanceScale = nextInstructionDistanceScale; + self.prompt = prompt; + return self; +} + - (instancetype)initWithTimestamp:(SDLDateTime *)timestamp { self = [super init]; if (!self) { @@ -47,6 +72,15 @@ - (instancetype)initWithTimestamp:(SDLDateTime *)timestamp origin:(nullable SDLL return self; } +- (void)setTimeStamp:(SDLDateTime *)timeStamp { + [self.store sdl_setObject:timeStamp forName:SDLRPCParameterNameTimeStamp]; +} + +- (SDLDateTime *)timeStamp { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameTimeStamp ofClass:SDLDateTime.class error:&error]; +} + - (void)setTimestamp:(SDLDateTime *)timestamp { [self.store sdl_setObject:timestamp forName:SDLRPCParameterNameTimeStamp]; } diff --git a/SmartDeviceLink/public/SDLNavigationServiceManifest.h b/SmartDeviceLink/public/SDLNavigationServiceManifest.h index 1c8f354057..ea27e39e81 100644 --- a/SmartDeviceLink/public/SDLNavigationServiceManifest.h +++ b/SmartDeviceLink/public/SDLNavigationServiceManifest.h @@ -1,10 +1,34 @@ -// -// SDLNavigationServiceManifest.h -// SmartDeviceLink -// -// Created by Nicole on 2/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 "SDLRPCMessage.h" @@ -15,13 +39,19 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLNavigationServiceManifest : SDLRPCStruct +/** + * @param acceptsWayPoints - acceptsWayPoints + * @return A SDLNavigationServiceManifest object + */ +- (instancetype)initWithAcceptsWayPointsParam:(nullable NSNumber *)acceptsWayPoints __deprecated_msg("Eventually an initializer without param will be added"); + /** * Convenience init. * * @param acceptsWayPoints Informs the subscriber if this service can actually accept way points * @return A SDLNavigationServiceManifest object */ -- (instancetype)initWithAcceptsWayPoints:(BOOL)acceptsWayPoints; +- (instancetype)initWithAcceptsWayPoints:(BOOL)acceptsWayPoints __deprecated_msg("Eventually an initializer with a different parameter type will be added"); /** * Informs the subscriber if this service can actually accept way points. diff --git a/SmartDeviceLink/public/SDLNavigationServiceManifest.m b/SmartDeviceLink/public/SDLNavigationServiceManifest.m index 5769467228..9233b0bfe1 100644 --- a/SmartDeviceLink/public/SDLNavigationServiceManifest.m +++ b/SmartDeviceLink/public/SDLNavigationServiceManifest.m @@ -15,6 +15,15 @@ @implementation SDLNavigationServiceManifest +- (instancetype)initWithAcceptsWayPointsParam:(nullable NSNumber *)acceptsWayPoints { + self = [self init]; + if (!self) { + return nil; + } + self.acceptsWayPoints = acceptsWayPoints; + return self; +} + - (instancetype)initWithAcceptsWayPoints:(BOOL)acceptsWayPoints { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLOasisAddress.h b/SmartDeviceLink/public/SDLOasisAddress.h index ab65d1f0e8..9a1eda45f2 100644 --- a/SmartDeviceLink/public/SDLOasisAddress.h +++ b/SmartDeviceLink/public/SDLOasisAddress.h @@ -1,5 +1,34 @@ -// SDLOasisAddress.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,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLOasisAddress : SDLRPCStruct +/** + * @param countryName - countryName + * @param countryCode - countryCode + * @param postalCode - postalCode + * @param administrativeArea - administrativeArea + * @param subAdministrativeArea - subAdministrativeArea + * @param locality - locality + * @param subLocality - subLocality + * @param thoroughfare - thoroughfare + * @param subThoroughfare - subThoroughfare + * @return A SDLOASISAddress object + */ +- (instancetype)initWithCountryName:(nullable NSString *)countryName countryCode:(nullable NSString *)countryCode postalCode:(nullable NSString *)postalCode administrativeArea:(nullable NSString *)administrativeArea subAdministrativeArea:(nullable NSString *)subAdministrativeArea locality:(nullable NSString *)locality subLocality:(nullable NSString *)subLocality thoroughfare:(nullable NSString *)thoroughfare subThoroughfare:(nullable NSString *)subThoroughfare; + /// Convenience init to describe an oasis address /// /// @param subThoroughfare Portion of thoroughfare (e.g. house number) @@ -18,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param administrativeArea Portion of country (e.g. state) /// @param postalCode PostalCode of location (PLZ, ZIP, PIN, CAP etc.) /// @param countryCode CountryCode of the country(ISO 3166-2) -- (instancetype)initWithSubThoroughfare:(nullable NSString *)subThoroughfare thoroughfare:(nullable NSString *)thoroughfare locality:(nullable NSString *)locality administrativeArea:(nullable NSString *)administrativeArea postalCode:(nullable NSString *)postalCode countryCode:(nullable NSString *)countryCode; +- (instancetype)initWithSubThoroughfare:(nullable NSString *)subThoroughfare thoroughfare:(nullable NSString *)thoroughfare locality:(nullable NSString *)locality administrativeArea:(nullable NSString *)administrativeArea postalCode:(nullable NSString *)postalCode countryCode:(nullable NSString *)countryCode __deprecated_msg("Use initWithCountryName:countryCode:postalCode:administrativeArea:subAdministrativeArea:locality:subLocality:thoroughfare:subThoroughfare:"); /// Convenience init to describe an oasis address with all parameters /// @@ -30,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param countryCode CountryCode of the country(ISO 3166-2) /// @param subAdministrativeArea Portion of administrativeArea (e.g. county) /// @param subLocality Hypernym for district -- (instancetype)initWithSubThoroughfare:(nullable NSString *)subThoroughfare thoroughfare:(nullable NSString *)thoroughfare locality:(nullable NSString *)locality administrativeArea:(nullable NSString *)administrativeArea postalCode:(nullable NSString *)postalCode countryCode:(nullable NSString *)countryCode countryName:(nullable NSString *)countryName subAdministrativeArea:(nullable NSString *)subAdministrativeArea subLocality:(nullable NSString *)subLocality; +- (instancetype)initWithSubThoroughfare:(nullable NSString *)subThoroughfare thoroughfare:(nullable NSString *)thoroughfare locality:(nullable NSString *)locality administrativeArea:(nullable NSString *)administrativeArea postalCode:(nullable NSString *)postalCode countryCode:(nullable NSString *)countryCode countryName:(nullable NSString *)countryName subAdministrativeArea:(nullable NSString *)subAdministrativeArea subLocality:(nullable NSString *)subLocality __deprecated_msg("Use initWithCountryName:countryCode:postalCode:administrativeArea:subAdministrativeArea:locality:subLocality:thoroughfare:subThoroughfare:"); /** * Name of the country (localized) diff --git a/SmartDeviceLink/public/SDLOasisAddress.m b/SmartDeviceLink/public/SDLOasisAddress.m index 798804bd60..fea97aba3d 100644 --- a/SmartDeviceLink/public/SDLOasisAddress.m +++ b/SmartDeviceLink/public/SDLOasisAddress.m @@ -10,6 +10,23 @@ @implementation SDLOasisAddress +- (instancetype)initWithCountryName:(nullable NSString *)countryName countryCode:(nullable NSString *)countryCode postalCode:(nullable NSString *)postalCode administrativeArea:(nullable NSString *)administrativeArea subAdministrativeArea:(nullable NSString *)subAdministrativeArea locality:(nullable NSString *)locality subLocality:(nullable NSString *)subLocality thoroughfare:(nullable NSString *)thoroughfare subThoroughfare:(nullable NSString *)subThoroughfare { + self = [self init]; + if (!self) { + return nil; + } + self.countryName = countryName; + self.countryCode = countryCode; + self.postalCode = postalCode; + self.administrativeArea = administrativeArea; + self.subAdministrativeArea = subAdministrativeArea; + self.locality = locality; + self.subLocality = subLocality; + self.thoroughfare = thoroughfare; + self.subThoroughfare = subThoroughfare; + return self; +} + - (instancetype)initWithSubThoroughfare:(nullable NSString *)subThoroughfare thoroughfare:(nullable NSString *)thoroughfare locality:(nullable NSString *)locality administrativeArea:(nullable NSString *)administrativeArea postalCode:(nullable NSString *)postalCode countryCode:(nullable NSString *)countryCode { return [self initWithSubThoroughfare:subThoroughfare thoroughfare:thoroughfare locality:locality administrativeArea:administrativeArea postalCode:postalCode countryCode:countryCode countryName:nil subAdministrativeArea:nil subLocality:nil]; } diff --git a/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.h b/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.h index c24381c7cd..6f4205c4cb 100644 --- a/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.h +++ b/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.h @@ -1,5 +1,34 @@ -// SDLOnAppInterfaceUnregistered.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 "SDLRPCNotification.h" @@ -19,6 +48,12 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLOnAppInterfaceUnregistered : SDLRPCNotification +/** + * @param reason - reason + * @return A SDLOnAppInterfaceUnregistered object + */ +- (instancetype)initWithReason:(SDLAppInterfaceUnregisteredReason)reason; + /** * The reason application's interface was terminated */ diff --git a/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.m b/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.m index c99ab7571f..43c1e180e2 100644 --- a/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.m +++ b/SmartDeviceLink/public/SDLOnAppInterfaceUnregistered.m @@ -20,6 +20,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithReason:(SDLAppInterfaceUnregisteredReason)reason { + self = [self init]; + if (!self) { + return nil; + } + self.reason = reason; + return self; +} + - (void)setReason:(SDLAppInterfaceUnregisteredReason)reason { [self.parameters sdl_setObject:reason forName:SDLRPCParameterNameReason]; } diff --git a/SmartDeviceLink/public/SDLOnAppServiceData.h b/SmartDeviceLink/public/SDLOnAppServiceData.h index f3a4ff16cb..2d18e2993a 100644 --- a/SmartDeviceLink/public/SDLOnAppServiceData.h +++ b/SmartDeviceLink/public/SDLOnAppServiceData.h @@ -1,10 +1,34 @@ -// -// SDLOnAppServiceData.h -// SmartDeviceLink -// -// Created by Nicole on 2/7/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 "SDLRPCNotification.h" diff --git a/SmartDeviceLink/public/SDLOnAudioPassThru.h b/SmartDeviceLink/public/SDLOnAudioPassThru.h index 13b2448331..b05129f692 100644 --- a/SmartDeviceLink/public/SDLOnAudioPassThru.h +++ b/SmartDeviceLink/public/SDLOnAudioPassThru.h @@ -1,5 +1,34 @@ -// SDLOnAudioPassThru.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 "SDLRPCNotification.h" diff --git a/SmartDeviceLink/public/SDLOnButtonEvent.h b/SmartDeviceLink/public/SDLOnButtonEvent.h index 25f18d7a93..c4fb95a6ca 100644 --- a/SmartDeviceLink/public/SDLOnButtonEvent.h +++ b/SmartDeviceLink/public/SDLOnButtonEvent.h @@ -1,11 +1,42 @@ -// SDLOnButtonEvent.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 "SDLRPCNotification.h" #import "SDLButtonName.h" #import "SDLButtonEventMode.h" +NS_ASSUME_NONNULL_BEGIN + /** Notifies application that user has depressed or released a button to which the application has subscribed. @@ -37,10 +68,22 @@ @since SDL 1.0 */ +@interface SDLOnButtonEvent : SDLRPCNotification -NS_ASSUME_NONNULL_BEGIN +/** + * @param buttonName - buttonName + * @param buttonEventMode - buttonEventMode + * @return A SDLOnButtonEvent object + */ +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonEventMode:(SDLButtonEventMode)buttonEventMode; -@interface SDLOnButtonEvent : SDLRPCNotification +/** + * @param buttonName - buttonName + * @param buttonEventMode - buttonEventMode + * @param customButtonID - customButtonID + * @return A SDLOnButtonEvent object + */ +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonEventMode:(SDLButtonEventMode)buttonEventMode customButtonID:(nullable NSNumber *)customButtonID; /** * The name of the button diff --git a/SmartDeviceLink/public/SDLOnButtonEvent.m b/SmartDeviceLink/public/SDLOnButtonEvent.m index 3e9c57cd6b..321eff320c 100644 --- a/SmartDeviceLink/public/SDLOnButtonEvent.m +++ b/SmartDeviceLink/public/SDLOnButtonEvent.m @@ -20,6 +20,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonEventMode:(SDLButtonEventMode)buttonEventMode { + self = [self init]; + if (!self) { + return nil; + } + self.buttonName = buttonName; + self.buttonEventMode = buttonEventMode; + return self; +} + +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonEventMode:(SDLButtonEventMode)buttonEventMode customButtonID:(nullable NSNumber *)customButtonID { + self = [self initWithButtonName:buttonName buttonEventMode:buttonEventMode]; + if (!self) { + return nil; + } + self.customButtonID = customButtonID; + return self; +} + - (void)setButtonName:(SDLButtonName)buttonName { [self.parameters sdl_setObject:buttonName forName:SDLRPCParameterNameButtonName]; } diff --git a/SmartDeviceLink/public/SDLOnButtonPress.h b/SmartDeviceLink/public/SDLOnButtonPress.h index 1a2668e650..028a4605d0 100644 --- a/SmartDeviceLink/public/SDLOnButtonPress.h +++ b/SmartDeviceLink/public/SDLOnButtonPress.h @@ -1,11 +1,42 @@ -// SDLOnButtonPress.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 "SDLRPCNotification.h" #import "SDLButtonName.h" #import "SDLButtonPressMode.h" +NS_ASSUME_NONNULL_BEGIN + /** Notifies application of button press events for buttons to which the application is subscribed. SDL supports two button press events defined as follows: @@ -29,10 +60,22 @@ @since SDL 1.0 */ +@interface SDLOnButtonPress : SDLRPCNotification -NS_ASSUME_NONNULL_BEGIN +/** + * @param buttonName - buttonName + * @param buttonPressMode - buttonPressMode + * @return A SDLOnButtonPress object + */ +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode; -@interface SDLOnButtonPress : SDLRPCNotification +/** + * @param buttonName - buttonName + * @param buttonPressMode - buttonPressMode + * @param customButtonID - customButtonID + * @return A SDLOnButtonPress object + */ +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode customButtonID:(nullable NSNumber *)customButtonID; /** * The button's name diff --git a/SmartDeviceLink/public/SDLOnButtonPress.m b/SmartDeviceLink/public/SDLOnButtonPress.m index 2acced3d0f..88f88012c7 100644 --- a/SmartDeviceLink/public/SDLOnButtonPress.m +++ b/SmartDeviceLink/public/SDLOnButtonPress.m @@ -20,6 +20,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode { + self = [self init]; + if (!self) { + return nil; + } + self.buttonName = buttonName; + self.buttonPressMode = buttonPressMode; + return self; +} + +- (instancetype)initWithButtonName:(SDLButtonName)buttonName buttonPressMode:(SDLButtonPressMode)buttonPressMode customButtonID:(nullable NSNumber *)customButtonID { + self = [self initWithButtonName:buttonName buttonPressMode:buttonPressMode]; + if (!self) { + return nil; + } + self.customButtonID = customButtonID; + return self; +} + - (void)setButtonName:(SDLButtonName)buttonName { [self.parameters sdl_setObject:buttonName forName:SDLRPCParameterNameButtonName]; } diff --git a/SmartDeviceLink/public/SDLOnCommand.h b/SmartDeviceLink/public/SDLOnCommand.h index 7fff8045b2..b257a56760 100644 --- a/SmartDeviceLink/public/SDLOnCommand.h +++ b/SmartDeviceLink/public/SDLOnCommand.h @@ -5,6 +5,8 @@ #import "SDLTriggerSource.h" +NS_ASSUME_NONNULL_BEGIN + /** This is called when a command was selected via VR after pressing the PTT button, or selected from the menu after pressing the MENU button. @@ -13,11 +15,15 @@ @since SDL 1.0 @see SDLAddCommand SDLDeleteCommand SDLDeleteSubMenu */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLOnCommand : SDLRPCNotification +/** + * @param cmdID - @(cmdID) + * @param triggerSource - triggerSource + * @return A SDLOnCommand object + */ +- (instancetype)initWithCmdID:(UInt32)cmdID triggerSource:(SDLTriggerSource)triggerSource; + /** The command ID of the command the user selected. This is the command ID value provided by the application in the SDLAddCommand operation that created the command. */ diff --git a/SmartDeviceLink/public/SDLOnCommand.m b/SmartDeviceLink/public/SDLOnCommand.m index 40a9750574..f944552792 100644 --- a/SmartDeviceLink/public/SDLOnCommand.m +++ b/SmartDeviceLink/public/SDLOnCommand.m @@ -20,6 +20,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithCmdID:(UInt32)cmdID triggerSource:(SDLTriggerSource)triggerSource { + self = [self init]; + if (!self) { + return nil; + } + self.cmdID = @(cmdID); + self.triggerSource = triggerSource; + return self; +} + - (void)setCmdID:(NSNumber *)cmdID { [self.parameters sdl_setObject:cmdID forName:SDLRPCParameterNameCommandId]; } diff --git a/SmartDeviceLink/public/SDLOnDriverDistraction.h b/SmartDeviceLink/public/SDLOnDriverDistraction.h index e08efc5837..e1a57deb36 100644 --- a/SmartDeviceLink/public/SDLOnDriverDistraction.h +++ b/SmartDeviceLink/public/SDLOnDriverDistraction.h @@ -1,10 +1,41 @@ -// SDLOnDriverDistraction.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 "SDLRPCNotification.h" #import "SDLDriverDistractionState.h" +NS_ASSUME_NONNULL_BEGIN + /** Notifies the application of the current driver distraction state (whether driver distraction rules are in effect, or not). @@ -18,10 +49,21 @@ @since SDL 1.0 */ +@interface SDLOnDriverDistraction : SDLRPCNotification -NS_ASSUME_NONNULL_BEGIN +/** + * @param state - state + * @return A SDLOnDriverDistraction object + */ +- (instancetype)initWithState:(SDLDriverDistractionState)state; -@interface SDLOnDriverDistraction : SDLRPCNotification +/** + * @param state - state + * @param lockScreenDismissalEnabled - lockScreenDismissalEnabled + * @param lockScreenDismissalWarning - lockScreenDismissalWarning + * @return A SDLOnDriverDistraction object + */ +- (instancetype)initWithState:(SDLDriverDistractionState)state lockScreenDismissalEnabled:(nullable NSNumber *)lockScreenDismissalEnabled lockScreenDismissalWarning:(nullable NSString *)lockScreenDismissalWarning; /** The driver distraction state (i.e. whether driver distraction rules are in effect, or not) diff --git a/SmartDeviceLink/public/SDLOnDriverDistraction.m b/SmartDeviceLink/public/SDLOnDriverDistraction.m index 4d949ffb79..c86e49c80a 100644 --- a/SmartDeviceLink/public/SDLOnDriverDistraction.m +++ b/SmartDeviceLink/public/SDLOnDriverDistraction.m @@ -21,6 +21,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithState:(SDLDriverDistractionState)state { + self = [self init]; + if (!self) { + return nil; + } + self.state = state; + return self; +} + +- (instancetype)initWithState:(SDLDriverDistractionState)state lockScreenDismissalEnabled:(nullable NSNumber *)lockScreenDismissalEnabled lockScreenDismissalWarning:(nullable NSString *)lockScreenDismissalWarning { + self = [self initWithState:state]; + if (!self) { + return nil; + } + self.lockScreenDismissalEnabled = lockScreenDismissalEnabled; + self.lockScreenDismissalWarning = lockScreenDismissalWarning; + return self; +} + - (void)setState:(SDLDriverDistractionState)state { [self.parameters sdl_setObject:state forName:SDLRPCParameterNameState]; } diff --git a/SmartDeviceLink/public/SDLOnEncodedSyncPData.h b/SmartDeviceLink/public/SDLOnEncodedSyncPData.h index b42880ec85..51edfb3ce1 100644 --- a/SmartDeviceLink/public/SDLOnEncodedSyncPData.h +++ b/SmartDeviceLink/public/SDLOnEncodedSyncPData.h @@ -1,5 +1,34 @@ -// SDLOnEncodedSyncPData.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 "SDLRPCNotification.h" @@ -11,6 +40,20 @@ NS_ASSUME_NONNULL_BEGIN __deprecated @interface SDLOnEncodedSyncPData : SDLRPCNotification +/** + * @param data - data + * @return A SDLOnEncodedSyncPData object + */ +- (instancetype)initWithData:(NSArray *)data; + +/** + * @param data - data + * @param URL - URL + * @param Timeout - Timeout + * @return A SDLOnEncodedSyncPData object + */ +- (instancetype)initWithData:(NSArray *)data uRL:(nullable NSString *)URL timeout:(nullable NSNumber *)Timeout; + /** Contains base64 encoded string of SyncP packets. */ diff --git a/SmartDeviceLink/public/SDLOnEncodedSyncPData.m b/SmartDeviceLink/public/SDLOnEncodedSyncPData.m index 830bb5d3f5..93dceafb92 100644 --- a/SmartDeviceLink/public/SDLOnEncodedSyncPData.m +++ b/SmartDeviceLink/public/SDLOnEncodedSyncPData.m @@ -23,6 +23,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithData:(NSArray *)data { + self = [self init]; + if (!self) { + return nil; + } + self.data = data; + return self; +} + +- (instancetype)initWithData:(NSArray *)data uRL:(nullable NSString *)URL timeout:(nullable NSNumber *)Timeout { + self = [self initWithData:data]; + if (!self) { + return nil; + } + self.URL = URL; + self.Timeout = Timeout; + return self; +} + - (void)setData:(NSArray *)data { [self.parameters sdl_setObject:data forName:SDLRPCParameterNameData]; } diff --git a/SmartDeviceLink/public/SDLOnHMIStatus.h b/SmartDeviceLink/public/SDLOnHMIStatus.h index 22a43500a4..d144643455 100644 --- a/SmartDeviceLink/public/SDLOnHMIStatus.h +++ b/SmartDeviceLink/public/SDLOnHMIStatus.h @@ -1,5 +1,34 @@ -// SDLOnHMIStatus.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 "SDLRPCNotification.h" @@ -8,6 +37,8 @@ #import "SDLSystemContext.h" #import "SDLVideoStreamingState.h" +NS_ASSUME_NONNULL_BEGIN + /** * Notifies an application that HMI conditions have changed for the application. This indicates whether the application can speak phrases, display text, perform interactions, receive button presses and events, stream audio, etc. This notification will be sent to the application when there has been a change in any one or several of the indicated states (SDLHMILevel, SDLAudioStreamingState or SDLSystemContext) for the application. @@ -17,10 +48,33 @@ @since SDL 1.0 */ +@interface SDLOnHMIStatus : SDLRPCNotification -NS_ASSUME_NONNULL_BEGIN +/** + * @param hmiLevel - hmiLevel + * @param audioStreamingState - audioStreamingState + * @param systemContext - systemContext + * @return A SDLOnHMIStatus object + */ +- (instancetype)initWithHmiLevel:(SDLHMILevel)hmiLevel audioStreamingState:(SDLAudioStreamingState)audioStreamingState systemContext:(SDLSystemContext)systemContext; -@interface SDLOnHMIStatus : SDLRPCNotification +/** + * @param hmiLevel - hmiLevel + * @param audioStreamingState - audioStreamingState + * @param systemContext - systemContext + * @param videoStreamingState - videoStreamingState + * @param windowID - windowID + * @return A SDLOnHMIStatus object + */ +- (instancetype)initWithHmiLevel:(SDLHMILevel)hmiLevel audioStreamingState:(SDLAudioStreamingState)audioStreamingState systemContext:(SDLSystemContext)systemContext videoStreamingState:(nullable SDLVideoStreamingState)videoStreamingState windowID:(nullable NSNumber *)windowID; + +/// Initialize an SDLOnHMIStatus RPC with initial parameters +/// @param hmiLevel The HMI level +/// @param systemContext The system context +/// @param audioStreamingState The ability for an audio app to be heard +/// @param videoStreamingState The ability for a video straming app to stream +/// @param windowID Which window this status relates to +- (instancetype)initWithHMILevel:(SDLHMILevel)hmiLevel systemContext:(SDLSystemContext)systemContext audioStreamingState:(SDLAudioStreamingState)audioStreamingState videoStreamingState:(nullable SDLVideoStreamingState)videoStreamingState windowID:(nullable NSNumber *)windowID __deprecated_msg("Use initWithHmiLevel:audioStreamingState:systemContext:videoStreamingState:windowID: instead"); /** SDLHMILevel in effect for the application @@ -51,14 +105,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic, nullable) NSNumber *windowID; -/// Initialize an SDLOnHMIStatus RPC with initial parameters -/// @param hmiLevel The HMI level -/// @param systemContext The system context -/// @param audioStreamingState The ability for an audio app to be heard -/// @param videoStreamingState The ability for a video straming app to stream -/// @param windowID Which window this status relates to -- (instancetype)initWithHMILevel:(SDLHMILevel)hmiLevel systemContext:(SDLSystemContext)systemContext audioStreamingState:(SDLAudioStreamingState)audioStreamingState videoStreamingState:(nullable SDLVideoStreamingState)videoStreamingState windowID:(nullable NSNumber *)windowID; - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLOnHMIStatus.m b/SmartDeviceLink/public/SDLOnHMIStatus.m index 09534e9fa4..eaa82e8b18 100644 --- a/SmartDeviceLink/public/SDLOnHMIStatus.m +++ b/SmartDeviceLink/public/SDLOnHMIStatus.m @@ -23,6 +23,27 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithHmiLevel:(SDLHMILevel)hmiLevel audioStreamingState:(SDLAudioStreamingState)audioStreamingState systemContext:(SDLSystemContext)systemContext { + self = [self init]; + if (!self) { + return nil; + } + self.hmiLevel = hmiLevel; + self.audioStreamingState = audioStreamingState; + self.systemContext = systemContext; + return self; +} + +- (instancetype)initWithHmiLevel:(SDLHMILevel)hmiLevel audioStreamingState:(SDLAudioStreamingState)audioStreamingState systemContext:(SDLSystemContext)systemContext videoStreamingState:(nullable SDLVideoStreamingState)videoStreamingState windowID:(nullable NSNumber *)windowID { + self = [self initWithHmiLevel:hmiLevel audioStreamingState:audioStreamingState systemContext:systemContext]; + if (!self) { + return nil; + } + self.videoStreamingState = videoStreamingState; + self.windowID = windowID; + return self; +} + - (instancetype)initWithHMILevel:(SDLHMILevel)hmiLevel systemContext:(SDLSystemContext)systemContext audioStreamingState:(SDLAudioStreamingState)audioStreamingState videoStreamingState:(nullable SDLVideoStreamingState)videoStreamingState windowID:(nullable NSNumber *)windowID { self = [self init]; if (!self) { return nil; } diff --git a/SmartDeviceLink/public/SDLOnHashChange.h b/SmartDeviceLink/public/SDLOnHashChange.h index f2b9cbb458..8a7b3a8fd7 100644 --- a/SmartDeviceLink/public/SDLOnHashChange.h +++ b/SmartDeviceLink/public/SDLOnHashChange.h @@ -1,5 +1,34 @@ -// SDLOnHashChange.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 "SDLRPCNotification.h" @@ -7,10 +36,18 @@ NS_ASSUME_NONNULL_BEGIN /** - Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.). Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data. + * Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.). Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data. + * + * @added in SmartDeviceLink 3.0.0 */ @interface SDLOnHashChange : SDLRPCNotification +/** + * @param hashID - hashID + * @return A SDLOnHashChange object + */ +- (instancetype)initWithHashID:(NSString *)hashID; + /** Calculated hash ID to be referenced during RegisterAppInterface request. */ diff --git a/SmartDeviceLink/public/SDLOnHashChange.m b/SmartDeviceLink/public/SDLOnHashChange.m index f7114a411c..c4744c6f8f 100644 --- a/SmartDeviceLink/public/SDLOnHashChange.m +++ b/SmartDeviceLink/public/SDLOnHashChange.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithHashID:(NSString *)hashID { + self = [self init]; + if (!self) { + return nil; + } + self.hashID = hashID; + return self; +} + - (void)setHashID:(NSString *)hashID { [self.parameters sdl_setObject:hashID forName:SDLRPCParameterNameHashId]; } diff --git a/SmartDeviceLink/public/SDLOnInteriorVehicleData.h b/SmartDeviceLink/public/SDLOnInteriorVehicleData.h index e54ad91bff..39617139f9 100644 --- a/SmartDeviceLink/public/SDLOnInteriorVehicleData.h +++ b/SmartDeviceLink/public/SDLOnInteriorVehicleData.h @@ -1,19 +1,52 @@ -// -// SDLOnInteriorVehicleData.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 "SDLRPCNotification.h" + @class SDLModuleData; NS_ASSUME_NONNULL_BEGIN /** - Notifications when subscribed vehicle data changes. - - See: SDLSubscribeVehicleData + * @added in SmartDeviceLink 4.5.0 */ @interface SDLOnInteriorVehicleData : SDLRPCNotification +/** + * @param moduleData - moduleData + * @return A SDLOnInteriorVehicleData object + */ +- (instancetype)initWithModuleData:(SDLModuleData *)moduleData; + /** The subscribed module data that changed */ diff --git a/SmartDeviceLink/public/SDLOnInteriorVehicleData.m b/SmartDeviceLink/public/SDLOnInteriorVehicleData.m index 58eff55755..dc69536c4c 100644 --- a/SmartDeviceLink/public/SDLOnInteriorVehicleData.m +++ b/SmartDeviceLink/public/SDLOnInteriorVehicleData.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithModuleData:(SDLModuleData *)moduleData { + self = [self init]; + if (!self) { + return nil; + } + self.moduleData = moduleData; + return self; +} + - (void)setModuleData:(SDLModuleData *)moduleData { [self.parameters sdl_setObject:moduleData forName:SDLRPCParameterNameModuleData]; } diff --git a/SmartDeviceLink/public/SDLOnKeyboardInput.h b/SmartDeviceLink/public/SDLOnKeyboardInput.h index 2090fb8a6a..b4066921b5 100644 --- a/SmartDeviceLink/public/SDLOnKeyboardInput.h +++ b/SmartDeviceLink/public/SDLOnKeyboardInput.h @@ -1,5 +1,34 @@ -// SDLOnKeyboardInput.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 "SDLRPCNotification.h" @@ -8,10 +37,25 @@ NS_ASSUME_NONNULL_BEGIN /** - Sent when a keyboard presented by a PerformInteraction has a keyboard input. + * On-screen keyboard event. Can be full string or individual keypresses depending on keyboard mode. + * + * @added in SmartDeviceLink 3.0.0 */ @interface SDLOnKeyboardInput : SDLRPCNotification +/** + * @param event - event + * @return A SDLOnKeyboardInput object + */ +- (instancetype)initWithEvent:(SDLKeyboardEvent)event; + +/** + * @param event - event + * @param data - data + * @return A SDLOnKeyboardInput object + */ +- (instancetype)initWithEvent:(SDLKeyboardEvent)event data:(nullable NSString *)data; + /** The type of keyboard input */ diff --git a/SmartDeviceLink/public/SDLOnKeyboardInput.m b/SmartDeviceLink/public/SDLOnKeyboardInput.m index 57850321a1..4143bdda97 100644 --- a/SmartDeviceLink/public/SDLOnKeyboardInput.m +++ b/SmartDeviceLink/public/SDLOnKeyboardInput.m @@ -20,6 +20,24 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithEvent:(SDLKeyboardEvent)event { + self = [self init]; + if (!self) { + return nil; + } + self.event = event; + return self; +} + +- (instancetype)initWithEvent:(SDLKeyboardEvent)event data:(nullable NSString *)data { + self = [self initWithEvent:event]; + if (!self) { + return nil; + } + self.data = data; + return self; +} + - (void)setEvent:(SDLKeyboardEvent)event { [self.parameters sdl_setObject:event forName:SDLRPCParameterNameEvent]; } diff --git a/SmartDeviceLink/public/SDLOnLanguageChange.h b/SmartDeviceLink/public/SDLOnLanguageChange.h index 103532add6..865587a77c 100644 --- a/SmartDeviceLink/public/SDLOnLanguageChange.h +++ b/SmartDeviceLink/public/SDLOnLanguageChange.h @@ -1,5 +1,34 @@ -// SDLOnLanguageChange.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 "SDLRPCNotification.h" @@ -16,6 +45,13 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLOnLanguageChange : SDLRPCNotification +/** + * @param language - language + * @param hmiDisplayLanguage - hmiDisplayLanguage + * @return A SDLOnLanguageChange object + */ +- (instancetype)initWithLanguage:(SDLLanguage)language hmiDisplayLanguage:(SDLLanguage)hmiDisplayLanguage; + /** Current SDL voice engine (VR+TTS) language */ diff --git a/SmartDeviceLink/public/SDLOnLanguageChange.m b/SmartDeviceLink/public/SDLOnLanguageChange.m index cee3f7965f..525de0844e 100644 --- a/SmartDeviceLink/public/SDLOnLanguageChange.m +++ b/SmartDeviceLink/public/SDLOnLanguageChange.m @@ -21,6 +21,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithLanguage:(SDLLanguage)language hmiDisplayLanguage:(SDLLanguage)hmiDisplayLanguage { + self = [self init]; + if (!self) { + return nil; + } + self.language = language; + self.hmiDisplayLanguage = hmiDisplayLanguage; + return self; +} + - (void)setLanguage:(SDLLanguage)language { [self.parameters sdl_setObject:language forName:SDLRPCParameterNameLanguage]; } diff --git a/SmartDeviceLink/public/SDLOnPermissionsChange.h b/SmartDeviceLink/public/SDLOnPermissionsChange.h index 244bbc08f4..7a5a198af1 100644 --- a/SmartDeviceLink/public/SDLOnPermissionsChange.h +++ b/SmartDeviceLink/public/SDLOnPermissionsChange.h @@ -1,5 +1,34 @@ -// SDLOnPermissionsChange.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 "SDLRPCNotification.h" @@ -15,6 +44,19 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLOnPermissionsChange : SDLRPCNotification +/** + * @param permissionItem - permissionItem + * @return A SDLOnPermissionsChange object + */ +- (instancetype)initWithPermissionItem:(NSArray *)permissionItem; + +/** + * @param permissionItem - permissionItem + * @param requireEncryption - requireEncryption + * @return A SDLOnPermissionsChange object + */ +- (instancetype)initWithPermissionItem:(NSArray *)permissionItem requireEncryption:(nullable NSNumber *)requireEncryption; + /** Describes change in permissions for a given set of RPCs diff --git a/SmartDeviceLink/public/SDLOnPermissionsChange.m b/SmartDeviceLink/public/SDLOnPermissionsChange.m index a067e084c0..a121455c5b 100644 --- a/SmartDeviceLink/public/SDLOnPermissionsChange.m +++ b/SmartDeviceLink/public/SDLOnPermissionsChange.m @@ -21,6 +21,24 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithPermissionItem:(NSArray *)permissionItem { + self = [self init]; + if (!self) { + return nil; + } + self.permissionItem = permissionItem; + return self; +} + +- (instancetype)initWithPermissionItem:(NSArray *)permissionItem requireEncryption:(nullable NSNumber *)requireEncryption { + self = [self initWithPermissionItem:permissionItem]; + if (!self) { + return nil; + } + self.requireEncryption = requireEncryption; + return self; +} + - (void)setPermissionItem:(NSArray *)permissionItem { [self.parameters sdl_setObject:permissionItem forName:SDLRPCParameterNamePermissionItem]; } diff --git a/SmartDeviceLink/public/SDLOnRCStatus.h b/SmartDeviceLink/public/SDLOnRCStatus.h index 9c3d73c7ee..7d2cec8f01 100644 --- a/SmartDeviceLink/public/SDLOnRCStatus.h +++ b/SmartDeviceLink/public/SDLOnRCStatus.h @@ -1,21 +1,63 @@ -// SDLOnRCStatus.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 "SDLRPCNotification.h" @class SDLModuleData; + +NS_ASSUME_NONNULL_BEGIN + /** - * OnRCStatus notifications to all registered mobile applications and the HMI whenever - * (1) SDL allocates a module to an application or - * (2) it de-allocates a module from an application, or - * (3) an application registers with SDL + * Issued by SDL to notify the application about remote control status change on SDL * + * @added in SmartDeviceLink 5.0.0 */ +@interface SDLOnRCStatus : SDLRPCNotification -NS_ASSUME_NONNULL_BEGIN +/** + * @param allocatedModules - allocatedModules + * @param freeModules - freeModules + * @return A SDLOnRCStatus object + */ +- (instancetype)initWithAllocatedModules:(NSArray *)allocatedModules freeModules:(NSArray *)freeModules; -@interface SDLOnRCStatus : SDLRPCNotification +/** + * @param allocatedModules - allocatedModules + * @param freeModules - freeModules + * @param allowed - allowed + * @return A SDLOnRCStatus object + */ +- (instancetype)initWithAllocatedModules:(NSArray *)allocatedModules freeModules:(NSArray *)freeModules allowed:(nullable NSNumber *)allowed; /** * @abstract Contains a list (zero or more) of module types that diff --git a/SmartDeviceLink/public/SDLOnRCStatus.m b/SmartDeviceLink/public/SDLOnRCStatus.m index aa1295f3f6..ba7c832b1f 100644 --- a/SmartDeviceLink/public/SDLOnRCStatus.m +++ b/SmartDeviceLink/public/SDLOnRCStatus.m @@ -21,6 +21,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithAllocatedModules:(NSArray *)allocatedModules freeModules:(NSArray *)freeModules { + self = [self init]; + if (!self) { + return nil; + } + self.allocatedModules = allocatedModules; + self.freeModules = freeModules; + return self; +} + +- (instancetype)initWithAllocatedModules:(NSArray *)allocatedModules freeModules:(NSArray *)freeModules allowed:(nullable NSNumber *)allowed { + self = [self initWithAllocatedModules:allocatedModules freeModules:freeModules]; + if (!self) { + return nil; + } + self.allowed = allowed; + return self; +} + - (nullable NSNumber *)allowed { return [self.parameters sdl_objectForName:SDLRPCParameterNameAllowed ofClass:NSNumber.class error:nil]; } diff --git a/SmartDeviceLink/public/SDLOnSystemCapabilityUpdated.h b/SmartDeviceLink/public/SDLOnSystemCapabilityUpdated.h index 35a7209012..c7fadef372 100644 --- a/SmartDeviceLink/public/SDLOnSystemCapabilityUpdated.h +++ b/SmartDeviceLink/public/SDLOnSystemCapabilityUpdated.h @@ -1,10 +1,34 @@ -// -// SDLOnSystemCapabilityUpdated.h -// SmartDeviceLink -// -// Created by Nicole on 2/6/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 "SDLRPCNotification.h" @@ -13,7 +37,9 @@ NS_ASSUME_NONNULL_BEGIN /** - * A notification to inform the connected device that a specific system capability has changed. + * A notification to inform the connected device that a specific system capability has changed. + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLOnSystemCapabilityUpdated : SDLRPCNotification diff --git a/SmartDeviceLink/public/SDLOnSystemRequest.h b/SmartDeviceLink/public/SDLOnSystemRequest.h index c4a540f955..e562de3e2f 100644 --- a/SmartDeviceLink/public/SDLOnSystemRequest.h +++ b/SmartDeviceLink/public/SDLOnSystemRequest.h @@ -1,5 +1,34 @@ -// SDLOnSystemRequest.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 "SDLRPCNotification.h" @@ -9,10 +38,30 @@ NS_ASSUME_NONNULL_BEGIN /** - An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud Binary data can be included in hybrid part of message for some requests (such as Authentication request responses) + * An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud Binary data can be included in hybrid part of message for some requests (such as Authentication request responses) + * + * @added in SmartDeviceLink 3.0.0 */ @interface SDLOnSystemRequest : SDLRPCNotification +/** + * @param requestType - requestType + * @return A SDLOnSystemRequest object + */ +- (instancetype)initWithRequestType:(SDLRequestType)requestType; + +/** + * @param requestType - requestType + * @param requestSubType - requestSubType + * @param url - url + * @param timeout - timeout + * @param fileType - fileType + * @param offset - offset + * @param length - length + * @return A SDLOnSystemRequest object + */ +- (instancetype)initWithRequestType:(SDLRequestType)requestType requestSubType:(nullable NSString *)requestSubType url:(nullable NSString *)url timeout:(nullable NSNumber *)timeout fileType:(nullable SDLFileType)fileType offset:(nullable NSNumber *)offset length:(nullable NSNumber *)length; + /** The type of system request. */ diff --git a/SmartDeviceLink/public/SDLOnSystemRequest.m b/SmartDeviceLink/public/SDLOnSystemRequest.m index 174726c0d5..7eab775e1a 100644 --- a/SmartDeviceLink/public/SDLOnSystemRequest.m +++ b/SmartDeviceLink/public/SDLOnSystemRequest.m @@ -20,6 +20,29 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithRequestType:(SDLRequestType)requestType { + self = [self init]; + if (!self) { + return nil; + } + self.requestType = requestType; + return self; +} + +- (instancetype)initWithRequestType:(SDLRequestType)requestType requestSubType:(nullable NSString *)requestSubType url:(nullable NSString *)url timeout:(nullable NSNumber *)timeout fileType:(nullable SDLFileType)fileType offset:(nullable NSNumber *)offset length:(nullable NSNumber *)length { + self = [self initWithRequestType:requestType]; + if (!self) { + return nil; + } + self.requestSubType = requestSubType; + self.url = url; + self.timeout = timeout; + self.fileType = fileType; + self.offset = offset; + self.length = length; + return self; +} + - (void)setRequestType:(SDLRequestType)requestType { [self.parameters sdl_setObject:requestType forName:SDLRPCParameterNameRequestType]; } diff --git a/SmartDeviceLink/public/SDLOnTBTClientState.h b/SmartDeviceLink/public/SDLOnTBTClientState.h index 9d5d2d1a8a..374d716206 100644 --- a/SmartDeviceLink/public/SDLOnTBTClientState.h +++ b/SmartDeviceLink/public/SDLOnTBTClientState.h @@ -1,5 +1,34 @@ -// SDLOnTBTClientState.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 "SDLRPCNotification.h" @@ -12,6 +41,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLOnTBTClientState : SDLRPCNotification +/** + * @param state - state + * @return A SDLOnTBTClientState object + */ +- (instancetype)initWithState:(SDLTBTState)state; + /** Current State of TBT client */ diff --git a/SmartDeviceLink/public/SDLOnTBTClientState.m b/SmartDeviceLink/public/SDLOnTBTClientState.m index 4a6695e066..29f34bcf33 100644 --- a/SmartDeviceLink/public/SDLOnTBTClientState.m +++ b/SmartDeviceLink/public/SDLOnTBTClientState.m @@ -20,6 +20,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithState:(SDLTBTState)state { + self = [self init]; + if (!self) { + return nil; + } + self.state = state; + return self; +} + - (void)setState:(SDLTBTState)state { [self.parameters sdl_setObject:state forName:SDLRPCParameterNameState]; } diff --git a/SmartDeviceLink/public/SDLOnTouchEvent.h b/SmartDeviceLink/public/SDLOnTouchEvent.h index 2e0f29953d..5b824a6ef0 100644 --- a/SmartDeviceLink/public/SDLOnTouchEvent.h +++ b/SmartDeviceLink/public/SDLOnTouchEvent.h @@ -1,5 +1,34 @@ -// SDLOnTouchEvent.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 "SDLRPCNotification.h" @@ -10,10 +39,19 @@ NS_ASSUME_NONNULL_BEGIN /** - Notifies about touch events on the screen's prescribed area during video streaming + * Notifies about touch events on the screen's prescribed area + * + * @added in SmartDeviceLink 3.0.0 */ @interface SDLOnTouchEvent : SDLRPCNotification +/** + * @param type - type + * @param event - event + * @return A SDLOnTouchEvent object + */ +- (instancetype)initWithType:(SDLTouchType)type event:(NSArray *)event; + /** The type of touch event. */ diff --git a/SmartDeviceLink/public/SDLOnTouchEvent.m b/SmartDeviceLink/public/SDLOnTouchEvent.m index 1995f7d860..f0276a5123 100644 --- a/SmartDeviceLink/public/SDLOnTouchEvent.m +++ b/SmartDeviceLink/public/SDLOnTouchEvent.m @@ -21,6 +21,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithType:(SDLTouchType)type event:(NSArray *)event { + self = [self init]; + if (!self) { + return nil; + } + self.type = type; + self.event = event; + return self; +} + - (void)setType:(SDLTouchType)type { [self.parameters sdl_setObject:type forName:SDLRPCParameterNameType]; } diff --git a/SmartDeviceLink/public/SDLOnVehicleData.h b/SmartDeviceLink/public/SDLOnVehicleData.h index 66108cf476..04df10324f 100644 --- a/SmartDeviceLink/public/SDLOnVehicleData.h +++ b/SmartDeviceLink/public/SDLOnVehicleData.h @@ -1,5 +1,34 @@ -// SDLOnVehicleData.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 "SDLRPCNotification.h" @@ -26,17 +55,51 @@ @class SDLTireStatus; @class SDLWindowStatus; +NS_ASSUME_NONNULL_BEGIN /** Callback for the periodic and non periodic vehicle data read function. Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLOnVehicleData : SDLRPCNotification +/** + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param vin - vin + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModeStatus - clusterModeStatus + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLOnVehicleData object + */ +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering; + /** * Convenience init for setting all possible values on vehicle data items. * @@ -73,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLOnVehicleData object */ -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSArray *)windowStatus; +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSArray *)windowStatus __deprecated_msg("Use another initializer instead"); /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLOnVehicleData.m b/SmartDeviceLink/public/SDLOnVehicleData.m index 9e8ebc13b7..00d2b3e6ec 100644 --- a/SmartDeviceLink/public/SDLOnVehicleData.m +++ b/SmartDeviceLink/public/SDLOnVehicleData.m @@ -37,6 +37,45 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.vin = vin; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModeStatus = clusterModeStatus; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSArray *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSArray *)windowStatus { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLOnWayPointChange.h b/SmartDeviceLink/public/SDLOnWayPointChange.h index 2fe3488ad4..bdd19b78bc 100644 --- a/SmartDeviceLink/public/SDLOnWayPointChange.h +++ b/SmartDeviceLink/public/SDLOnWayPointChange.h @@ -1,5 +1,34 @@ -// SDLOnWayPointChange.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 "SDLRPCNotification.h" @@ -8,16 +37,30 @@ NS_ASSUME_NONNULL_BEGIN /** - Notification which provides the entire LocationDetails when there is a change to any waypoints or destination. + * Notification which provides the entire LocationDetails when there is a change to any waypoints or destination. + * + * @added in SmartDeviceLink 4.1.0 */ @interface SDLOnWayPointChange : SDLRPCNotification +/** + * @param wayPoints - wayPoints + * @return A SDLOnWayPointChange object + */ +- (instancetype)initWithWayPoints:(NSArray *)wayPoints; + +/** + * See LocationDetails + * {"array_min_size": 1, "array_max_size": 10} + */ +@property (strong, nonatomic) NSArray *wayPoints; + /** Location address for display purposes only Required, Array of Strings, Array size 1 - 10 */ -@property (copy, nonatomic) NSArray *waypoints; +@property (copy, nonatomic) NSArray *waypoints __deprecated_msg("Use wayPoints instead"); @end diff --git a/SmartDeviceLink/public/SDLOnWayPointChange.m b/SmartDeviceLink/public/SDLOnWayPointChange.m index b90033dcf8..29ad75c02b 100644 --- a/SmartDeviceLink/public/SDLOnWayPointChange.m +++ b/SmartDeviceLink/public/SDLOnWayPointChange.m @@ -21,6 +21,24 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithWayPoints:(NSArray *)wayPoints { + self = [self init]; + if (!self) { + return nil; + } + self.wayPoints = wayPoints; + return self; +} + +- (void)setWayPoints:(NSArray *)wayPoints { + [self.parameters sdl_setObject:wayPoints forName:SDLRPCParameterNameWayPoints]; +} + +- (NSArray *)wayPoints { + NSError *error = nil; + return [self.parameters sdl_objectsForName:SDLRPCParameterNameWayPoints ofClass:SDLLocationDetails.class error:&error]; +} + - (void)setWaypoints:(NSArray *)waypoints { [self.parameters sdl_setObject:waypoints forName:SDLRPCParameterNameWayPoints]; } diff --git a/SmartDeviceLink/public/SDLPRNDL.h b/SmartDeviceLink/public/SDLPRNDL.h index 904a0f2182..44bde57bf9 100644 --- a/SmartDeviceLink/public/SDLPRNDL.h +++ b/SmartDeviceLink/public/SDLPRNDL.h @@ -1,5 +1,34 @@ -// SDLPRNDL.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLParameterPermissions.h b/SmartDeviceLink/public/SDLParameterPermissions.h index 48d8b433dd..7a8dc76e7c 100644 --- a/SmartDeviceLink/public/SDLParameterPermissions.h +++ b/SmartDeviceLink/public/SDLParameterPermissions.h @@ -1,5 +1,34 @@ -// SDLParameterPermissions.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" @@ -13,6 +42,13 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLParameterPermissions : SDLRPCStruct +/** + * @param allowed - allowed + * @param userDisallowed - userDisallowed + * @return A SDLParameterPermissions object + */ +- (instancetype)initWithAllowed:(NSArray *)allowed userDisallowed:(NSArray *)userDisallowed; + /** * A set of all parameters that are permitted for this given RPC. * diff --git a/SmartDeviceLink/public/SDLParameterPermissions.m b/SmartDeviceLink/public/SDLParameterPermissions.m index 5b83f66bf4..21512184c2 100644 --- a/SmartDeviceLink/public/SDLParameterPermissions.m +++ b/SmartDeviceLink/public/SDLParameterPermissions.m @@ -11,6 +11,16 @@ @implementation SDLParameterPermissions +- (instancetype)initWithAllowed:(NSArray *)allowed userDisallowed:(NSArray *)userDisallowed { + self = [self init]; + if (!self) { + return nil; + } + self.allowed = allowed; + self.userDisallowed = userDisallowed; + return self; +} + - (void)setAllowed:(NSArray *)allowed { [self.store sdl_setObject:allowed forName:SDLRPCParameterNameAllowed]; } diff --git a/SmartDeviceLink/public/SDLPerformAppServiceInteraction.h b/SmartDeviceLink/public/SDLPerformAppServiceInteraction.h index f85c66387c..210dbe1720 100644 --- a/SmartDeviceLink/public/SDLPerformAppServiceInteraction.h +++ b/SmartDeviceLink/public/SDLPerformAppServiceInteraction.h @@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN * 2. App service providers will correctly respond to the requests * 3. The requested app service provider will become the active service of that type * 4. The `serviceUri` will be a correctly formatted URI from the app service consumer + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLPerformAppServiceInteraction : SDLRPCRequest @@ -35,6 +37,15 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithServiceUri:(NSString *)serviceUri serviceID:(NSString *)serviceID originApp:(NSString *)originApp; +/** + * @param serviceUri - serviceUri + * @param serviceID - serviceID + * @param originApp - originApp + * @param requestServiceActive - requestServiceActive + * @return A SDLPerformAppServiceInteraction object + */ +- (instancetype)initWithServiceUriParam:(NSString *)serviceUri serviceID:(NSString *)serviceID originApp:(NSString *)originApp requestServiceActive:(nullable NSNumber *)requestServiceActive __deprecated_msg("Eventually an initializer without param will be added"); + /** * Convenience init for all parameters. * @@ -44,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN * @param requestServiceActive Whether or not the service is active * @return A SDLPerformAppServiceInteraction object */ -- (instancetype)initWithServiceUri:(NSString *)serviceUri serviceID:(NSString *)serviceID originApp:(NSString *)originApp requestServiceActive:(BOOL)requestServiceActive; +- (instancetype)initWithServiceUri:(NSString *)serviceUri serviceID:(NSString *)serviceID originApp:(NSString *)originApp requestServiceActive:(BOOL)requestServiceActive __deprecated_msg("Eventually an initializer with different parameter types will be added"); /** * Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this URI is correct. diff --git a/SmartDeviceLink/public/SDLPerformAppServiceInteraction.m b/SmartDeviceLink/public/SDLPerformAppServiceInteraction.m index f401f7f286..ad9ddad196 100644 --- a/SmartDeviceLink/public/SDLPerformAppServiceInteraction.m +++ b/SmartDeviceLink/public/SDLPerformAppServiceInteraction.m @@ -39,6 +39,15 @@ - (instancetype)initWithServiceUri:(NSString *)serviceUri serviceID:(NSString *) return self; } +- (instancetype)initWithServiceUriParam:(NSString *)serviceUri serviceID:(NSString *)serviceID originApp:(NSString *)originApp requestServiceActive:(nullable NSNumber *)requestServiceActive { + self = [self initWithServiceUri:serviceUri serviceID:serviceID originApp:originApp]; + if (!self) { + return nil; + } + self.requestServiceActive = requestServiceActive; + return self; +} + - (instancetype)initWithServiceUri:(NSString *)serviceUri serviceID:(NSString *)serviceID originApp:(NSString *)originApp requestServiceActive:(BOOL)requestServiceActive { self = [self initWithServiceUri:serviceUri serviceID:serviceID originApp:originApp]; if (!self) { diff --git a/SmartDeviceLink/public/SDLPerformAppServiceInteractionResponse.h b/SmartDeviceLink/public/SDLPerformAppServiceInteractionResponse.h index 3b9c6efdd7..f0312d877e 100644 --- a/SmartDeviceLink/public/SDLPerformAppServiceInteractionResponse.h +++ b/SmartDeviceLink/public/SDLPerformAppServiceInteractionResponse.h @@ -1,10 +1,34 @@ -// -// SDLPerformAppServiceInteractionResponse.h -// SmartDeviceLink -// -// Created by Nicole on 2/6/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 "SDLRPCResponse.h" diff --git a/SmartDeviceLink/public/SDLPerformAudioPassThru.h b/SmartDeviceLink/public/SDLPerformAudioPassThru.h index 26ca9a21ab..7cc6a58d3a 100644 --- a/SmartDeviceLink/public/SDLPerformAudioPassThru.h +++ b/SmartDeviceLink/public/SDLPerformAudioPassThru.h @@ -1,5 +1,34 @@ -// SDLPerformAudioPassThru.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" @@ -10,6 +39,8 @@ @class SDLTTSChunk; +NS_ASSUME_NONNULL_BEGIN + /** * This will open an audio pass thru session. By doing so the app can receive * audio data through the vehicle microphone @@ -22,10 +53,29 @@ *

Since SmartDeviceLink 2.0

*

See SDLEndAudioPassThru

*/ +@interface SDLPerformAudioPassThru : SDLRPCRequest -NS_ASSUME_NONNULL_BEGIN +/** + * @param samplingRate - samplingRate + * @param maxDuration - @(maxDuration) + * @param bitsPerSample - bitsPerSample + * @param audioType - audioType + * @return A SDLPerformAudioPassThru object + */ +- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate maxDuration:(UInt32)maxDuration bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType; -@interface SDLPerformAudioPassThru : SDLRPCRequest +/** + * @param samplingRate - samplingRate + * @param maxDuration - @(maxDuration) + * @param bitsPerSample - bitsPerSample + * @param audioType - audioType + * @param initialPrompt - initialPrompt + * @param audioPassThruDisplayText1 - audioPassThruDisplayText1 + * @param audioPassThruDisplayText2 - audioPassThruDisplayText2 + * @param muteAudio - muteAudio + * @return A SDLPerformAudioPassThru object + */ +- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate maxDuration:(UInt32)maxDuration bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType initialPrompt:(nullable NSArray *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 muteAudio:(nullable NSNumber *)muteAudio; /// Convenience init to perform an audio pass thru /// @@ -33,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param bitsPerSample The quality the audio is recorded - 8 bit or 16 bit /// @param audioType An audioType /// @param maxDuration The maximum duration of audio recording in milliseconds -- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration; +- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration __deprecated_msg("Use initWithSamplingRate:maxDuration:bitsPerSample:audioType: instead"); /// Convenience init to perform an audio pass thru /// @@ -45,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param audioType An audioType /// @param maxDuration The maximum duration of audio recording in milliseconds /// @param muteAudio A Boolean value representing if the current audio source should be muted during the APT session -- (instancetype)initWithInitialPrompt:(nullable NSString *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio; +- (instancetype)initWithInitialPrompt:(nullable NSString *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio __deprecated_msg("Use initWithSamplingRate:maxDuration:bitsPerSample:audioType: instead"); /// Convenience init to perform an audio pass thru /// @@ -54,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param audioType An audioType /// @param maxDuration The maximum duration of audio recording in milliseconds /// @param audioDataHandler A handler that will be called whenever an onAudioPassThru notification is received. -- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration audioDataHandler:(nullable SDLAudioPassThruHandler)audioDataHandler; +- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration audioDataHandler:(nullable SDLAudioPassThruHandler)audioDataHandler __deprecated_msg("Use initWithSamplingRate:maxDuration:bitsPerSample:audioType: instead"); /// Convenience init for a perform audio pass thru /// @@ -67,7 +117,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param maxDuration The maximum duration of audio recording in milliseconds /// @param muteAudio A Boolean value representing if the current audio source should be muted during the APT session /// @param audioDataHandler A handler that will be called whenever an onAudioPassThru notification is received. -- (instancetype)initWithInitialPrompt:(nullable NSString *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio audioDataHandler:(nullable SDLAudioPassThruHandler)audioDataHandler; +- (instancetype)initWithInitialPrompt:(nullable NSString *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio audioDataHandler:(nullable SDLAudioPassThruHandler)audioDataHandler __deprecated_msg("Use initWithSamplingRate:maxDuration:bitsPerSample:audioType: instead"); /** * initial prompt which will be spoken before opening the audio pass diff --git a/SmartDeviceLink/public/SDLPerformAudioPassThru.m b/SmartDeviceLink/public/SDLPerformAudioPassThru.m index 6bcea8fc7e..801c139e29 100644 --- a/SmartDeviceLink/public/SDLPerformAudioPassThru.m +++ b/SmartDeviceLink/public/SDLPerformAudioPassThru.m @@ -22,6 +22,30 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate maxDuration:(UInt32)maxDuration bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType { + self = [self init]; + if (!self) { + return nil; + } + self.samplingRate = samplingRate; + self.maxDuration = @(maxDuration); + self.bitsPerSample = bitsPerSample; + self.audioType = audioType; + return self; +} + +- (instancetype)initWithSamplingRate:(SDLSamplingRate)samplingRate maxDuration:(UInt32)maxDuration bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType initialPrompt:(nullable NSArray *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 muteAudio:(nullable NSNumber *)muteAudio { + self = [self initWithSamplingRate:samplingRate maxDuration:maxDuration bitsPerSample:bitsPerSample audioType:audioType]; + if (!self) { + return nil; + } + self.initialPrompt = initialPrompt; + self.audioPassThruDisplayText1 = audioPassThruDisplayText1; + self.audioPassThruDisplayText2 = audioPassThruDisplayText2; + self.muteAudio = muteAudio; + return self; +} + - (instancetype)initWithInitialPrompt:(nullable NSString *)initialPrompt audioPassThruDisplayText1:(nullable NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio { return [self initWithInitialPrompt:initialPrompt audioPassThruDisplayText1:audioPassThruDisplayText1 audioPassThruDisplayText2:audioPassThruDisplayText2 samplingRate:samplingRate bitsPerSample:bitsPerSample audioType:audioType maxDuration:maxDuration muteAudio:muteAudio audioDataHandler:nil]; } diff --git a/SmartDeviceLink/public/SDLPerformAudioPassThruResponse.h b/SmartDeviceLink/public/SDLPerformAudioPassThruResponse.h index 7f7b211762..24102a6469 100644 --- a/SmartDeviceLink/public/SDLPerformAudioPassThruResponse.h +++ b/SmartDeviceLink/public/SDLPerformAudioPassThruResponse.h @@ -1,17 +1,45 @@ -// SDLPerformAudioPassThruResponse.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 SDLPerformAudioPassThru - + Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLPerformAudioPassThruResponse : SDLRPCResponse @end diff --git a/SmartDeviceLink/public/SDLPerformInteraction.h b/SmartDeviceLink/public/SDLPerformInteraction.h index c1d674b5b6..8255536a76 100644 --- a/SmartDeviceLink/public/SDLPerformInteraction.h +++ b/SmartDeviceLink/public/SDLPerformInteraction.h @@ -1,5 +1,34 @@ -// SDLPerformInteraction.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" @@ -30,6 +59,29 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLPerformInteraction : SDLRPCRequest +/** + * @param initialText - initialText + * @param interactionMode - interactionMode + * @param interactionChoiceSetIDList - interactionChoiceSetIDList + * @return A SDLPerformInteraction object + */ +- (instancetype)initWithInitialText:(NSString *)initialText interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList; + +/** + * @param initialText - initialText + * @param interactionMode - interactionMode + * @param interactionChoiceSetIDList - interactionChoiceSetIDList + * @param initialPrompt - initialPrompt + * @param helpPrompt - helpPrompt + * @param timeoutPrompt - timeoutPrompt + * @param timeout - timeout + * @param vrHelp - vrHelp + * @param interactionLayout - interactionLayout + * @param cancelID - cancelID + * @return A SDLPerformInteraction object + */ +- (instancetype)initWithInitialText:(NSString *)initialText interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList initialPrompt:(nullable NSArray *)initialPrompt helpPrompt:(nullable NSArray *)helpPrompt timeoutPrompt:(nullable NSArray *)timeoutPrompt timeout:(nullable NSNumber *)timeout vrHelp:(nullable NSArray *)vrHelp interactionLayout:(nullable SDLLayoutMode)interactionLayout cancelID:(nullable NSNumber *)cancelID; + /** Convenience init for creating a basic display or voice-recognition menu. @@ -39,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN @param cancelID An ID for this specific perform interaction to allow cancellation through the `CancelInteraction` RPC @return An SDLPerformInteraction object */ -- (instancetype)initWithInitialText:(NSString *)initialText interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList cancelID:(UInt32)cancelID; +- (instancetype)initWithInitialText:(NSString *)initialText interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList cancelID:(UInt32)cancelID __deprecated_msg("Use initWithInitialText:interactionMode:interactionChoiceSetIDList: instead"); /** Convenience init for setting all parameters of a display or voice-recognition menu. @@ -56,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN @param cancelID An ID for this specific perform interaction to allow cancellation through the `CancelInteraction` RPC. @return An SDLPerformInteraction object */ -- (instancetype)initWithInitialText:(NSString *)initialText initialPrompt:(nullable NSArray *)initialPrompt interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList helpPrompt:(nullable NSArray *)helpPrompt timeoutPrompt:(nullable NSArray *)timeoutPrompt timeout:(UInt16)timeout vrHelp:(nullable NSArray *)vrHelp interactionLayout:(nullable SDLLayoutMode)interactionLayout cancelID:(UInt32)cancelID; +- (instancetype)initWithInitialText:(NSString *)initialText initialPrompt:(nullable NSArray *)initialPrompt interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList helpPrompt:(nullable NSArray *)helpPrompt timeoutPrompt:(nullable NSArray *)timeoutPrompt timeout:(UInt16)timeout vrHelp:(nullable NSArray *)vrHelp interactionLayout:(nullable SDLLayoutMode)interactionLayout cancelID:(UInt32)cancelID __deprecated_msg("Use initWithInitialText:interactionMode:interactionChoiceSetIDList: instead"); /** Text to be displayed first. diff --git a/SmartDeviceLink/public/SDLPerformInteraction.m b/SmartDeviceLink/public/SDLPerformInteraction.m index e766211973..84a7f3e03d 100644 --- a/SmartDeviceLink/public/SDLPerformInteraction.m +++ b/SmartDeviceLink/public/SDLPerformInteraction.m @@ -23,6 +23,32 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithInitialText:(NSString *)initialText interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList { + self = [self init]; + if (!self) { + return nil; + } + self.initialText = initialText; + self.interactionMode = interactionMode; + self.interactionChoiceSetIDList = interactionChoiceSetIDList; + return self; +} + +- (instancetype)initWithInitialText:(NSString *)initialText interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList initialPrompt:(nullable NSArray *)initialPrompt helpPrompt:(nullable NSArray *)helpPrompt timeoutPrompt:(nullable NSArray *)timeoutPrompt timeout:(nullable NSNumber *)timeout vrHelp:(nullable NSArray *)vrHelp interactionLayout:(nullable SDLLayoutMode)interactionLayout cancelID:(nullable NSNumber *)cancelID { + self = [self initWithInitialText:initialText interactionMode:interactionMode interactionChoiceSetIDList:interactionChoiceSetIDList]; + if (!self) { + return nil; + } + self.initialPrompt = initialPrompt; + self.helpPrompt = helpPrompt; + self.timeoutPrompt = timeoutPrompt; + self.timeout = timeout; + self.vrHelp = vrHelp; + self.interactionLayout = interactionLayout; + self.cancelID = cancelID; + return self; +} + - (instancetype)initWithInitialDisplayText:(NSString *)initialText initialPrompt:(nullable NSArray *)initialPrompt interactionMode:(SDLInteractionMode)interactionMode interactionChoiceSetIDList:(NSArray *> *)interactionChoiceSetIDList helpPrompt:(nullable NSArray *)helpPrompt timeoutPrompt:(nullable NSArray *)timeoutPrompt timeout:(nullable NSNumber *)timeout vrHelp:(nullable NSArray *)vrHelp interactionLayout:(nullable SDLLayoutMode)interactionLayout cancelID:(nullable NSNumber *)cancelID { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLPerformInteractionResponse.h b/SmartDeviceLink/public/SDLPerformInteractionResponse.h index 74b89d5c46..fec598f1a5 100644 --- a/SmartDeviceLink/public/SDLPerformInteractionResponse.h +++ b/SmartDeviceLink/public/SDLPerformInteractionResponse.h @@ -1,21 +1,57 @@ -// SDLPerformInteractionResponse.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" #import "SDLTriggerSource.h" +NS_ASSUME_NONNULL_BEGIN + /** PerformInteraction Response is sent, when SDLPerformInteraction has been called - + @since SDL 1.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLPerformInteractionResponse : SDLRPCResponse +/** + * @param choiceID - choiceID + * @param manualTextEntry - manualTextEntry + * @param triggerSource - triggerSource + * @return A SDLPerformInteractionResponse object + */ +- (instancetype)initWithChoiceID:(nullable NSNumber *)choiceID manualTextEntry:(nullable NSString *)manualTextEntry triggerSource:(nullable SDLTriggerSource)triggerSource; + /** ID of the choice that was selected in response to PerformInteraction. Only is valid if general result is "success:true". diff --git a/SmartDeviceLink/public/SDLPerformInteractionResponse.m b/SmartDeviceLink/public/SDLPerformInteractionResponse.m index fc97230732..95f8b65426 100644 --- a/SmartDeviceLink/public/SDLPerformInteractionResponse.m +++ b/SmartDeviceLink/public/SDLPerformInteractionResponse.m @@ -21,6 +21,17 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithChoiceID:(nullable NSNumber *)choiceID manualTextEntry:(nullable NSString *)manualTextEntry triggerSource:(nullable SDLTriggerSource)triggerSource { + self = [self init]; + if (!self) { + return nil; + } + self.choiceID = choiceID; + self.manualTextEntry = manualTextEntry; + self.triggerSource = triggerSource; + return self; +} + - (void)setChoiceID:(nullable NSNumber *)choiceID { [self.parameters sdl_setObject:choiceID forName:SDLRPCParameterNameChoiceId]; } diff --git a/SmartDeviceLink/public/SDLPermissionItem.h b/SmartDeviceLink/public/SDLPermissionItem.h index 208ba6086f..5113f25d2e 100644 --- a/SmartDeviceLink/public/SDLPermissionItem.h +++ b/SmartDeviceLink/public/SDLPermissionItem.h @@ -1,5 +1,34 @@ -// SDLPermissionItem.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" @@ -13,6 +42,23 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 2.0 @interface SDLPermissionItem : SDLRPCStruct +/** + * @param rpcName - rpcName + * @param hmiPermissions - hmiPermissions + * @param parameterPermissions - parameterPermissions + * @return A SDLPermissionItem object + */ +- (instancetype)initWithRpcName:(NSString *)rpcName hmiPermissions:(SDLHMIPermissions *)hmiPermissions parameterPermissions:(SDLParameterPermissions *)parameterPermissions; + +/** + * @param rpcName - rpcName + * @param hmiPermissions - hmiPermissions + * @param parameterPermissions - parameterPermissions + * @param requireEncryption - requireEncryption + * @return A SDLPermissionItem object + */ +- (instancetype)initWithRpcName:(NSString *)rpcName hmiPermissions:(SDLHMIPermissions *)hmiPermissions parameterPermissions:(SDLParameterPermissions *)parameterPermissions requireEncryption:(nullable NSNumber *)requireEncryption; + /** Name of the individual RPC in the policy table. diff --git a/SmartDeviceLink/public/SDLPermissionItem.m b/SmartDeviceLink/public/SDLPermissionItem.m index b4c749b59f..4e4687c306 100644 --- a/SmartDeviceLink/public/SDLPermissionItem.m +++ b/SmartDeviceLink/public/SDLPermissionItem.m @@ -12,6 +12,26 @@ @implementation SDLPermissionItem +- (instancetype)initWithRpcName:(NSString *)rpcName hmiPermissions:(SDLHMIPermissions *)hmiPermissions parameterPermissions:(SDLParameterPermissions *)parameterPermissions { + self = [self init]; + if (!self) { + return nil; + } + self.rpcName = rpcName; + self.hmiPermissions = hmiPermissions; + self.parameterPermissions = parameterPermissions; + return self; +} + +- (instancetype)initWithRpcName:(NSString *)rpcName hmiPermissions:(SDLHMIPermissions *)hmiPermissions parameterPermissions:(SDLParameterPermissions *)parameterPermissions requireEncryption:(nullable NSNumber *)requireEncryption { + self = [self initWithRpcName:rpcName hmiPermissions:hmiPermissions parameterPermissions:parameterPermissions]; + if (!self) { + return nil; + } + self.requireEncryption = requireEncryption; + return self; +} + - (void)setRpcName:(NSString *)rpcName { [self.store sdl_setObject:rpcName forName:SDLRPCParameterNameRPCName]; } diff --git a/SmartDeviceLink/public/SDLPermissionStatus.h b/SmartDeviceLink/public/SDLPermissionStatus.h index 33f1534d65..d04f4c4578 100644 --- a/SmartDeviceLink/public/SDLPermissionStatus.h +++ b/SmartDeviceLink/public/SDLPermissionStatus.h @@ -1,5 +1,34 @@ -// SDLPermissionStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPhoneCapability.h b/SmartDeviceLink/public/SDLPhoneCapability.h index 5b9707e350..ae52df4095 100644 --- a/SmartDeviceLink/public/SDLPhoneCapability.h +++ b/SmartDeviceLink/public/SDLPhoneCapability.h @@ -1,10 +1,34 @@ -// -// SDLPhoneCapability.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/11/17. -// Copyright © 2017 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 "SDLRPCStruct.h" @@ -15,18 +39,24 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLPhoneCapability : SDLRPCStruct +/** + * @param dialNumberEnabled - dialNumberEnabled + * @return A SDLPhoneCapability object + */ +- (instancetype)initWithDialNumberEnabled:(nullable NSNumber *)dialNumberEnabled; + /// Convenience init for defining the phone capability /// /// @param dialNumberEnabled Whether or not the DialNumber RPC is enabled. /// @return An SDLPhoneCapability object -- (instancetype)initWithDialNumber:(BOOL)dialNumberEnabled; +- (instancetype)initWithDialNumber:(BOOL)dialNumberEnabled __deprecated_msg("Use initWithDialNumberEnabled: instead"); /** Whether or not the DialNumber RPC is enabled. Boolean, optional */ -@property (nullable, strong, nonatomic) NSNumber *dialNumberEnabled; +@property (nullable, strong, nonatomic) NSNumber *dialNumberEnabled; @end diff --git a/SmartDeviceLink/public/SDLPhoneCapability.m b/SmartDeviceLink/public/SDLPhoneCapability.m index 514b8e2168..a1c1759184 100644 --- a/SmartDeviceLink/public/SDLPhoneCapability.m +++ b/SmartDeviceLink/public/SDLPhoneCapability.m @@ -15,6 +15,15 @@ @implementation SDLPhoneCapability +- (instancetype)initWithDialNumberEnabled:(nullable NSNumber *)dialNumberEnabled { + self = [self init]; + if (!self) { + return nil; + } + self.dialNumberEnabled = dialNumberEnabled; + return self; +} + - (instancetype)initWithDialNumber:(BOOL)dialNumberEnabled { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLPowerModeQualificationStatus.h b/SmartDeviceLink/public/SDLPowerModeQualificationStatus.h index 7f50024167..99cfda4513 100644 --- a/SmartDeviceLink/public/SDLPowerModeQualificationStatus.h +++ b/SmartDeviceLink/public/SDLPowerModeQualificationStatus.h @@ -1,5 +1,34 @@ -// SDLPowerModeQualificationStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPowerModeStatus.h b/SmartDeviceLink/public/SDLPowerModeStatus.h index cbb23dff5b..4e2d64a4a4 100644 --- a/SmartDeviceLink/public/SDLPowerModeStatus.h +++ b/SmartDeviceLink/public/SDLPowerModeStatus.h @@ -1,5 +1,34 @@ -// SDLPowerModeStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPredefinedLayout.h b/SmartDeviceLink/public/SDLPredefinedLayout.h index 034bdcbccc..9cbf685cdb 100644 --- a/SmartDeviceLink/public/SDLPredefinedLayout.h +++ b/SmartDeviceLink/public/SDLPredefinedLayout.h @@ -1,5 +1,34 @@ -// SDLPredefinedLayout.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPredefinedWindows.h b/SmartDeviceLink/public/SDLPredefinedWindows.h index d488673f8e..76f1f1a9d3 100644 --- a/SmartDeviceLink/public/SDLPredefinedWindows.h +++ b/SmartDeviceLink/public/SDLPredefinedWindows.h @@ -1,6 +1,34 @@ -// -// SDLPredefinedWindows.h -// SmartDeviceLink +/* + * 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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPrerecordedSpeech.h b/SmartDeviceLink/public/SDLPrerecordedSpeech.h index 32612ccccf..e45069ea20 100644 --- a/SmartDeviceLink/public/SDLPrerecordedSpeech.h +++ b/SmartDeviceLink/public/SDLPrerecordedSpeech.h @@ -1,5 +1,34 @@ -// SDLPrerecordedSpeech.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPresetBankCapabilities.h b/SmartDeviceLink/public/SDLPresetBankCapabilities.h index a737616be4..b46cdf1de5 100644 --- a/SmartDeviceLink/public/SDLPresetBankCapabilities.h +++ b/SmartDeviceLink/public/SDLPresetBankCapabilities.h @@ -1,5 +1,34 @@ -// SDLPresetBankCapabilities.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" @@ -13,6 +42,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLPresetBankCapabilities : SDLRPCStruct +/** + * @param onScreenPresetsAvailable - @(onScreenPresetsAvailable) + * @return A SDLPresetBankCapabilities object + */ +- (instancetype)initWithOnScreenPresetsAvailable:(BOOL)onScreenPresetsAvailable; + /** * If Onscreen custom presets are available. * diff --git a/SmartDeviceLink/public/SDLPresetBankCapabilities.m b/SmartDeviceLink/public/SDLPresetBankCapabilities.m index 218a462856..afd8d9f89b 100644 --- a/SmartDeviceLink/public/SDLPresetBankCapabilities.m +++ b/SmartDeviceLink/public/SDLPresetBankCapabilities.m @@ -11,6 +11,15 @@ @implementation SDLPresetBankCapabilities +- (instancetype)initWithOnScreenPresetsAvailable:(BOOL)onScreenPresetsAvailable { + self = [self init]; + if (!self) { + return nil; + } + self.onScreenPresetsAvailable = @(onScreenPresetsAvailable); + return self; +} + - (void)setOnScreenPresetsAvailable:(NSNumber *)onScreenPresetsAvailable { [self.store sdl_setObject:onScreenPresetsAvailable forName:SDLRPCParameterNameOnScreenPresetsAvailable]; } diff --git a/SmartDeviceLink/public/SDLPrimaryAudioSource.h b/SmartDeviceLink/public/SDLPrimaryAudioSource.h index c61b0dab95..dc3c69bcff 100644 --- a/SmartDeviceLink/public/SDLPrimaryAudioSource.h +++ b/SmartDeviceLink/public/SDLPrimaryAudioSource.h @@ -1,5 +1,34 @@ -// SDLPrimaryAudioSource.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLPublishAppService.h b/SmartDeviceLink/public/SDLPublishAppService.h index d8a07c77d2..2ebcd7c7ce 100644 --- a/SmartDeviceLink/public/SDLPublishAppService.h +++ b/SmartDeviceLink/public/SDLPublishAppService.h @@ -1,10 +1,34 @@ -// -// SDLPublishAppService.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" @@ -14,8 +38,9 @@ NS_ASSUME_NONNULL_BEGIN /** - * Registers a service offered by this app on the module. - * Subsequent calls with the same service type will update the manifest for that service. + * Registers a service offered by this app on the module. Subsequent calls with the same service type will update the manifest for that service. + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLPublishAppService : SDLRPCRequest diff --git a/SmartDeviceLink/public/SDLPublishAppServiceResponse.h b/SmartDeviceLink/public/SDLPublishAppServiceResponse.h index 70f398e399..8b870a497c 100644 --- a/SmartDeviceLink/public/SDLPublishAppServiceResponse.h +++ b/SmartDeviceLink/public/SDLPublishAppServiceResponse.h @@ -1,10 +1,34 @@ -// -// SDLPublishAppServiceResponse.h -// SmartDeviceLink -// -// Created by Nicole on 2/5/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 "SDLRPCResponse.h" @@ -13,7 +37,9 @@ NS_ASSUME_NONNULL_BEGIN /** - * Response to the request to register a service offered by this app on the module. + * Response to the request to register a service offered by this app on the module + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLPublishAppServiceResponse : SDLRPCResponse diff --git a/SmartDeviceLink/public/SDLPutFile.h b/SmartDeviceLink/public/SDLPutFile.h index 40a4cc5542..2a861435a2 100644 --- a/SmartDeviceLink/public/SDLPutFile.h +++ b/SmartDeviceLink/public/SDLPutFile.h @@ -1,27 +1,67 @@ -// SDLPutFile.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 "SDLFileType.h" +NS_ASSUME_NONNULL_BEGIN + /** * Used to push a binary data onto the SDL module from a mobile device, such as icons and album art. * * Since SmartDeviceLink 2.0 * @see SDLDeleteFile, SDLListFiles */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLPutFile : SDLRPCRequest /** - * Init - * - * @return A SDLPutFile object + * @param sdlFileName - sdlFileName + * @param fileType - fileType + * @return A SDLPutFile object + */ +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName fileType:(SDLFileType)fileType; + +/** + * @param sdlFileName - sdlFileName + * @param fileType - fileType + * @param persistentFile - persistentFile + * @param systemFile - systemFile + * @param offset - offset + * @param length - length + * @param crc - crc + * @return A SDLPutFile object */ -- (instancetype)init; +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName fileType:(SDLFileType)fileType persistentFile:(nullable NSNumber *)persistentFile systemFile:(nullable NSNumber *)systemFile offset:(nullable NSNumber *)offset length:(nullable NSNumber *)length crc:(nullable NSNumber *)crc; /** * Convenience init for creating a putfile with a name and file format. @@ -30,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN * @param fileType The file's format * @return A SDLPutFile object */ -- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType; +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType __deprecated_msg("Use initWithSdlFileName:fileType: instead"); /** * Convenience init for creating a putfile with a name, file format, and persistance. @@ -40,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN * @param persistentFile Whether or not the image should persist between ignition cycles * @return A SDLPutFile object */ -- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(BOOL)persistentFile; +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(BOOL)persistentFile __deprecated_msg("Use initWithSdlFileName:fileType: instead"); /** * Convenience init for creating a putfile that is part of a multiple frame payload. @@ -54,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN * @param crc Checksum of the bulk data. Used by Core to check data integrity * @return A SDLPutFile object */ -- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(BOOL)persistentFile systemFile:(BOOL)systemFile offset:(UInt32)offset length:(UInt32)length crc:(UInt64)crc; +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(BOOL)persistentFile systemFile:(BOOL)systemFile offset:(UInt32)offset length:(UInt32)length crc:(UInt64)crc __deprecated_msg("Use initWithSdlFileName:fileType: instead"); /** * Convenience init for creating a putfile that is part of a multiple frame payload. A CRC checksum is calculated for the bulk data. @@ -68,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN * @param bulkData Data being sent in the putfile * @return A SDLPutFile object */ -- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(BOOL)persistentFile systemFile:(BOOL)systemFile offset:(UInt32)offset length:(UInt32)length bulkData:(NSData *)bulkData; +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(BOOL)persistentFile systemFile:(BOOL)systemFile offset:(UInt32)offset length:(UInt32)length bulkData:(NSData *)bulkData __deprecated_msg("Use initWithSdlFileName:fileType: instead"); /** * File reference name diff --git a/SmartDeviceLink/public/SDLPutFile.m b/SmartDeviceLink/public/SDLPutFile.m index eb1b6af6de..afa33c25d4 100644 --- a/SmartDeviceLink/public/SDLPutFile.m +++ b/SmartDeviceLink/public/SDLPutFile.m @@ -22,6 +22,29 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName fileType:(SDLFileType)fileType { + self = [self init]; + if (!self) { + return nil; + } + self.sdlFileName = sdlFileName; + self.fileType = fileType; + return self; +} + +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName fileType:(SDLFileType)fileType persistentFile:(nullable NSNumber *)persistentFile systemFile:(nullable NSNumber *)systemFile offset:(nullable NSNumber *)offset length:(nullable NSNumber *)length crc:(nullable NSNumber *)crc { + self = [self initWithSdlFileName:sdlFileName fileType:fileType]; + if (!self) { + return nil; + } + self.persistentFile = persistentFile; + self.systemFile = systemFile; + self.offset = offset; + self.length = length; + self.crc = crc; + return self; +} + - (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLPutFileResponse.h b/SmartDeviceLink/public/SDLPutFileResponse.h index 0c87721252..684b28e13e 100644 --- a/SmartDeviceLink/public/SDLPutFileResponse.h +++ b/SmartDeviceLink/public/SDLPutFileResponse.h @@ -1,19 +1,53 @@ -// SDLPutFileResponse.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 SDLPutFile Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLPutFileResponse : SDLRPCResponse +/** + * @param spaceAvailable - spaceAvailable + * @return A SDLPutFileResponse object + */ +- (instancetype)initWithSpaceAvailable:(nullable NSNumber *)spaceAvailable; + /** * Provides the total local space available in SDL Core for the registered app. If the transfer has systemFile enabled, then the value will be set to 0 automatically. */ diff --git a/SmartDeviceLink/public/SDLPutFileResponse.m b/SmartDeviceLink/public/SDLPutFileResponse.m index aecbf9bb1b..7083dd420e 100644 --- a/SmartDeviceLink/public/SDLPutFileResponse.m +++ b/SmartDeviceLink/public/SDLPutFileResponse.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSpaceAvailable:(nullable NSNumber *)spaceAvailable { + self = [self init]; + if (!self) { + return nil; + } + self.spaceAvailable = spaceAvailable; + return self; +} + - (void)setSpaceAvailable:(nullable NSNumber *)spaceAvailable { [self.parameters sdl_setObject:spaceAvailable forName:SDLRPCParameterNameSpaceAvailable]; } diff --git a/SmartDeviceLink/public/SDLRDSData.h b/SmartDeviceLink/public/SDLRDSData.h index fc5b92bf72..e202d3b2d2 100755 --- a/SmartDeviceLink/public/SDLRDSData.h +++ b/SmartDeviceLink/public/SDLRDSData.h @@ -1,6 +1,34 @@ -// -// SDLRDSData.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" diff --git a/SmartDeviceLink/public/SDLRGBColor.h b/SmartDeviceLink/public/SDLRGBColor.h index 3702b1b05e..6f0940c8f7 100644 --- a/SmartDeviceLink/public/SDLRGBColor.h +++ b/SmartDeviceLink/public/SDLRGBColor.h @@ -1,10 +1,34 @@ -// -// SDLRGBColor.h -// SmartDeviceLink -// -// Created by Joel Fischer on 5/18/18. -// Copyright © 2018 Livio. 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 diff --git a/SmartDeviceLink/public/SDLRPCMessageType.h b/SmartDeviceLink/public/SDLRPCMessageType.h index e0ca142acc..3aa71185fe 100644 --- a/SmartDeviceLink/public/SDLRPCMessageType.h +++ b/SmartDeviceLink/public/SDLRPCMessageType.h @@ -1,5 +1,34 @@ -// SDLRPCMessageType.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 diff --git a/SmartDeviceLink/public/SDLRadioBand.h b/SmartDeviceLink/public/SDLRadioBand.h index 7486f0d715..3eff3cdc57 100644 --- a/SmartDeviceLink/public/SDLRadioBand.h +++ b/SmartDeviceLink/public/SDLRadioBand.h @@ -1,6 +1,34 @@ -// -// SDLRadioBand.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLRadioControlCapabilities.h b/SmartDeviceLink/public/SDLRadioControlCapabilities.h index 7f4aba92f8..bab2abe2a3 100644 --- a/SmartDeviceLink/public/SDLRadioControlCapabilities.h +++ b/SmartDeviceLink/public/SDLRadioControlCapabilities.h @@ -1,6 +1,34 @@ -// -// SDLRadioControlCapabilities.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" @@ -9,9 +37,36 @@ NS_ASSUME_NONNULL_BEGIN /** * Contains information about a radio control module's capabilities. + * + * @added in SmartDeviceLink 4.5.0 */ @interface SDLRadioControlCapabilities : SDLRPCStruct +/** + * @param moduleName - moduleName + * @return A SDLRadioControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName; + +/** + * @param moduleName - moduleName + * @param moduleInfo - moduleInfo + * @param radioEnableAvailable - radioEnableAvailable + * @param radioBandAvailable - radioBandAvailable + * @param radioFrequencyAvailable - radioFrequencyAvailable + * @param hdChannelAvailable - hdChannelAvailable + * @param rdsDataAvailable - rdsDataAvailable + * @param availableHdChannelsAvailable - availableHdChannelsAvailable + * @param stateAvailable - stateAvailable + * @param signalStrengthAvailable - signalStrengthAvailable + * @param signalChangeThresholdAvailable - signalChangeThresholdAvailable + * @param sisDataAvailable - sisDataAvailable + * @param hdRadioEnableAvailable - hdRadioEnableAvailable + * @param siriusxmRadioAvailable - siriusxmRadioAvailable + * @return A SDLRadioControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(nullable NSNumber *)radioEnableAvailable radioBandAvailable:(nullable NSNumber *)radioBandAvailable radioFrequencyAvailable:(nullable NSNumber *)radioFrequencyAvailable hdChannelAvailable:(nullable NSNumber *)hdChannelAvailable rdsDataAvailable:(nullable NSNumber *)rdsDataAvailable availableHdChannelsAvailable:(nullable NSNumber *)availableHdChannelsAvailable stateAvailable:(nullable NSNumber *)stateAvailable signalStrengthAvailable:(nullable NSNumber *)signalStrengthAvailable signalChangeThresholdAvailable:(nullable NSNumber *)signalChangeThresholdAvailable sisDataAvailable:(nullable NSNumber *)sisDataAvailable hdRadioEnableAvailable:(nullable NSNumber *)hdRadioEnableAvailable siriusxmRadioAvailable:(nullable NSNumber *)siriusxmRadioAvailable; + /** Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. @@ -31,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN @param sisDataAvailable Availability of sis data. @return An instance of the SDLRadioControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable __deprecated_msg("Use initWithModuleName: instead"); /** * The short friendly name of the radio control module. @@ -94,7 +149,14 @@ NS_ASSUME_NONNULL_BEGIN * * Optional, Boolean */ -@property (nullable, strong, nonatomic) NSNumber *availableHDsAvailable __deprecated_msg("Use availableHDChannelsAvailable instead."); +@property (nullable, strong, nonatomic) NSNumber *availableHDsAvailable __deprecated_msg("Use availableHdChannelsAvailable instead."); + +/** + * Availability of the list of available HD sub-channel indexes. True: Available, False: Not Available, Not present: Not Available. + * + * @added in SmartDeviceLink 6.0.0 + */ +@property (nullable, strong, nonatomic) NSNumber *availableHdChannelsAvailable; /** * Availability of the list of available HD sub-channel indexes. @@ -103,7 +165,7 @@ NS_ASSUME_NONNULL_BEGIN * * Optional, Boolean */ -@property (nullable, strong, nonatomic) NSNumber *availableHDChannelsAvailable; +@property (nullable, strong, nonatomic) NSNumber *availableHDChannelsAvailable __deprecated_msg("Use availableHdChannelsAvailable instead"); /** * Availability of the getting the Radio state. @@ -146,7 +208,14 @@ NS_ASSUME_NONNULL_BEGIN * * Optional, Boolean */ -@property (nullable, strong, nonatomic) NSNumber *siriusXMRadioAvailable; +@property (nullable, strong, nonatomic) NSNumber *siriusXMRadioAvailable __deprecated_msg("Use siriusxmRadioAvailable instead"); + +/** + * Availability of Sirius XM radio. True: Available, False: Not Available, Not present: Not Available. + * + * @added in SmartDeviceLink 5.0.0 + */ +@property (nullable, strong, nonatomic) NSNumber *siriusxmRadioAvailable; /** * Availability of the getting HD radio Station Information Service (SIS) data. diff --git a/SmartDeviceLink/public/SDLRadioControlCapabilities.m b/SmartDeviceLink/public/SDLRadioControlCapabilities.m index ac1894de74..bb06c033c7 100644 --- a/SmartDeviceLink/public/SDLRadioControlCapabilities.m +++ b/SmartDeviceLink/public/SDLRadioControlCapabilities.m @@ -10,6 +10,36 @@ @implementation SDLRadioControlCapabilities +- (instancetype)initWithModuleName:(NSString *)moduleName { + self = [self init]; + if (!self) { + return nil; + } + self.moduleName = moduleName; + return self; +} + +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(nullable NSNumber *)radioEnableAvailable radioBandAvailable:(nullable NSNumber *)radioBandAvailable radioFrequencyAvailable:(nullable NSNumber *)radioFrequencyAvailable hdChannelAvailable:(nullable NSNumber *)hdChannelAvailable rdsDataAvailable:(nullable NSNumber *)rdsDataAvailable availableHdChannelsAvailable:(nullable NSNumber *)availableHdChannelsAvailable stateAvailable:(nullable NSNumber *)stateAvailable signalStrengthAvailable:(nullable NSNumber *)signalStrengthAvailable signalChangeThresholdAvailable:(nullable NSNumber *)signalChangeThresholdAvailable sisDataAvailable:(nullable NSNumber *)sisDataAvailable hdRadioEnableAvailable:(nullable NSNumber *)hdRadioEnableAvailable siriusxmRadioAvailable:(nullable NSNumber *)siriusxmRadioAvailable { + self = [self initWithModuleName:moduleName]; + if (!self) { + return nil; + } + self.moduleInfo = moduleInfo; + self.radioEnableAvailable = radioEnableAvailable; + self.radioBandAvailable = radioBandAvailable; + self.radioFrequencyAvailable = radioFrequencyAvailable; + self.hdChannelAvailable = hdChannelAvailable; + self.rdsDataAvailable = rdsDataAvailable; + self.availableHdChannelsAvailable = availableHdChannelsAvailable; + self.stateAvailable = stateAvailable; + self.signalStrengthAvailable = signalStrengthAvailable; + self.signalChangeThresholdAvailable = signalChangeThresholdAvailable; + self.sisDataAvailable = sisDataAvailable; + self.hdRadioEnableAvailable = hdRadioEnableAvailable; + self.siriusxmRadioAvailable = siriusxmRadioAvailable; + return self; +} + - (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable { self = [self init]; if(!self){ @@ -91,6 +121,14 @@ - (void)setAvailableHDsAvailable:(nullable NSNumber *)availableHDsAvail return [self.store sdl_objectForName:SDLRPCParameterNameAvailableHDsAvailable ofClass:NSNumber.class error:nil]; } +- (void)setAvailableHdChannelsAvailable:(nullable NSNumber *)availableHdChannelsAvailable { + [self.store sdl_setObject:availableHdChannelsAvailable forName:SDLRPCParameterNameAvailableHDsAvailable]; +} + +- (nullable NSNumber *)availableHdChannelsAvailable { + return [self.store sdl_objectForName:SDLRPCParameterNameAvailableHDsAvailable ofClass:NSNumber.class error:nil]; +} + - (void)setAvailableHDChannelsAvailable:(nullable NSNumber *)availableHDChannelsAvailable { [self.store sdl_setObject:availableHDChannelsAvailable forName:SDLRPCParameterNameAvailableHDsAvailable]; } @@ -139,6 +177,14 @@ - (void)setSiriusXMRadioAvailable:(nullable NSNumber *)siriusXMRadioAva return [self.store sdl_objectForName:SDLRPCParameterNameSiriusXMRadioAvailable ofClass:NSNumber.class error:nil]; } +- (void)setSiriusxmRadioAvailable:(nullable NSNumber *)siriusxmRadioAvailable { + [self.store sdl_setObject:siriusxmRadioAvailable forName:SDLRPCParameterNameSiriusXMRadioAvailable]; +} + +- (nullable NSNumber *)siriusxmRadioAvailable { + return [self.store sdl_objectForName:SDLRPCParameterNameSiriusXMRadioAvailable ofClass:NSNumber.class error:nil]; +} + - (void)setSisDataAvailable:(nullable NSNumber *)sisDataAvailable { [self.store sdl_setObject:sisDataAvailable forName:SDLRPCParameterNameSISDataAvailable]; } diff --git a/SmartDeviceLink/public/SDLRadioControlData.h b/SmartDeviceLink/public/SDLRadioControlData.h index 523322b4c3..47dd0ce09b 100644 --- a/SmartDeviceLink/public/SDLRadioControlData.h +++ b/SmartDeviceLink/public/SDLRadioControlData.h @@ -1,6 +1,34 @@ -// -// SDLRadioControlData.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 "SDLRadioBand.h" @@ -13,9 +41,28 @@ NS_ASSUME_NONNULL_BEGIN /** * Include information (both read-only and changeable data) about a remote control radio module. + * + * @added in SmartDeviceLink 4.5.0 */ @interface SDLRadioControlData : SDLRPCStruct +/** + * @param frequencyInteger - frequencyInteger + * @param frequencyFraction - frequencyFraction + * @param band - band + * @param rdsData - rdsData + * @param hdRadioEnable - hdRadioEnable + * @param availableHdChannels - availableHdChannels + * @param hdChannel - hdChannel + * @param signalStrength - signalStrength + * @param signalChangeThreshold - signalChangeThreshold + * @param radioEnable - radioEnable + * @param state - state + * @param sisData - sisData + * @return A SDLRadioControlData object + */ +- (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band rdsData:(nullable SDLRDSData *)rdsData hdRadioEnable:(nullable NSNumber *)hdRadioEnable availableHdChannels:(nullable NSArray *> *)availableHdChannels hdChannel:(nullable NSNumber *)hdChannel signalStrength:(nullable NSNumber *)signalStrength signalChangeThreshold:(nullable NSNumber *)signalChangeThreshold radioEnable:(nullable NSNumber *)radioEnable state:(nullable SDLRadioState)state sisData:(nullable SDLSISData *)sisData; + /** Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. @@ -27,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN @param hdRadioEnable whether or not hdradio is enabled @return An instance of the SDLRadioControlData class */ -- (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band hdChannel:(nullable NSNumber *)hdChannel radioEnable:(nullable NSNumber *)radioEnable hdRadioEnable:(nullable NSNumber *)hdRadioEnable; +- (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band hdChannel:(nullable NSNumber *)hdChannel radioEnable:(nullable NSNumber *)radioEnable hdRadioEnable:(nullable NSNumber *)hdRadioEnable __deprecated_msg("Use another initializer"); /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// @@ -87,7 +134,15 @@ NS_ASSUME_NONNULL_BEGIN * * Integer value Min Value - 1 Max Value -7 */ -@property (nullable, strong, nonatomic) NSNumber *availableHDs __deprecated_msg("Use availableHDChannels instead"); +@property (nullable, strong, nonatomic) NSNumber *availableHDs __deprecated_msg("Use availableHdChannels instead"); + +/** + * The list of available HD sub-channel indexes. Empty list means no Hd channel is available. Read-only. + * {"array_min_size": 0, "array_max_size": 8, "num_min_value": 0, "num_max_value": 7} + * + * @added in SmartDeviceLink 6.0.0 + */ +@property (nullable, strong, nonatomic) NSArray *> *availableHdChannels; /** * the list of available hd sub-channel indexes, empty list means no Hd channel is available, read-only @@ -96,7 +151,7 @@ NS_ASSUME_NONNULL_BEGIN * * Integer value Min Value - 0 Max Value -7 */ -@property (nullable, strong, nonatomic) NSNumber *availableHDChannels; +@property (nullable, strong, nonatomic) NSNumber *availableHDChannels __deprecated_msg("Use availableHdChannels instead"); /** * Current HD sub-channel if available diff --git a/SmartDeviceLink/public/SDLRadioControlData.m b/SmartDeviceLink/public/SDLRadioControlData.m index 59a4d21d9a..71aa85a345 100644 --- a/SmartDeviceLink/public/SDLRadioControlData.m +++ b/SmartDeviceLink/public/SDLRadioControlData.m @@ -12,6 +12,26 @@ @implementation SDLRadioControlData +- (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band rdsData:(nullable SDLRDSData *)rdsData hdRadioEnable:(nullable NSNumber *)hdRadioEnable availableHdChannels:(nullable NSArray *> *)availableHdChannels hdChannel:(nullable NSNumber *)hdChannel signalStrength:(nullable NSNumber *)signalStrength signalChangeThreshold:(nullable NSNumber *)signalChangeThreshold radioEnable:(nullable NSNumber *)radioEnable state:(nullable SDLRadioState)state sisData:(nullable SDLSISData *)sisData { + self = [self init]; + if (!self) { + return nil; + } + self.frequencyInteger = frequencyInteger; + self.frequencyFraction = frequencyFraction; + self.band = band; + self.rdsData = rdsData; + self.hdRadioEnable = hdRadioEnable; + self.availableHdChannels = availableHdChannels; + self.hdChannel = hdChannel; + self.signalStrength = signalStrength; + self.signalChangeThreshold = signalChangeThreshold; + self.radioEnable = radioEnable; + self.state = state; + self.sisData = sisData; + return self; +} + - (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band hdChannel:(nullable NSNumber *)hdChannel radioEnable:(nullable NSNumber *)radioEnable hdRadioEnable:(nullable NSNumber *)hdRadioEnable { self = [self init]; if(!self) { @@ -99,6 +119,14 @@ - (nullable SDLRDSData *)rdsData { return [self.store sdl_objectForName:SDLRPCParameterNameRDSData ofClass:SDLRDSData.class error:nil]; } +- (void)setAvailableHdChannels:(nullable NSArray *> *)availableHdChannels { + [self.store sdl_setObject:availableHdChannels forName:SDLRPCParameterNameAvailableHDChannels]; +} + +- (nullable NSArray *> *)availableHdChannels { + return [self.store sdl_objectsForName:SDLRPCParameterNameAvailableHDChannels ofClass:NSNumber.class error:nil]; +} + - (void)setAvailableHDChannels:(nullable NSNumber *)availableHDChannels { [self.store sdl_setObject:availableHDChannels forName:SDLRPCParameterNameAvailableHDChannels]; } diff --git a/SmartDeviceLink/public/SDLRadioState.h b/SmartDeviceLink/public/SDLRadioState.h index fe9963984a..6a98563218 100644 --- a/SmartDeviceLink/public/SDLRadioState.h +++ b/SmartDeviceLink/public/SDLRadioState.h @@ -1,7 +1,34 @@ -// -// SDLRadioState.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 "SDLEnum.h" /** diff --git a/SmartDeviceLink/public/SDLReadDID.h b/SmartDeviceLink/public/SDLReadDID.h index 299e7851dd..280a4771c2 100644 --- a/SmartDeviceLink/public/SDLReadDID.h +++ b/SmartDeviceLink/public/SDLReadDID.h @@ -1,9 +1,40 @@ -// SDLReadDID.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" +NS_ASSUME_NONNULL_BEGIN + /** * Non periodic vehicle data read request. This is an RPC to get diagnostics * data from certain vehicle modules. DIDs of a certain module might differ from @@ -16,17 +47,21 @@ * * Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLReadDID : SDLRPCRequest +/** + * @param ecuName - @(ecuName) + * @param didLocation - didLocation + * @return A SDLReadDID object + */ +- (instancetype)initWithEcuName:(UInt16)ecuName didLocation:(NSArray *> *)didLocation; + /// Convenience init /// /// @param ecuNumber An ID of the vehicle module /// @param didLocation Raw data from vehicle data DID location(s) /// @return An SDLReadDID object -- (instancetype)initWithECUName:(UInt16)ecuNumber didLocation:(NSArray *> *)didLocation; +- (instancetype)initWithECUName:(UInt16)ecuNumber didLocation:(NSArray *> *)didLocation __deprecated_msg("Use initWithEcuName:didLocation: instead"); /** * An ID of the vehicle module diff --git a/SmartDeviceLink/public/SDLReadDID.m b/SmartDeviceLink/public/SDLReadDID.m index dd337708ec..e7b9abe996 100644 --- a/SmartDeviceLink/public/SDLReadDID.m +++ b/SmartDeviceLink/public/SDLReadDID.m @@ -21,6 +21,16 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithEcuName:(UInt16)ecuName didLocation:(NSArray *> *)didLocation { + self = [self init]; + if (!self) { + return nil; + } + self.ecuName = @(ecuName); + self.didLocation = didLocation; + return self; +} + - (instancetype)initWithECUName:(UInt16)ecuName didLocation:(NSArray *> *)didLocation { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLReadDIDResponse.h b/SmartDeviceLink/public/SDLReadDIDResponse.h index 612ed48d18..d16c87469f 100644 --- a/SmartDeviceLink/public/SDLReadDIDResponse.h +++ b/SmartDeviceLink/public/SDLReadDIDResponse.h @@ -1,21 +1,55 @@ -// SDLReadDIDResponse.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" @class SDLDIDResult; +NS_ASSUME_NONNULL_BEGIN + /** A response to ReadDID - + Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLReadDIDResponse : SDLRPCResponse +/** + * @param didResult - didResult + * @return A SDLReadDIDResponse object + */ +- (instancetype)initWithDidResult:(nullable NSArray *)didResult; + /** Array of requested DID results (with data if available). */ diff --git a/SmartDeviceLink/public/SDLReadDIDResponse.m b/SmartDeviceLink/public/SDLReadDIDResponse.m index 7bad1e43e7..719834f722 100644 --- a/SmartDeviceLink/public/SDLReadDIDResponse.m +++ b/SmartDeviceLink/public/SDLReadDIDResponse.m @@ -22,6 +22,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithDidResult:(nullable NSArray *)didResult { + self = [self init]; + if (!self) { + return nil; + } + self.didResult = didResult; + return self; +} + - (void)setDidResult:(nullable NSArray *)didResult { [self.parameters sdl_setObject:didResult forName:SDLRPCParameterNameDIDResult]; } diff --git a/SmartDeviceLink/public/SDLRectangle.h b/SmartDeviceLink/public/SDLRectangle.h index 04d9e76cce..0694fb28e1 100644 --- a/SmartDeviceLink/public/SDLRectangle.h +++ b/SmartDeviceLink/public/SDLRectangle.h @@ -1,10 +1,34 @@ -// -// SDLRectangle.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 8/23/17. -// Copyright © 2017 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 #import diff --git a/SmartDeviceLink/public/SDLRegisterAppInterface.h b/SmartDeviceLink/public/SDLRegisterAppInterface.h index 805411b9a5..9dffc79aa3 100644 --- a/SmartDeviceLink/public/SDLRegisterAppInterface.h +++ b/SmartDeviceLink/public/SDLRegisterAppInterface.h @@ -1,5 +1,34 @@ -// SDLRegisterAppInterface.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" @@ -31,6 +60,38 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLRegisterAppInterface : SDLRPCRequest +/** + * @param sdlMsgVersion - sdlMsgVersion + * @param appName - appName + * @param isMediaApplication - @(isMediaApplication) + * @param languageDesired - languageDesired + * @param hmiDisplayLanguageDesired - hmiDisplayLanguageDesired + * @param appID - appID + * @return A SDLRegisterAppInterface object + */ +- (instancetype)initWithSdlMsgVersion:(SDLMsgVersion *)sdlMsgVersion appName:(NSString *)appName isMediaApplication:(BOOL)isMediaApplication languageDesired:(SDLLanguage)languageDesired hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired appID:(NSString *)appID; + +/** + * @param sdlMsgVersion - sdlMsgVersion + * @param appName - appName + * @param isMediaApplication - @(isMediaApplication) + * @param languageDesired - languageDesired + * @param hmiDisplayLanguageDesired - hmiDisplayLanguageDesired + * @param appID - appID + * @param ttsName - ttsName + * @param ngnMediaScreenAppName - ngnMediaScreenAppName + * @param vrSynonyms - vrSynonyms + * @param appHMIType - appHMIType + * @param hashID - hashID + * @param deviceInfo - deviceInfo + * @param fullAppID - fullAppID + * @param appInfo - appInfo + * @param dayColorScheme - dayColorScheme + * @param nightColorScheme - nightColorScheme + * @return A SDLRegisterAppInterface object + */ +- (instancetype)initWithSdlMsgVersion:(SDLMsgVersion *)sdlMsgVersion appName:(NSString *)appName isMediaApplication:(BOOL)isMediaApplication languageDesired:(SDLLanguage)languageDesired hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired appID:(NSString *)appID ttsName:(nullable NSArray *)ttsName ngnMediaScreenAppName:(nullable NSString *)ngnMediaScreenAppName vrSynonyms:(nullable NSArray *)vrSynonyms appHMIType:(nullable NSArray *)appHMIType hashID:(nullable NSString *)hashID deviceInfo:(nullable SDLDeviceInfo *)deviceInfo fullAppID:(nullable NSString *)fullAppID appInfo:(nullable SDLAppInfo *)appInfo dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme; + /** * Convenience init for registering the application with a lifecycle configuration. * @@ -46,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN * @param languageDesired The language the application intends to use for user interaction * @return A SDLRegisterAppInterface object */ -- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired; +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired __deprecated_msg("Use initWithSdlMsgVersion:appName:isMediaApplication:languageDesired:hmiDisplayLanguageDesired:appID: instead"); /** * Convenience init for registering the application with all possible options. @@ -66,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN * @param nightColorScheme The color scheme to be used on a head unit using a "dark" or "night" color scheme * @return A SDLRegisterAppInterface object */ -- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId fullAppId:(nullable NSString *)fullAppId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray *)appTypes shortAppName:(nullable NSString *)shortAppName ttsName:(nullable NSArray *)ttsName vrSynonyms:(nullable NSArray *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired resumeHash:(nullable NSString *)resumeHash dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme; +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId fullAppId:(nullable NSString *)fullAppId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray *)appTypes shortAppName:(nullable NSString *)shortAppName ttsName:(nullable NSArray *)ttsName vrSynonyms:(nullable NSArray *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired resumeHash:(nullable NSString *)resumeHash dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme __deprecated_msg("Use initWithSdlMsgVersion:appName:isMediaApplication:languageDesired:hmiDisplayLanguageDesired:appID: instead"); /** * Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application. diff --git a/SmartDeviceLink/public/SDLRegisterAppInterface.m b/SmartDeviceLink/public/SDLRegisterAppInterface.m index eced457ff2..801431d6ea 100644 --- a/SmartDeviceLink/public/SDLRegisterAppInterface.m +++ b/SmartDeviceLink/public/SDLRegisterAppInterface.m @@ -32,22 +32,51 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSdlMsgVersion:(SDLMsgVersion *)sdlMsgVersion appName:(NSString *)appName isMediaApplication:(BOOL)isMediaApplication languageDesired:(SDLLanguage)languageDesired hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired appID:(NSString *)appID { + self = [self init]; + if (!self) { + return nil; + } + self.sdlMsgVersion = sdlMsgVersion; + self.appName = appName; + self.isMediaApplication = @(isMediaApplication); + self.languageDesired = languageDesired; + self.hmiDisplayLanguageDesired = hmiDisplayLanguageDesired; + self.appID = appID; + return self; +} + +- (instancetype)initWithSdlMsgVersion:(SDLMsgVersion *)sdlMsgVersion appName:(NSString *)appName isMediaApplication:(BOOL)isMediaApplication languageDesired:(SDLLanguage)languageDesired hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired appID:(NSString *)appID ttsName:(nullable NSArray *)ttsName ngnMediaScreenAppName:(nullable NSString *)ngnMediaScreenAppName vrSynonyms:(nullable NSArray *)vrSynonyms appHMIType:(nullable NSArray *)appHMIType hashID:(nullable NSString *)hashID deviceInfo:(nullable SDLDeviceInfo *)deviceInfo fullAppID:(nullable NSString *)fullAppID appInfo:(nullable SDLAppInfo *)appInfo dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme { + self = [self initWithSdlMsgVersion:sdlMsgVersion appName:appName isMediaApplication:isMediaApplication languageDesired:languageDesired hmiDisplayLanguageDesired:hmiDisplayLanguageDesired appID:appID]; + if (!self) { + return nil; + } + self.ttsName = ttsName; + self.ngnMediaScreenAppName = ngnMediaScreenAppName; + self.vrSynonyms = vrSynonyms; + self.appHMIType = appHMIType; + self.hashID = hashID; + self.deviceInfo = deviceInfo; + self.fullAppID = fullAppID; + self.appInfo = appInfo; + self.dayColorScheme = dayColorScheme; + self.nightColorScheme = nightColorScheme; + return self; +} + - (instancetype)initWithLifecycleConfiguration:(SDLLifecycleConfiguration *)lifecycleConfiguration { NSArray *allHMITypes = lifecycleConfiguration.additionalAppTypes ? [lifecycleConfiguration.additionalAppTypes arrayByAddingObject:lifecycleConfiguration.appType] : @[lifecycleConfiguration.appType]; - return [self initWithAppName:lifecycleConfiguration.appName - appId:lifecycleConfiguration.appId - fullAppId:lifecycleConfiguration.fullAppId - languageDesired:lifecycleConfiguration.language - isMediaApp:lifecycleConfiguration.isMedia - appTypes:allHMITypes - shortAppName:lifecycleConfiguration.shortAppName - ttsName:lifecycleConfiguration.ttsName - vrSynonyms:lifecycleConfiguration.voiceRecognitionCommandNames - hmiDisplayLanguageDesired:lifecycleConfiguration.language - resumeHash:lifecycleConfiguration.resumeHash - dayColorScheme:lifecycleConfiguration.dayColorScheme - nightColorScheme:lifecycleConfiguration.nightColorScheme]; + UInt8 majorVersion = (UInt8)[SDLMaxProxyRPCVersion substringWithRange:NSMakeRange(0, 1)].intValue; + UInt8 minorVersion = (UInt8)[SDLMaxProxyRPCVersion substringWithRange:NSMakeRange(2, 1)].intValue; + UInt8 patchVersion = (UInt8)[SDLMaxProxyRPCVersion substringWithRange:NSMakeRange(4, 1)].intValue; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLMsgVersion *msgVersion = [[SDLMsgVersion alloc] initWithMajorVersionParam:majorVersion minorVersion:minorVersion patchVersion:@(patchVersion)]; +#pragma clang diagnostic pop + + return [self initWithSdlMsgVersion:msgVersion appName:lifecycleConfiguration.appName isMediaApplication:lifecycleConfiguration.isMedia languageDesired:lifecycleConfiguration.language hmiDisplayLanguageDesired:lifecycleConfiguration.language appID:lifecycleConfiguration.appId ttsName:lifecycleConfiguration.ttsName ngnMediaScreenAppName:lifecycleConfiguration.shortAppName vrSynonyms:lifecycleConfiguration.voiceRecognitionCommandNames appHMIType:allHMITypes hashID:lifecycleConfiguration.resumeHash deviceInfo:[SDLDeviceInfo currentDevice] fullAppID:lifecycleConfiguration.fullAppId appInfo:[SDLAppInfo currentAppInfo] dayColorScheme:lifecycleConfiguration.dayColorScheme nightColorScheme:lifecycleConfiguration.nightColorScheme]; } - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired { diff --git a/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.h b/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.h index 3538e22e37..2f31173118 100644 --- a/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.h +++ b/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.h @@ -1,5 +1,34 @@ -// SDLRegisterAppInterfaceResponse.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" @@ -29,6 +58,26 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLRegisterAppInterfaceResponse : SDLRPCResponse +/** + * @param sdlMsgVersion - sdlMsgVersion + * @param language - language + * @param hmiDisplayLanguage - hmiDisplayLanguage + * @param hmiZoneCapabilities - hmiZoneCapabilities + * @param speechCapabilities - speechCapabilities + * @param prerecordedSpeech - prerecordedSpeech + * @param vrCapabilities - vrCapabilities + * @param audioPassThruCapabilities - audioPassThruCapabilities + * @param pcmStreamCapabilities - pcmStreamCapabilities + * @param vehicleType - vehicleType + * @param supportedDiagModes - supportedDiagModes + * @param hmiCapabilities - hmiCapabilities + * @param sdlVersion - sdlVersion + * @param systemSoftwareVersion - systemSoftwareVersion + * @param iconResumed - iconResumed + * @return A SDLRegisterAppInterfaceResponse object + */ +- (instancetype)initWithSdlMsgVersion:(nullable SDLMsgVersion *)sdlMsgVersion language:(nullable SDLLanguage)language hmiDisplayLanguage:(nullable SDLLanguage)hmiDisplayLanguage hmiZoneCapabilities:(nullable NSArray *)hmiZoneCapabilities speechCapabilities:(nullable NSArray *)speechCapabilities prerecordedSpeech:(nullable NSArray *)prerecordedSpeech vrCapabilities:(nullable NSArray *)vrCapabilities audioPassThruCapabilities:(nullable NSArray *)audioPassThruCapabilities pcmStreamCapabilities:(nullable SDLAudioPassThruCapabilities *)pcmStreamCapabilities vehicleType:(nullable SDLVehicleType *)vehicleType supportedDiagModes:(nullable NSArray *> *)supportedDiagModes hmiCapabilities:(nullable SDLHMICapabilities *)hmiCapabilities sdlVersion:(nullable NSString *)sdlVersion systemSoftwareVersion:(nullable NSString *)systemSoftwareVersion iconResumed:(nullable NSNumber *)iconResumed; + /** * Specifies the negotiated version number of the SmartDeviceLink protocol that is to be supported by the mobile application. * diff --git a/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.m b/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.m index fdc857cd23..f368d5f510 100644 --- a/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.m +++ b/SmartDeviceLink/public/SDLRegisterAppInterfaceResponse.m @@ -30,6 +30,29 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSdlMsgVersion:(nullable SDLMsgVersion *)sdlMsgVersion language:(nullable SDLLanguage)language hmiDisplayLanguage:(nullable SDLLanguage)hmiDisplayLanguage hmiZoneCapabilities:(nullable NSArray *)hmiZoneCapabilities speechCapabilities:(nullable NSArray *)speechCapabilities prerecordedSpeech:(nullable NSArray *)prerecordedSpeech vrCapabilities:(nullable NSArray *)vrCapabilities audioPassThruCapabilities:(nullable NSArray *)audioPassThruCapabilities pcmStreamCapabilities:(nullable SDLAudioPassThruCapabilities *)pcmStreamCapabilities vehicleType:(nullable SDLVehicleType *)vehicleType supportedDiagModes:(nullable NSArray *> *)supportedDiagModes hmiCapabilities:(nullable SDLHMICapabilities *)hmiCapabilities sdlVersion:(nullable NSString *)sdlVersion systemSoftwareVersion:(nullable NSString *)systemSoftwareVersion iconResumed:(nullable NSNumber *)iconResumed { + self = [self init]; + if (!self) { + return nil; + } + self.sdlMsgVersion = sdlMsgVersion; + self.language = language; + self.hmiDisplayLanguage = hmiDisplayLanguage; + self.hmiZoneCapabilities = hmiZoneCapabilities; + self.speechCapabilities = speechCapabilities; + self.prerecordedSpeech = prerecordedSpeech; + self.vrCapabilities = vrCapabilities; + self.audioPassThruCapabilities = audioPassThruCapabilities; + self.pcmStreamCapabilities = pcmStreamCapabilities; + self.vehicleType = vehicleType; + self.supportedDiagModes = supportedDiagModes; + self.hmiCapabilities = hmiCapabilities; + self.sdlVersion = sdlVersion; + self.systemSoftwareVersion = systemSoftwareVersion; + self.iconResumed = iconResumed; + return self; +} + - (void)setSdlMsgVersion:(nullable SDLMsgVersion *)sdlMsgVersion { [self.parameters sdl_setObject:sdlMsgVersion forName:SDLRPCParameterNameSyncMessageVersion]; } diff --git a/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.h b/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.h index 10db403b93..1dbd33c9c5 100644 --- a/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.h +++ b/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.h @@ -1,10 +1,34 @@ -// -// SDLReleaseInteriorVehicleDataModule.h -// SmartDeviceLink -// -// Created by standa1 on 7/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" #import "SDLModuleType.h" @@ -16,11 +40,18 @@ NS_ASSUME_NONNULL_BEGIN /// @since 6.0 @interface SDLReleaseInteriorVehicleDataModule : SDLRPCRequest -/// Convenience init to release a controlled module -/// @param moduleType The module type that the app requests to control. -/// @param moduleId Id of a module, published by System Capability. -/// @return An SDLReleaseInteriorVehicleDataModule object -- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; +/** + * @param moduleType - moduleType + * @return A SDLReleaseInteriorVehicleDataModule object + */ +- (instancetype)initWithModuleType:(SDLModuleType)moduleType; + +/** + * @param moduleType - moduleType + * @param moduleId - moduleId + * @return A SDLReleaseInteriorVehicleDataModule object + */ +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId; /** * The module type that the app requests to control. diff --git a/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.m b/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.m index b282479631..ff08535517 100644 --- a/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.m +++ b/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModule.m @@ -23,7 +23,16 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId { +- (instancetype)initWithModuleType:(SDLModuleType)moduleType { + self = [self init]; + if (!self) { + return nil; + } + self.moduleType = moduleType; + return self; +} + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModuleResponse.h b/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModuleResponse.h index 63e880c7e2..ecf339a0ab 100644 --- a/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModuleResponse.h +++ b/SmartDeviceLink/public/SDLReleaseInteriorVehicleDataModuleResponse.h @@ -1,10 +1,34 @@ -// -// SDLReleaseInteriorVehicleDataModuleResponse.h -// SmartDeviceLink -// -// Created by standa1 on 7/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 "SDLRPCResponse.h" diff --git a/SmartDeviceLink/public/SDLRemoteControlCapabilities.h b/SmartDeviceLink/public/SDLRemoteControlCapabilities.h index 6281aa5661..cd4266c0cc 100644 --- a/SmartDeviceLink/public/SDLRemoteControlCapabilities.h +++ b/SmartDeviceLink/public/SDLRemoteControlCapabilities.h @@ -1,6 +1,34 @@ -// -// SDLRemoteControlCapabilities.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" @@ -16,9 +44,23 @@ NS_ASSUME_NONNULL_BEGIN /** Capabilities of the remote control feature + + @added in SmartDeviceLink 4.5.0 */ @interface SDLRemoteControlCapabilities : SDLRPCStruct +/** + * @param climateControlCapabilities - climateControlCapabilities + * @param radioControlCapabilities - radioControlCapabilities + * @param buttonCapabilities - buttonCapabilities + * @param audioControlCapabilities - audioControlCapabilities + * @param hmiSettingsControlCapabilities - hmiSettingsControlCapabilities + * @param lightControlCapabilities - lightControlCapabilities + * @param seatControlCapabilities - seatControlCapabilities + * @return A SDLRemoteControlCapabilities object + */ +- (instancetype)initWithClimateControlCapabilities:(nullable NSArray *)climateControlCapabilities radioControlCapabilities:(nullable NSArray *)radioControlCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities audioControlCapabilities:(nullable NSArray *)audioControlCapabilities hmiSettingsControlCapabilities:(nullable SDLHMISettingsControlCapabilities *)hmiSettingsControlCapabilities lightControlCapabilities:(nullable SDLLightControlCapabilities *)lightControlCapabilities seatControlCapabilities:(nullable NSArray *)seatControlCapabilities; + /** Constructs a newly allocated SDLRemoteControlCapabilities object with given parameters @@ -29,9 +71,8 @@ NS_ASSUME_NONNULL_BEGIN @param seatControlCapabilities Array of SDLSeatControlCapabilities @return An instance of the SDLRemoteControlCapabilities class - */ -- (instancetype)initWithClimateControlCapabilities:(nullable NSArray *)climateControlCapabilities radioControlCapabilities:(nullable NSArray *)radioControlCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities seatControlCapabilities:(nullable NSArray *)seatControlCapabilities audioControlCapabilities:(nullable NSArray *)audioControlCapabilities hmiSettingsControlCapabilities:(nullable NSArray *)hmiSettingsControlCapabilities lightControlCapabilities:(nullable NSArray *)lightControlCapabilities; +- (instancetype)initWithClimateControlCapabilities:(nullable NSArray *)climateControlCapabilities radioControlCapabilities:(nullable NSArray *)radioControlCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities seatControlCapabilities:(nullable NSArray *)seatControlCapabilities audioControlCapabilities:(nullable NSArray *)audioControlCapabilities hmiSettingsControlCapabilities:(nullable NSArray *)hmiSettingsControlCapabilities lightControlCapabilities:(nullable NSArray *)lightControlCapabilities __deprecated_msg("Use another initializer"); /** * If included, the platform supports RC climate controls. @@ -75,14 +116,28 @@ NS_ASSUME_NONNULL_BEGIN * * Optional, Array of SDLHMISettingsControlCapabilities, Array length 1 - 100 */ -@property (nullable, strong, nonatomic) NSArray *hmiSettingsControlCapabilities; +@property (nullable, strong, nonatomic) NSArray *hmiSettingsControlCapabilities __deprecated_msg("Use hmiSettingsControlCapabilitiesParam instead"); /** * If included, the platform supports light controls. * * Optional, Array of SDLLightControlCapabilities, Array length 1 - 100 */ -@property (nullable, strong, nonatomic) NSArray *lightControlCapabilities; +@property (nullable, strong, nonatomic) NSArray *lightControlCapabilities __deprecated_msg("Use lightControlCapabilitiesParam instead"); + +/** + * If included, the platform supports hmi setting controls. + * + * @added in SmartDeviceLink 5.0.0 + */ +@property (nullable, strong, nonatomic) SDLHMISettingsControlCapabilities *hmiSettingsControlCapabilitiesParam __deprecated_msg("Eventually this parameter will be replaced without the param"); + +/** + * If included, the platform supports light controls. + * + * @added in SmartDeviceLink 5.0.0 + */ +@property (nullable, strong, nonatomic) SDLLightControlCapabilities *lightControlCapabilitiesParam __deprecated_msg("Eventually this parameter will be replaced without the param"); @end diff --git a/SmartDeviceLink/public/SDLRemoteControlCapabilities.m b/SmartDeviceLink/public/SDLRemoteControlCapabilities.m index 6024e34fab..bff3b87b16 100644 --- a/SmartDeviceLink/public/SDLRemoteControlCapabilities.m +++ b/SmartDeviceLink/public/SDLRemoteControlCapabilities.m @@ -17,6 +17,24 @@ @implementation SDLRemoteControlCapabilities +- (instancetype)initWithClimateControlCapabilities:(nullable NSArray *)climateControlCapabilities radioControlCapabilities:(nullable NSArray *)radioControlCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities audioControlCapabilities:(nullable NSArray *)audioControlCapabilities hmiSettingsControlCapabilities:(nullable SDLHMISettingsControlCapabilities *)hmiSettingsControlCapabilities lightControlCapabilities:(nullable SDLLightControlCapabilities *)lightControlCapabilities seatControlCapabilities:(nullable NSArray *)seatControlCapabilities { + self = [self init]; + if (!self) { + return nil; + } + self.climateControlCapabilities = climateControlCapabilities; + self.radioControlCapabilities = radioControlCapabilities; + self.buttonCapabilities = buttonCapabilities; + self.audioControlCapabilities = audioControlCapabilities; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + self.hmiSettingsControlCapabilitiesParam = hmiSettingsControlCapabilities; + self.lightControlCapabilitiesParam = lightControlCapabilities; +#pragma clang diagnostic pop + self.seatControlCapabilities = seatControlCapabilities; + return self; +} + - (instancetype)initWithClimateControlCapabilities:(nullable NSArray *)climateControlCapabilities radioControlCapabilities:(nullable NSArray *)radioControlCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities seatControlCapabilities:(nullable NSArray *)seatControlCapabilities audioControlCapabilities:(nullable NSArray *)audioControlCapabilities hmiSettingsControlCapabilities:(nullable NSArray *)hmiSettingsControlCapabilities lightControlCapabilities:(nullable NSArray *)lightControlCapabilities { self = [super init]; if (!self) { @@ -112,6 +130,22 @@ - (void)setLightControlCapabilities:(nullable NSArray *)timeout softButtons:(nullable NSArray *)softButtons cancelID:(nullable NSNumber *)cancelID; + /** Convenience init for creating a scrolling message with text. @param message Body of text that can include newlines and tabs @return A SDLScrollableMessage object */ -- (instancetype)initWithMessage:(NSString *)message; +- (instancetype)initWithMessage:(NSString *)message __deprecated_msg("Use initWithScrollableMessageBody: instead"); /** Convenience init for creating a scrolling message with text and buttons. @@ -34,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN @param cancelID An ID for this specific scrollable message to allow cancellation through the `CancelInteraction` RPC @return A SDLScrollableMessage object */ -- (instancetype)initWithMessage:(NSString *)message timeout:(UInt16)timeout softButtons:(nullable NSArray *)softButtons cancelID:(UInt32)cancelID; +- (instancetype)initWithMessage:(NSString *)message timeout:(UInt16)timeout softButtons:(nullable NSArray *)softButtons cancelID:(UInt32)cancelID __deprecated_msg("Use initWithScrollableMessageBody:timeout:softButtons:cancelID: instead"); /** Body of text that can include newlines and tabs. diff --git a/SmartDeviceLink/public/SDLScrollableMessage.m b/SmartDeviceLink/public/SDLScrollableMessage.m index ef0208beb4..e043620695 100644 --- a/SmartDeviceLink/public/SDLScrollableMessage.m +++ b/SmartDeviceLink/public/SDLScrollableMessage.m @@ -22,17 +22,23 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithScrollableMessageBody:(NSString *)message timeout:(nullable NSNumber *)timeout softButtons:(nullable NSArray *)softButtons cancelID:(nullable NSNumber *)cancelID { +- (instancetype)initWithScrollableMessageBody:(NSString *)scrollableMessageBody { self = [self init]; if (!self) { return nil; } + self.scrollableMessageBody = scrollableMessageBody; + return self; +} - self.scrollableMessageBody = message; +- (instancetype)initWithScrollableMessageBody:(NSString *)scrollableMessageBody timeout:(nullable NSNumber *)timeout softButtons:(nullable NSArray *)softButtons cancelID:(nullable NSNumber *)cancelID { + self = [self initWithScrollableMessageBody:scrollableMessageBody]; + if (!self) { + return nil; + } self.timeout = timeout; self.softButtons = softButtons; self.cancelID = cancelID; - return self; } diff --git a/SmartDeviceLink/public/SDLScrollableMessageResponse.h b/SmartDeviceLink/public/SDLScrollableMessageResponse.h index 4da587c1b4..534061ae4f 100644 --- a/SmartDeviceLink/public/SDLScrollableMessageResponse.h +++ b/SmartDeviceLink/public/SDLScrollableMessageResponse.h @@ -1,17 +1,45 @@ -// SDLScrollableMessageResponse.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 SDLScrollableMessage Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLScrollableMessageResponse : SDLRPCResponse @end diff --git a/SmartDeviceLink/public/SDLSeatControlCapabilities.h b/SmartDeviceLink/public/SDLSeatControlCapabilities.h index b85d9b3cbf..8b4ef98fd5 100644 --- a/SmartDeviceLink/public/SDLSeatControlCapabilities.h +++ b/SmartDeviceLink/public/SDLSeatControlCapabilities.h @@ -1,5 +1,34 @@ -// SDLSeatControlCapabilities.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" @@ -12,12 +41,40 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSeatControlCapabilities : SDLRPCStruct +/** + * @param moduleName - moduleName + * @return A SDLSeatControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName; + +/** + * @param moduleName - moduleName + * @param moduleInfo - moduleInfo + * @param heatingEnabledAvailable - heatingEnabledAvailable + * @param coolingEnabledAvailable - coolingEnabledAvailable + * @param heatingLevelAvailable - heatingLevelAvailable + * @param coolingLevelAvailable - coolingLevelAvailable + * @param horizontalPositionAvailable - horizontalPositionAvailable + * @param verticalPositionAvailable - verticalPositionAvailable + * @param frontVerticalPositionAvailable - frontVerticalPositionAvailable + * @param backVerticalPositionAvailable - backVerticalPositionAvailable + * @param backTiltAngleAvailable - backTiltAngleAvailable + * @param headSupportHorizontalPositionAvailable - headSupportHorizontalPositionAvailable + * @param headSupportVerticalPositionAvailable - headSupportVerticalPositionAvailable + * @param massageEnabledAvailable - massageEnabledAvailable + * @param massageModeAvailable - massageModeAvailable + * @param massageCushionFirmnessAvailable - massageCushionFirmnessAvailable + * @param memoryAvailable - memoryAvailable + * @return A SDLSeatControlCapabilities object + */ +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(nullable NSNumber *)heatingEnabledAvailable coolingEnabledAvailable:(nullable NSNumber *)coolingEnabledAvailable heatingLevelAvailable:(nullable NSNumber *)heatingLevelAvailable coolingLevelAvailable:(nullable NSNumber *)coolingLevelAvailable horizontalPositionAvailable:(nullable NSNumber *)horizontalPositionAvailable verticalPositionAvailable:(nullable NSNumber *)verticalPositionAvailable frontVerticalPositionAvailable:(nullable NSNumber *)frontVerticalPositionAvailable backVerticalPositionAvailable:(nullable NSNumber *)backVerticalPositionAvailable backTiltAngleAvailable:(nullable NSNumber *)backTiltAngleAvailable headSupportHorizontalPositionAvailable:(nullable NSNumber *)headSupportHorizontalPositionAvailable headSupportVerticalPositionAvailable:(nullable NSNumber *)headSupportVerticalPositionAvailable massageEnabledAvailable:(nullable NSNumber *)massageEnabledAvailable massageModeAvailable:(nullable NSNumber *)massageModeAvailable massageCushionFirmnessAvailable:(nullable NSNumber *)massageCushionFirmnessAvailable memoryAvailable:(nullable NSNumber *)memoryAvailable; + /// Constructs a newly allocated SDLSeatControlCapabilities object with moduleName and moduleInfo /// /// @param moduleName The short friendly name of the module. /// @param moduleInfo Information about a RC module, including its id /// @return An SDLSeatControlCapabilities object -- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo; +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo __deprecated_msg("Use initWithModuleName: instead"); /// Constructs a newly allocated SDLSeatControlCapabilities object with all parameters /// @@ -40,7 +97,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param memoryAvail Whether or not massage cushion firmness is available /// @return An SDLSeatControlCapabilities object - (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail - coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail; + coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail __deprecated_msg("Use another initializer instead"); /** * @abstract The short friendly name of the light control module. diff --git a/SmartDeviceLink/public/SDLSeatControlCapabilities.m b/SmartDeviceLink/public/SDLSeatControlCapabilities.m index d7fec07ce1..9f48308363 100644 --- a/SmartDeviceLink/public/SDLSeatControlCapabilities.m +++ b/SmartDeviceLink/public/SDLSeatControlCapabilities.m @@ -9,6 +9,39 @@ @implementation SDLSeatControlCapabilities +- (instancetype)initWithModuleName:(NSString *)moduleName { + self = [self init]; + if (!self) { + return nil; + } + self.moduleName = moduleName; + return self; +} + +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(nullable NSNumber *)heatingEnabledAvailable coolingEnabledAvailable:(nullable NSNumber *)coolingEnabledAvailable heatingLevelAvailable:(nullable NSNumber *)heatingLevelAvailable coolingLevelAvailable:(nullable NSNumber *)coolingLevelAvailable horizontalPositionAvailable:(nullable NSNumber *)horizontalPositionAvailable verticalPositionAvailable:(nullable NSNumber *)verticalPositionAvailable frontVerticalPositionAvailable:(nullable NSNumber *)frontVerticalPositionAvailable backVerticalPositionAvailable:(nullable NSNumber *)backVerticalPositionAvailable backTiltAngleAvailable:(nullable NSNumber *)backTiltAngleAvailable headSupportHorizontalPositionAvailable:(nullable NSNumber *)headSupportHorizontalPositionAvailable headSupportVerticalPositionAvailable:(nullable NSNumber *)headSupportVerticalPositionAvailable massageEnabledAvailable:(nullable NSNumber *)massageEnabledAvailable massageModeAvailable:(nullable NSNumber *)massageModeAvailable massageCushionFirmnessAvailable:(nullable NSNumber *)massageCushionFirmnessAvailable memoryAvailable:(nullable NSNumber *)memoryAvailable { + self = [self initWithModuleName:moduleName]; + if (!self) { + return nil; + } + self.moduleInfo = moduleInfo; + self.heatingEnabledAvailable = heatingEnabledAvailable; + self.coolingEnabledAvailable = coolingEnabledAvailable; + self.heatingLevelAvailable = heatingLevelAvailable; + self.coolingLevelAvailable = coolingLevelAvailable; + self.horizontalPositionAvailable = horizontalPositionAvailable; + self.verticalPositionAvailable = verticalPositionAvailable; + self.frontVerticalPositionAvailable = frontVerticalPositionAvailable; + self.backVerticalPositionAvailable = backVerticalPositionAvailable; + self.backTiltAngleAvailable = backTiltAngleAvailable; + self.headSupportHorizontalPositionAvailable = headSupportHorizontalPositionAvailable; + self.headSupportVerticalPositionAvailable = headSupportVerticalPositionAvailable; + self.massageEnabledAvailable = massageEnabledAvailable; + self.massageModeAvailable = massageModeAvailable; + self.massageCushionFirmnessAvailable = massageCushionFirmnessAvailable; + self.memoryAvailable = memoryAvailable; + return self; +} + - (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo { if (self = [super init]) { self.moduleName = moduleName; diff --git a/SmartDeviceLink/public/SDLSeatControlData.h b/SmartDeviceLink/public/SDLSeatControlData.h index 1ad3c9ae18..aa0c20c739 100644 --- a/SmartDeviceLink/public/SDLSeatControlData.h +++ b/SmartDeviceLink/public/SDLSeatControlData.h @@ -1,5 +1,34 @@ -// SDLSeatControlData.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" #import "SDLSeatMemoryActionType.h" @@ -13,8 +42,9 @@ NS_ASSUME_NONNULL_BEGIN /** * Seat control data corresponds to "SEAT" ModuleType. + * + * @added in SmartDeviceLink 5.0.0 */ - @interface SDLSeatControlData : SDLRPCStruct /** diff --git a/SmartDeviceLink/public/SDLSeatLocation.h b/SmartDeviceLink/public/SDLSeatLocation.h index 0c4d705976..79ce2fe10c 100644 --- a/SmartDeviceLink/public/SDLSeatLocation.h +++ b/SmartDeviceLink/public/SDLSeatLocation.h @@ -1,10 +1,34 @@ -// -// SDLSeatLocation.h -// SmartDeviceLink -// -// Created by standa1 on 7/11/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 "SDLRPCMessage.h" #import "SDLGrid.h" @@ -12,10 +36,18 @@ NS_ASSUME_NONNULL_BEGIN /** - * Describes the location of a seat + * Describes the location of a seat. + * + * @added in SmartDeviceLink 6.0.0 */ @interface SDLSeatLocation : SDLRPCStruct +/** + * @param grid - grid + * @return A SDLSeatLocation object + */ +- (instancetype)initWithGrid:(nullable SDLGrid *)grid; + /** * Optional */ diff --git a/SmartDeviceLink/public/SDLSeatLocation.m b/SmartDeviceLink/public/SDLSeatLocation.m index 82fc289408..7f24c5819f 100644 --- a/SmartDeviceLink/public/SDLSeatLocation.m +++ b/SmartDeviceLink/public/SDLSeatLocation.m @@ -13,6 +13,15 @@ @implementation SDLSeatLocation +- (instancetype)initWithGrid:(nullable SDLGrid *)grid { + self = [self init]; + if (!self) { + return nil; + } + self.grid = grid; + return self; +} + - (void)setGrid:(nullable SDLGrid *)grid { [self.store sdl_setObject:grid forName:SDLRPCParameterNameGrid]; } diff --git a/SmartDeviceLink/public/SDLSeatLocationCapability.h b/SmartDeviceLink/public/SDLSeatLocationCapability.h index 1bd5f56935..ace7f35d6e 100644 --- a/SmartDeviceLink/public/SDLSeatLocationCapability.h +++ b/SmartDeviceLink/public/SDLSeatLocationCapability.h @@ -1,10 +1,34 @@ -// -// SDLSeatLocationCapability.h -// SmartDeviceLink -// -// Created by standa1 on 7/11/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 "SDLRPCMessage.h" @@ -13,10 +37,21 @@ NS_ASSUME_NONNULL_BEGIN /** - * Contains information about the locations of each seat. + * Contains information about the locations of each seat + * + * @added in SmartDeviceLink 6.0.0 */ @interface SDLSeatLocationCapability : SDLRPCStruct +/** + * @param rows - rows + * @param columns - columns + * @param levels - levels + * @param seats - seats + * @return A SDLSeatLocationCapability object + */ +- (instancetype)initWithRows:(nullable NSNumber *)rows columns:(nullable NSNumber *)columns levels:(nullable NSNumber *)levels seats:(nullable NSArray *)seats; + /// Constructs a newly allocated SDLSeatLocationCapability object with all parameters /// /// @param seats Describes the location of a seat @@ -24,22 +59,24 @@ NS_ASSUME_NONNULL_BEGIN /// @param rows Number of rows /// @param levels Number of levels /// @return An SDLSeatLocationCapability object -- (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels; +- (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels __deprecated_msg("Use initWithRows:columns:levels:seats: instead"); + +/** + * {"num_min_value": 1, "num_max_value": 100} + */ +@property (nullable, strong, nonatomic) NSNumber *columns; /** - * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic, nullable) NSNumber *cols; +@property (strong, nonatomic, nullable) NSNumber *cols __deprecated_msg("Use columns instead"); /** - * * Optional, Integer, 1 - 100 */ @property (strong, nonatomic, nullable) NSNumber *rows; /** - * * Optional, Integer, 1 - 100 */ @property (strong, nonatomic, nullable) NSNumber *levels; diff --git a/SmartDeviceLink/public/SDLSeatLocationCapability.m b/SmartDeviceLink/public/SDLSeatLocationCapability.m index f6c59e58c1..e4e3dbc089 100644 --- a/SmartDeviceLink/public/SDLSeatLocationCapability.m +++ b/SmartDeviceLink/public/SDLSeatLocationCapability.m @@ -15,6 +15,18 @@ @implementation SDLSeatLocationCapability +- (instancetype)initWithRows:(nullable NSNumber *)rows columns:(nullable NSNumber *)columns levels:(nullable NSNumber *)levels seats:(nullable NSArray *)seats { + self = [self init]; + if (!self) { + return nil; + } + self.rows = rows; + self.columns = columns; + self.levels = levels; + self.seats = seats; + return self; +} + - (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels { self = [self init]; if (!self) { @@ -29,6 +41,14 @@ - (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber return self; } +- (void)setColumns:(nullable NSNumber *)columns { + [self.store sdl_setObject:columns forName:SDLRPCParameterNameColumns]; +} + +- (nullable NSNumber *)columns { + return [self.store sdl_objectForName:SDLRPCParameterNameColumns ofClass:NSNumber.class error:nil]; +} + - (void)setCols:(nullable NSNumber *)cols { [self.store sdl_setObject:cols forName:SDLRPCParameterNameColumns]; } diff --git a/SmartDeviceLink/public/SDLSeatMemoryAction.h b/SmartDeviceLink/public/SDLSeatMemoryAction.h index 7dbcf64f8a..6d00a0bd31 100644 --- a/SmartDeviceLink/public/SDLSeatMemoryAction.h +++ b/SmartDeviceLink/public/SDLSeatMemoryAction.h @@ -1,17 +1,62 @@ -// SDLSeatMemoryAction.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" #import "SDLSeatMemoryActionType.h" +NS_ASSUME_NONNULL_BEGIN + + /** * Specify the action to be performed. + * + * @added in SmartDeviceLink 5.0.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLSeatMemoryAction : SDLRPCStruct +/** + * @param idParam - @(idParam) + * @param action - action + * @return A SDLSeatMemoryAction object + */ +- (instancetype)initWithIdParam:(UInt8)idParam action:(SDLSeatMemoryActionType)action; + +/** + * @param idParam - @(idParam) + * @param action - action + * @param label - label + * @return A SDLSeatMemoryAction object + */ +- (instancetype)initWithIdParam:(UInt8)idParam action:(SDLSeatMemoryActionType)action label:(nullable NSString *)label; /** @abstract Constructs a newly allocated SDLSeatMemoryAction object with id, label (max length 100 chars) and action type @@ -20,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN @param action type of action to be performed @return A SDLSeatMemoryAction object */ -- (instancetype)initWithId:(UInt8)id action:(SDLSeatMemoryActionType)action; +- (instancetype)initWithId:(UInt8)id action:(SDLSeatMemoryActionType)action __deprecated_msg("Use initWithIdParam:action:"); /** @abstract Constructs a newly allocated SDLSeatMemoryAction object with id, label (max length 100 chars) and action type @@ -30,15 +75,19 @@ NS_ASSUME_NONNULL_BEGIN @param action type of action to be performed @return A SDLSeatMemoryAction object */ -- (instancetype)initWithId:(UInt8)id label:(nullable NSString*) label action:(SDLSeatMemoryActionType)action; +- (instancetype)initWithId:(UInt8)id label:(nullable NSString*) label action:(SDLSeatMemoryActionType)action __deprecated_msg("Use initWithIdParam:action:label: instead"); + +/** + * {"num_min_value": 1, "num_max_value": 10} + */ +@property (strong, nonatomic) NSNumber *idParam; /** * @abstract id of the action to be performed. * * Required, MinValue- 0 MaxValue= 10 - * */ -@property (strong, nonatomic) NSNumber *id; +@property (strong, nonatomic) NSNumber *id __deprecated_msg("Use idParam instead"); /** * @abstract label of the action to be performed. diff --git a/SmartDeviceLink/public/SDLSeatMemoryAction.m b/SmartDeviceLink/public/SDLSeatMemoryAction.m index 3c2bde0499..eeb49025a0 100644 --- a/SmartDeviceLink/public/SDLSeatMemoryAction.m +++ b/SmartDeviceLink/public/SDLSeatMemoryAction.m @@ -9,6 +9,25 @@ @implementation SDLSeatMemoryAction +- (instancetype)initWithIdParam:(UInt8)idParam action:(SDLSeatMemoryActionType)action { + self = [self init]; + if (!self) { + return nil; + } + self.idParam = @(idParam); + self.action = action; + return self; +} + +- (instancetype)initWithIdParam:(UInt8)idParam action:(SDLSeatMemoryActionType)action label:(nullable NSString *)label { + self = [self initWithIdParam:idParam action:action]; + if (!self) { + return nil; + } + self.label = label; + return self; +} + - (instancetype)initWithId:(UInt8)id action:(SDLSeatMemoryActionType)action { self = [super init]; if (!self) { @@ -31,6 +50,15 @@ - (instancetype)initWithId:(UInt8)id label:(nullable NSString*)label action:(SDL return self; } +- (void)setIdParam:(NSNumber *)idParam { + [self.store sdl_setObject:idParam forName:SDLRPCParameterNameId]; +} + +- (NSNumber *)idParam { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameId ofClass:NSNumber.class error:&error]; +} + - (void)setId:(NSNumber *)id { [self.store sdl_setObject:id forName:SDLRPCParameterNameId]; } diff --git a/SmartDeviceLink/public/SDLSeatMemoryActionType.h b/SmartDeviceLink/public/SDLSeatMemoryActionType.h index 41dbc2a5fb..65a4804b21 100644 --- a/SmartDeviceLink/public/SDLSeatMemoryActionType.h +++ b/SmartDeviceLink/public/SDLSeatMemoryActionType.h @@ -1,5 +1,34 @@ -// SDLSeatMemoryActionType.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLSendHapticData.h b/SmartDeviceLink/public/SDLSendHapticData.h index c4c0f237c5..f5ce034905 100644 --- a/SmartDeviceLink/public/SDLSendHapticData.h +++ b/SmartDeviceLink/public/SDLSendHapticData.h @@ -1,10 +1,34 @@ -// -// SDLSendHapticData.h -// SmartDeviceLink-iOS -// -// Created by Nicole on 8/3/17. -// Copyright © 2017 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 #import "SDLRPCRequest.h" @@ -14,7 +38,9 @@ NS_ASSUME_NONNULL_BEGIN /** - * Sends the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur. + * Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur + * + * @added in SmartDeviceLink 4.5.0 */ @interface SDLSendHapticData : SDLRPCRequest @@ -23,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param hapticRectData Array of spatial data structures */ -- (instancetype)initWithHapticRectData:(NSArray *)hapticRectData; +- (instancetype)initWithHapticRectData:(nullable NSArray *)hapticRectData; /** * Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared diff --git a/SmartDeviceLink/public/SDLSendHapticData.m b/SmartDeviceLink/public/SDLSendHapticData.m index f684b4114a..7d86c77649 100644 --- a/SmartDeviceLink/public/SDLSendHapticData.m +++ b/SmartDeviceLink/public/SDLSendHapticData.m @@ -25,7 +25,7 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithHapticRectData:(NSArray *)hapticRectData { +- (instancetype)initWithHapticRectData:(nullable NSArray *)hapticRectData { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/public/SDLSendHapticDataResponse.h b/SmartDeviceLink/public/SDLSendHapticDataResponse.h index 3be41e56a9..9c0c2bef5d 100644 --- a/SmartDeviceLink/public/SDLSendHapticDataResponse.h +++ b/SmartDeviceLink/public/SDLSendHapticDataResponse.h @@ -1,10 +1,34 @@ -// -// SDLSendHapticDataResponse.h -// SmartDeviceLink-iOS -// -// Created by Nicole on 8/4/17. -// Copyright © 2017 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 "SDLRPCResponse.h" diff --git a/SmartDeviceLink/public/SDLSendLocation.h b/SmartDeviceLink/public/SDLSendLocation.h index ab0d747b4b..be18cc0b33 100644 --- a/SmartDeviceLink/public/SDLSendLocation.h +++ b/SmartDeviceLink/public/SDLSendLocation.h @@ -1,6 +1,34 @@ -// -// SDLSendLocation.h -// SmartDeviceLink +/* + * 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" @@ -18,6 +46,21 @@ NS_ASSUME_NONNULL_BEGIN /// @since RPC 3.0 @interface SDLSendLocation : SDLRPCRequest +/** + * @param longitudeDegrees - longitudeDegrees + * @param latitudeDegrees - latitudeDegrees + * @param locationName - locationName + * @param locationDescription - locationDescription + * @param addressLines - addressLines + * @param phoneNumber - phoneNumber + * @param locationImage - locationImage + * @param timeStamp - timeStamp + * @param address - address + * @param deliveryMode - deliveryMode + * @return A SDLSendLocation object + */ +- (instancetype)initWithLongitudeDegrees:(nullable NSNumber *)longitudeDegrees latitudeDegrees:(nullable NSNumber *)latitudeDegrees locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription addressLines:(nullable NSArray *)addressLines phoneNumber:(nullable NSString *)phoneNumber locationImage:(nullable SDLImage *)locationImage timeStamp:(nullable SDLDateTime *)timeStamp address:(nullable SDLOasisAddress *)address deliveryMode:(nullable SDLDeliveryMode)deliveryMode; + /** Create a `SendLocation` request with an address object, without Lat/Long coordinates. @@ -31,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN @param timeStamp The estimated arrival time for the location (this will also likely be calculated by the nav system later, and may be different than your estimate). This is used to show the user approximately how long it would take to navigate here @return A `SendLocation` object */ -- (instancetype)initWithAddress:(SDLOasisAddress *)address addressLines:(nullable NSArray *)addressLines locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image deliveryMode:(nullable SDLDeliveryMode)deliveryMode timeStamp:(nullable SDLDateTime *)timeStamp; +- (instancetype)initWithAddress:(SDLOasisAddress *)address addressLines:(nullable NSArray *)addressLines locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image deliveryMode:(nullable SDLDeliveryMode)deliveryMode timeStamp:(nullable SDLDateTime *)timeStamp __deprecated_msg("Use another initializer instead"); /** Create a `SendLocation` request with Lat/Long coordinate, not an address object @@ -45,7 +88,7 @@ NS_ASSUME_NONNULL_BEGIN @param image A user-facing image for the location @return A `SendLocation` object */ -- (instancetype)initWithLongitude:(double)longitude latitude:(double)latitude locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription address:(nullable NSArray *)address phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image; +- (instancetype)initWithLongitude:(double)longitude latitude:(double)latitude locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription address:(nullable NSArray *)address phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image __deprecated_msg("Use another initializer instead"); /** Create a `SendLocation` request with Lat/Long coordinate and an address object and let the nav system decide how to parse it @@ -62,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN @param address The address information to be passed to the nav system for determining the route @return A `SendLocation` object */ -- (instancetype)initWithLongitude:(double)longitude latitude:(double)latitude locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription displayAddressLines:(nullable NSArray *)displayAddressLines phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image deliveryMode:(nullable SDLDeliveryMode)deliveryMode timeStamp:(nullable SDLDateTime *)timeStamp address:(nullable SDLOasisAddress *)address; +- (instancetype)initWithLongitude:(double)longitude latitude:(double)latitude locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription displayAddressLines:(nullable NSArray *)displayAddressLines phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image deliveryMode:(nullable SDLDeliveryMode)deliveryMode timeStamp:(nullable SDLDateTime *)timeStamp address:(nullable SDLOasisAddress *)address __deprecated_msg("Use another initializer instead"); /** * The longitudinal coordinate of the location. Either the latitude / longitude OR the `address` must be provided. diff --git a/SmartDeviceLink/public/SDLSendLocation.m b/SmartDeviceLink/public/SDLSendLocation.m index a63db0cae2..1f0016a0db 100644 --- a/SmartDeviceLink/public/SDLSendLocation.m +++ b/SmartDeviceLink/public/SDLSendLocation.m @@ -24,6 +24,24 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithLongitudeDegrees:(nullable NSNumber *)longitudeDegrees latitudeDegrees:(nullable NSNumber *)latitudeDegrees locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription addressLines:(nullable NSArray *)addressLines phoneNumber:(nullable NSString *)phoneNumber locationImage:(nullable SDLImage *)locationImage timeStamp:(nullable SDLDateTime *)timeStamp address:(nullable SDLOasisAddress *)address deliveryMode:(nullable SDLDeliveryMode)deliveryMode { + self = [self init]; + if (!self) { + return nil; + } + self.longitudeDegrees = longitudeDegrees; + self.latitudeDegrees = latitudeDegrees; + self.locationName = locationName; + self.locationDescription = locationDescription; + self.addressLines = addressLines; + self.phoneNumber = phoneNumber; + self.locationImage = locationImage; + self.timeStamp = timeStamp; + self.address = address; + self.deliveryMode = deliveryMode; + return self; +} + - (instancetype)initWithAddress:(SDLOasisAddress *)address addressLines:(nullable NSArray *)addressLines locationName:(nullable NSString *)locationName locationDescription:(nullable NSString *)locationDescription phoneNumber:(nullable NSString *)phoneNumber image:(nullable SDLImage *)image deliveryMode:(nullable SDLDeliveryMode)deliveryMode timeStamp:(nullable SDLDateTime *)timeStamp { self = [self init]; if (!self) { return nil; } diff --git a/SmartDeviceLink/public/SDLSendLocationResponse.h b/SmartDeviceLink/public/SDLSendLocationResponse.h index 35bcc56317..9ad8a61ad5 100644 --- a/SmartDeviceLink/public/SDLSendLocationResponse.h +++ b/SmartDeviceLink/public/SDLSendLocationResponse.h @@ -1,6 +1,34 @@ -// -// SDLSendLocationResponse.h -// SmartDeviceLink-iOS +/* + * 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" diff --git a/SmartDeviceLink/public/SDLServiceUpdateReason.h b/SmartDeviceLink/public/SDLServiceUpdateReason.h index 6a8b6fbbed..6a326e3631 100644 --- a/SmartDeviceLink/public/SDLServiceUpdateReason.h +++ b/SmartDeviceLink/public/SDLServiceUpdateReason.h @@ -1,10 +1,34 @@ -// -// SDLServiceUpdateReason.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLSetAppIcon.h b/SmartDeviceLink/public/SDLSetAppIcon.h index 53f3531b52..0b3155ff05 100644 --- a/SmartDeviceLink/public/SDLSetAppIcon.h +++ b/SmartDeviceLink/public/SDLSetAppIcon.h @@ -1,34 +1,72 @@ -// SDLSetAppIcon.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" +NS_ASSUME_NONNULL_BEGIN + /** * Used to set existing local file on SDL as the app's icon. Not supported on * first generation SDL modules. *

* - * Since SmartDeviceLink 2.0 + * Since SmartDeviceLink 3.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLSetAppIcon : SDLRPCRequest +/** + * @param sdlFileName - sdlFileName + * @return A SDLSetAppIcon object + */ +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName; + /// Convenience init to set an image icon from a file name. The file must already be uploaded to the head unit. /// /// @param fileName A file reference name /// @return An SDLSetAppIcon object -- (instancetype)initWithFileName:(NSString *)fileName; +- (instancetype)initWithFileName:(NSString *)fileName __deprecated_msg("Use initWithSdlFileName: instead"); + +/** + * File reference name. + * {"string_min_length": 1, "string_max_length": 500} + */ +@property (strong, nonatomic) NSString *sdlFileName; /** - * A file reference name - * @discussion A String value representing a file reference name - *

- * Notes: Maxlength=500 + * File reference name. + * {"string_min_length": 1, "string_max_length": 500} */ -@property (strong, nonatomic) NSString *syncFileName; +@property (strong, nonatomic) NSString *syncFileName __deprecated_msg("Use sdlFileName instead"); @end diff --git a/SmartDeviceLink/public/SDLSetAppIcon.m b/SmartDeviceLink/public/SDLSetAppIcon.m index 6d7de66f87..f73247d966 100644 --- a/SmartDeviceLink/public/SDLSetAppIcon.m +++ b/SmartDeviceLink/public/SDLSetAppIcon.m @@ -19,6 +19,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSdlFileName:(NSString *)sdlFileName { + self = [self init]; + if (!self) { + return nil; + } + self.sdlFileName = sdlFileName; + return self; +} + - (instancetype)initWithFileName:(NSString *)fileName { self = [self init]; if (!self) { @@ -30,6 +39,15 @@ - (instancetype)initWithFileName:(NSString *)fileName { return self; } +- (void)setSdlFileName:(NSString *)sdlFileName { + [self.parameters sdl_setObject:sdlFileName forName:SDLRPCParameterNameSyncFileName]; +} + +- (NSString *)sdlFileName { + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSyncFileName ofClass:NSString.class error:&error]; +} + - (void)setSyncFileName:(NSString *)syncFileName { [self.parameters sdl_setObject:syncFileName forName:SDLRPCParameterNameSyncFileName]; } diff --git a/SmartDeviceLink/public/SDLSetAppIconResponse.h b/SmartDeviceLink/public/SDLSetAppIconResponse.h index 80fee988f5..9bf9a5d54e 100644 --- a/SmartDeviceLink/public/SDLSetAppIconResponse.h +++ b/SmartDeviceLink/public/SDLSetAppIconResponse.h @@ -1,5 +1,34 @@ -// SDLSetAppIconResponse.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" diff --git a/SmartDeviceLink/public/SDLSetCloudAppProperties.h b/SmartDeviceLink/public/SDLSetCloudAppProperties.h index eadcded167..216eebce31 100644 --- a/SmartDeviceLink/public/SDLSetCloudAppProperties.h +++ b/SmartDeviceLink/public/SDLSetCloudAppProperties.h @@ -1,10 +1,34 @@ -// -// SDLSetCloudAppProperties.h -// SmartDeviceLink -// -// Created by Nicole on 2/26/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" @@ -14,7 +38,9 @@ NS_ASSUME_NONNULL_BEGIN /** - * RPC used to enable/disable a cloud application and set authentication data + * RPC used to enable/disable a cloud application and set its cloud-related policy properties + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLSetCloudAppProperties : SDLRPCRequest diff --git a/SmartDeviceLink/public/SDLSetCloudAppPropertiesResponse.h b/SmartDeviceLink/public/SDLSetCloudAppPropertiesResponse.h index 8e4d39753d..fa8b778906 100644 --- a/SmartDeviceLink/public/SDLSetCloudAppPropertiesResponse.h +++ b/SmartDeviceLink/public/SDLSetCloudAppPropertiesResponse.h @@ -1,17 +1,43 @@ -// -// SDLSetCloudAppPropertiesResponse.h -// SmartDeviceLink -// -// Created by Nicole on 2/26/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 "SDLRPCResponse.h" NS_ASSUME_NONNULL_BEGIN /** - * The response to SetCloudAppProperties + * The response to SetCloudAppProperties + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLSetCloudAppPropertiesResponse : SDLRPCResponse diff --git a/SmartDeviceLink/public/SDLSetDisplayLayout.h b/SmartDeviceLink/public/SDLSetDisplayLayout.h index a9dab66e4b..9367e1d515 100644 --- a/SmartDeviceLink/public/SDLSetDisplayLayout.h +++ b/SmartDeviceLink/public/SDLSetDisplayLayout.h @@ -1,5 +1,34 @@ -// SDLSetDisplayLayout.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" @@ -11,14 +40,28 @@ NS_ASSUME_NONNULL_BEGIN /** - * Used to set an alternate display layout. If not sent, default screen for - * given platform will be shown + * This RPC is deprecated. Use Show RPC to change layout. * - * Since SmartDeviceLink 2.0 + * @deprecated in SmartDeviceLink 6.0.0 + * @added in SmartDeviceLink 3.0.0 */ __deprecated_msg("Use SDLManager.screenManager.changeLayout() instead") @interface SDLSetDisplayLayout : SDLRPCRequest +/** + * @param displayLayout - displayLayout + * @return A SDLSetDisplayLayout object + */ +- (instancetype)initWithDisplayLayout:(NSString *)displayLayout; + +/** + * @param displayLayout - displayLayout + * @param dayColorScheme - dayColorScheme + * @param nightColorScheme - nightColorScheme + * @return A SDLSetDisplayLayout object + */ +- (instancetype)initWithDisplayLayout:(NSString *)displayLayout dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme; + /// Convenience init to set a display layout /// /// @param predefinedLayout A template layout an app uses to display information @@ -29,7 +72,7 @@ __deprecated_msg("Use SDLManager.screenManager.changeLayout() instead") /// /// @param displayLayout A display layout name /// @return An SDLSetDisplayLayout object -- (instancetype)initWithLayout:(NSString *)displayLayout; +- (instancetype)initWithLayout:(NSString *)displayLayout __deprecated_msg("Use initWithDisplayLayout: instead"); /// Convenience init to set a display layout /// @@ -37,14 +80,14 @@ __deprecated_msg("Use SDLManager.screenManager.changeLayout() instead") /// @param dayColorScheme The color scheme to be used on a head unit using a "light" or "day" color scheme /// @param nightColorScheme The color scheme to be used on a head unit using a "dark" or "night" color scheme /// @return An SDLSetDisplayLayout object -- (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout)predefinedLayout dayColorScheme:(SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(SDLTemplateColorScheme *)nightColorScheme; +- (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout)predefinedLayout dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme; /// Convenience init to set a display layout /// @param displayLayout A display layout name /// @param dayColorScheme The color scheme to be used on a head unit using a "light" or "day" color scheme /// @param nightColorScheme The color scheme to be used on a head unit using a "dark" or "night" color scheme /// @return An SDLSetDisplayLayout object -- (instancetype)initWithLayout:(NSString *)displayLayout dayColorScheme:(SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(SDLTemplateColorScheme *)nightColorScheme; +- (instancetype)initWithLayout:(NSString *)displayLayout dayColorScheme:(SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(SDLTemplateColorScheme *)nightColorScheme __deprecated_msg("Use initWithDisplayLayout:dayColorScheme:nightColorScheme: instead"); /** * A display layout. Predefined or dynamically created screen layout. diff --git a/SmartDeviceLink/public/SDLSetDisplayLayout.m b/SmartDeviceLink/public/SDLSetDisplayLayout.m index 397a489670..d3df4f4853 100644 --- a/SmartDeviceLink/public/SDLSetDisplayLayout.m +++ b/SmartDeviceLink/public/SDLSetDisplayLayout.m @@ -25,6 +25,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithDisplayLayout:(NSString *)displayLayout { + self = [self init]; + if (!self) { + return nil; + } + self.displayLayout = displayLayout; + return self; +} + +- (instancetype)initWithDisplayLayout:(NSString *)displayLayout dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme { + self = [self initWithDisplayLayout:displayLayout]; + if (!self) { + return nil; + } + self.dayColorScheme = dayColorScheme; + self.nightColorScheme = nightColorScheme; + return self; +} + - (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout)predefinedLayout { return [self initWithLayout:predefinedLayout]; } @@ -40,7 +59,7 @@ - (instancetype)initWithLayout:(NSString *)displayLayout { return self; } -- (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout)predefinedLayout dayColorScheme:(SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(SDLTemplateColorScheme *)nightColorScheme { +- (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout)predefinedLayout dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme { return [self initWithLayout:predefinedLayout dayColorScheme:dayColorScheme nightColorScheme:nightColorScheme]; } diff --git a/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.h b/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.h index 21d4f103f8..d54f1e5d47 100644 --- a/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.h +++ b/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.h @@ -1,5 +1,34 @@ -// SDLSetDisplayLayoutResponse.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" @@ -12,13 +41,23 @@ NS_ASSUME_NONNULL_BEGIN /** - Response to SDLSetDisplayLayout - - Since SmartDeviceLink 2.0 + * This RPC is deprecated. Use Show RPC to change layout. + * + * @deprecated in SmartDeviceLink 6.0.0 + * @added in SmartDeviceLink 3.0.0 */ __deprecated_msg("Use SDLManager.screenManager.changeLayout() instead") @interface SDLSetDisplayLayoutResponse : SDLRPCResponse +/** + * @param displayCapabilities - displayCapabilities + * @param buttonCapabilities - buttonCapabilities + * @param softButtonCapabilities - softButtonCapabilities + * @param presetBankCapabilities - presetBankCapabilities + * @return A SDLSetDisplayLayoutResponse object + */ +- (instancetype)initWithDisplayCapabilities:(nullable SDLDisplayCapabilities *)displayCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities softButtonCapabilities:(nullable NSArray *)softButtonCapabilities presetBankCapabilities:(nullable SDLPresetBankCapabilities *)presetBankCapabilities; + /** The display capabilities of the new template layout */ diff --git a/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.m b/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.m index 7d3380b7b9..70f9eb5a69 100644 --- a/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.m +++ b/SmartDeviceLink/public/SDLSetDisplayLayoutResponse.m @@ -28,6 +28,18 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithDisplayCapabilities:(nullable SDLDisplayCapabilities *)displayCapabilities buttonCapabilities:(nullable NSArray *)buttonCapabilities softButtonCapabilities:(nullable NSArray *)softButtonCapabilities presetBankCapabilities:(nullable SDLPresetBankCapabilities *)presetBankCapabilities { + self = [self init]; + if (!self) { + return nil; + } + self.displayCapabilities = displayCapabilities; + self.buttonCapabilities = buttonCapabilities; + self.softButtonCapabilities = softButtonCapabilities; + self.presetBankCapabilities = presetBankCapabilities; + return self; +} + - (void)setDisplayCapabilities:(nullable SDLDisplayCapabilities *)displayCapabilities { [self.parameters sdl_setObject:displayCapabilities forName:SDLRPCParameterNameDisplayCapabilities]; } diff --git a/SmartDeviceLink/public/SDLSetGlobalProperties.h b/SmartDeviceLink/public/SDLSetGlobalProperties.h index 6968f8332e..bb0df74dde 100644 --- a/SmartDeviceLink/public/SDLSetGlobalProperties.h +++ b/SmartDeviceLink/public/SDLSetGlobalProperties.h @@ -1,5 +1,34 @@ -// SDLSetGlobalProperties.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" @@ -14,29 +43,12 @@ NS_ASSUME_NONNULL_BEGIN /** - Sets global property values - - Since SmartDeviceLink 1.0 - - See SDLResetGlobalProperties + * Allows setting global properties. + * + * @added in SmartDeviceLink 1.0.0 */ @interface SDLSetGlobalProperties : SDLRPCRequest -/** - Initialize SetGlobalProperties with all possible items - - @param helpText A string that will be turned into TTS chunks for the help prompt - @param timeoutText A string that will be turned into TTS chunks for the timeout prompt - @param vrHelpTitle The title of the help interface prompt - @param vrHelp The items of the help interface prompt - @param menuTitle The title of the menu button - @param menuIcon The icon on the menu button - @param keyboardProperties The properties of a keyboard prompt - @param menuLayout The layout of the top-level main menu - @return The SetGlobalProperties RPC - */ -- (instancetype)initWithHelpText:(nullable NSString *)helpText timeoutText:(nullable NSString *)timeoutText vrHelpTitle:(nullable NSString *)vrHelpTitle vrHelp:(nullable NSArray *)vrHelp menuTitle:(nullable NSString *)menuTitle menuIcon:(nullable SDLImage *)menuIcon keyboardProperties:(nullable SDLKeyboardProperties *)keyboardProperties menuLayout:(nullable SDLMenuLayout)menuLayout __deprecated_msg("Use initWithUserLocation:helpPrompt:timeoutPrompt:vrHelpTitle:vrHelp:menuTitle:menuIcon:keyboardProperties:menuLayout: instead"); - /** * Convenience init for setting all possible global properties * @@ -53,6 +65,21 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithUserLocation:(nullable SDLSeatLocation *)userLocation helpPrompt:(nullable NSArray *)helpPrompt timeoutPrompt:(nullable NSArray *)timeoutPrompt vrHelpTitle:(nullable NSString *)vrHelpTitle vrHelp:(nullable NSArray *)vrHelp menuTitle:(nullable NSString *)menuTitle menuIcon:(nullable SDLImage *)menuIcon keyboardProperties:(nullable SDLKeyboardProperties *)keyboardProperties menuLayout:(nullable SDLMenuLayout)menuLayout; +/** + Initialize SetGlobalProperties with all possible items + + @param helpText A string that will be turned into TTS chunks for the help prompt + @param timeoutText A string that will be turned into TTS chunks for the timeout prompt + @param vrHelpTitle The title of the help interface prompt + @param vrHelp The items of the help interface prompt + @param menuTitle The title of the menu button + @param menuIcon The icon on the menu button + @param keyboardProperties The properties of a keyboard prompt + @param menuLayout The layout of the top-level main menu + @return The SetGlobalProperties RPC + */ +- (instancetype)initWithHelpText:(nullable NSString *)helpText timeoutText:(nullable NSString *)timeoutText vrHelpTitle:(nullable NSString *)vrHelpTitle vrHelp:(nullable NSArray *)vrHelp menuTitle:(nullable NSString *)menuTitle menuIcon:(nullable SDLImage *)menuIcon keyboardProperties:(nullable SDLKeyboardProperties *)keyboardProperties menuLayout:(nullable SDLMenuLayout)menuLayout __deprecated_msg("Use initWithUserLocation:helpPrompt:timeoutPrompt:vrHelpTitle:vrHelp:menuTitle:menuIcon:keyboardProperties:menuLayout: instead"); + /** Help prompt for when the user asks for help with an interface prompt diff --git a/SmartDeviceLink/public/SDLSetGlobalPropertiesResponse.h b/SmartDeviceLink/public/SDLSetGlobalPropertiesResponse.h index 6e9bb3c6dd..8fb2d632bb 100644 --- a/SmartDeviceLink/public/SDLSetGlobalPropertiesResponse.h +++ b/SmartDeviceLink/public/SDLSetGlobalPropertiesResponse.h @@ -1,5 +1,34 @@ -// SDLSetGlobalPropertiesResponse.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" diff --git a/SmartDeviceLink/public/SDLSetInteriorVehicleData.h b/SmartDeviceLink/public/SDLSetInteriorVehicleData.h index fdc1d312ed..1828bab369 100644 --- a/SmartDeviceLink/public/SDLSetInteriorVehicleData.h +++ b/SmartDeviceLink/public/SDLSetInteriorVehicleData.h @@ -1,18 +1,47 @@ -// -// SDLSetInteriorVehicleData.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 SDLModuleData; +NS_ASSUME_NONNULL_BEGIN + /** * This RPC allows a remote control type mobile application to * change the settings of a specific remote control module. + * + * @added in SmartDeviceLink 4.5.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLSetInteriorVehicleData : SDLRPCRequest /// Convenience init to change settings of a module diff --git a/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.h b/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.h index 57690e0138..b135b56537 100644 --- a/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.h @@ -1,6 +1,34 @@ -// -// SDLSetInteriorVehicleDataResponse.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" @class SDLModuleData; @@ -8,10 +36,18 @@ NS_ASSUME_NONNULL_BEGIN /** - Response to SDLSetInteriorVehicleData + * Used to set the values of one remote control module + * + * @added in SmartDeviceLink 4.5.0 */ @interface SDLSetInteriorVehicleDataResponse : SDLRPCResponse +/** + * @param moduleData - moduleData + * @return A SDLSetInteriorVehicleDataResponse object + */ +- (instancetype)initWithModuleData:(nullable SDLModuleData *)moduleData; + /** The new module data for the requested module diff --git a/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.m b/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.m index c99551675c..775197dafc 100644 --- a/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLSetInteriorVehicleDataResponse.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithModuleData:(nullable SDLModuleData *)moduleData { + self = [self init]; + if (!self) { + return nil; + } + self.moduleData = moduleData; + return self; +} + - (void)setModuleData:(nullable SDLModuleData *)moduleData { [self.parameters sdl_setObject:moduleData forName:SDLRPCParameterNameModuleData]; } diff --git a/SmartDeviceLink/public/SDLSetMediaClockTimer.h b/SmartDeviceLink/public/SDLSetMediaClockTimer.h index 4c8ccdd892..e4642d2f6d 100644 --- a/SmartDeviceLink/public/SDLSetMediaClockTimer.h +++ b/SmartDeviceLink/public/SDLSetMediaClockTimer.h @@ -1,5 +1,34 @@ -// SDLSetMediaClockTimer.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" @@ -8,6 +37,8 @@ @class SDLStartTime; +NS_ASSUME_NONNULL_BEGIN + /** * Sets the media clock/timer value and the update method (e.g.count-up, * count-down, etc.) @@ -18,10 +49,33 @@ * * Since SmartDeviceLink 1.0 */ +@interface SDLSetMediaClockTimer : SDLRPCRequest -NS_ASSUME_NONNULL_BEGIN +/** + * @param updateMode - updateMode + * @return A SDLSetMediaClockTimer object + */ +- (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode; -@interface SDLSetMediaClockTimer : SDLRPCRequest +/** + * @param updateMode - updateMode + * @param startTime - startTime + * @param endTime - endTime + * @param audioStreamingIndicator - audioStreamingIndicator + * @return A SDLSetMediaClockTimer object + */ +- (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode startTime:(nullable SDLStartTime *)startTime endTime:(nullable SDLStartTime *)endTime audioStreamingIndicator:(nullable SDLAudioStreamingIndicator)audioStreamingIndicator; + +/** + Create a SetMediaClockTimer RPC with all available parameters. It's recommended to use the specific initializers above. + + @param updateMode The type of SetMediaClockTimer RPC + @param startTime The start time. Only valid in some updateModes. + @param endTime The end time. Only valid in some updateModes. + @param playPauseIndicator The display of the play/pause button + @return An object of SetMediaClockTimer + */ +- (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode startTime:(nullable SDLStartTime *)startTime endTime:(nullable SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(init(updateMode:startTime:endTime:playPauseIndicator:)) __deprecated_msg("Use initWithUpdateMode:startTime:endTime:audioStreamingIndicator: instead"); /** Create a media clock timer that counts up, e.g from 0:00 to 4:18. @@ -115,17 +169,6 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)clearWithPlayPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(clear(playPauseIndicator:)); -/** - Create a SetMediaClockTimer RPC with all available parameters. It's recommended to use the specific initializers above. - - @param updateMode The type of SetMediaClockTimer RPC - @param startTime The start time. Only valid in some updateModes. - @param endTime The end time. Only valid in some updateModes. - @param playPauseIndicator The display of the play/pause button - @return An object of SetMediaClockTimer - */ -- (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode startTime:(nullable SDLStartTime *)startTime endTime:(nullable SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(init(updateMode:startTime:endTime:playPauseIndicator:)); - /** * A Start Time with specifying hour, minute, second values * diff --git a/SmartDeviceLink/public/SDLSetMediaClockTimer.m b/SmartDeviceLink/public/SDLSetMediaClockTimer.m index bfbf77ec12..41be1391de 100644 --- a/SmartDeviceLink/public/SDLSetMediaClockTimer.m +++ b/SmartDeviceLink/public/SDLSetMediaClockTimer.m @@ -22,6 +22,26 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode { + self = [self init]; + if (!self) { + return nil; + } + self.updateMode = updateMode; + return self; +} + +- (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode startTime:(nullable SDLStartTime *)startTime endTime:(nullable SDLStartTime *)endTime audioStreamingIndicator:(nullable SDLAudioStreamingIndicator)audioStreamingIndicator { + self = [self initWithUpdateMode:updateMode]; + if (!self) { + return nil; + } + self.startTime = startTime; + self.endTime = endTime; + self.audioStreamingIndicator = audioStreamingIndicator; + return self; +} + - (instancetype)initWithUpdateMode:(SDLUpdateMode)updateMode startTime:(nullable SDLStartTime *)startTime endTime:(nullable SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { self = [self init]; if (!self) { return nil; } @@ -38,45 +58,45 @@ + (instancetype)countUpFromStartTimeInterval:(NSTimeInterval)startTime toEndTime SDLStartTime *startTimeRPC = [[SDLStartTime alloc] initWithTimeInterval:startTime]; SDLStartTime *endTimeRPC = [[SDLStartTime alloc] initWithTimeInterval:endTime]; - return [[self alloc] initWithUpdateMode:SDLUpdateModeCountUp startTime:startTimeRPC endTime:endTimeRPC playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModeCountUp startTime:startTimeRPC endTime:endTimeRPC audioStreamingIndicator:playPauseIndicator]; } + (instancetype)countUpFromStartTime:(SDLStartTime *)startTime toEndTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { - return [[self alloc] initWithUpdateMode:SDLUpdateModeCountUp startTime:startTime endTime:endTime playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModeCountUp startTime:startTime endTime:endTime audioStreamingIndicator:playPauseIndicator]; } + (instancetype)countDownFromStartTimeInterval:(NSTimeInterval)startTime toEndTimeInterval:(NSTimeInterval)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { SDLStartTime *startTimeRPC = [[SDLStartTime alloc] initWithTimeInterval:startTime]; SDLStartTime *endTimeRPC = [[SDLStartTime alloc] initWithTimeInterval:endTime]; - return [[self alloc] initWithUpdateMode:SDLUpdateModeCountDown startTime:startTimeRPC endTime:endTimeRPC playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModeCountDown startTime:startTimeRPC endTime:endTimeRPC audioStreamingIndicator:playPauseIndicator]; } + (instancetype)countDownFromStartTime:(SDLStartTime *)startTime toEndTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { - return [[self alloc] initWithUpdateMode:SDLUpdateModeCountDown startTime:startTime endTime:endTime playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModeCountDown startTime:startTime endTime:endTime audioStreamingIndicator:playPauseIndicator]; } + (instancetype)pauseWithPlayPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { - return [[self alloc] initWithUpdateMode:SDLUpdateModePause startTime:nil endTime:nil playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModePause startTime:nil endTime:nil audioStreamingIndicator:playPauseIndicator]; } + (instancetype)updatePauseWithNewStartTimeInterval:(NSTimeInterval)startTime endTimeInterval:(NSTimeInterval)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { SDLStartTime *startTimeRPC = [[SDLStartTime alloc] initWithTimeInterval:startTime]; SDLStartTime *endTimeRPC = [[SDLStartTime alloc] initWithTimeInterval:endTime]; - return [[self alloc] initWithUpdateMode:SDLUpdateModePause startTime:startTimeRPC endTime:endTimeRPC playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModePause startTime:startTimeRPC endTime:endTimeRPC audioStreamingIndicator:playPauseIndicator]; } + (instancetype)updatePauseWithNewStartTime:(SDLStartTime *)startTime endTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { - return [[self alloc] initWithUpdateMode:SDLUpdateModePause startTime:startTime endTime:endTime playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModePause startTime:startTime endTime:endTime audioStreamingIndicator:playPauseIndicator]; } + (instancetype)resumeWithPlayPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { - return [[self alloc] initWithUpdateMode:SDLUpdateModeResume startTime:nil endTime:nil playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModeResume startTime:nil endTime:nil audioStreamingIndicator:playPauseIndicator]; } + (instancetype)clearWithPlayPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator { - return [[self alloc] initWithUpdateMode:SDLUpdateModeClear startTime:nil endTime:nil playPauseIndicator:playPauseIndicator]; + return [[self alloc] initWithUpdateMode:SDLUpdateModeClear startTime:nil endTime:nil audioStreamingIndicator:playPauseIndicator]; } - (void)setStartTime:(nullable SDLStartTime *)startTime { diff --git a/SmartDeviceLink/public/SDLSetMediaClockTimerResponse.h b/SmartDeviceLink/public/SDLSetMediaClockTimerResponse.h index f6c4438951..8e49d8a277 100644 --- a/SmartDeviceLink/public/SDLSetMediaClockTimerResponse.h +++ b/SmartDeviceLink/public/SDLSetMediaClockTimerResponse.h @@ -1,5 +1,34 @@ -// SDLSetMediaClockTimerResponse.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" diff --git a/SmartDeviceLink/public/SDLShow.h b/SmartDeviceLink/public/SDLShow.h index 723e5fd837..ab29624e86 100644 --- a/SmartDeviceLink/public/SDLShow.h +++ b/SmartDeviceLink/public/SDLShow.h @@ -1,5 +1,34 @@ -// SDLShow.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" @@ -12,6 +41,8 @@ @class SDLTemplateConfiguration; +NS_ASSUME_NONNULL_BEGIN + /** * Updates the application's display text area, regardless of whether or not * this text area is visible to the user at the time of the request. The @@ -34,18 +65,36 @@ * Since SmartDeviceLink 1.0 * See SDLAlert SDLSetMediaClockTimer */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLShow : SDLRPCRequest +/** + * @param mainField1 - mainField1 + * @param mainField2 - mainField2 + * @param mainField3 - mainField3 + * @param mainField4 - mainField4 + * @param alignment - alignment + * @param statusBar - statusBar + * @param mediaClock - mediaClock + * @param mediaTrack - mediaTrack + * @param graphic - graphic + * @param secondaryGraphic - secondaryGraphic + * @param softButtons - softButtons + * @param customPresets - customPresets + * @param metadataTags - metadataTags + * @param templateTitle - templateTitle + * @param windowID - windowID + * @param templateConfiguration - templateConfiguration + * @return A SDLShow object + */ +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic secondaryGraphic:(nullable SDLImage *)secondaryGraphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets metadataTags:(nullable SDLMetadataTags *)metadataTags templateTitle:(nullable NSString *)templateTitle windowID:(nullable NSNumber *)windowID templateConfiguration:(nullable SDLTemplateConfiguration *)templateConfiguration; + /// Convenience init to set template elements with the following parameters /// /// @param mainField1 The text displayed on the first display line /// @param mainField2 The text displayed on the second display line /// @param alignment The alignment that specifies how the text should be aligned on display /// @return An SDLShow object -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment; +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment __deprecated_msg("Use another initializer instead"); /// Convenience init to set template elements with the following parameters /// @@ -55,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param mainField2Type Text field metadata types /// @param alignment The alignment that specifies how the text should be aligned on display /// @return An SDLShow object -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField1Type:(nullable SDLMetadataType)mainField1Type mainField2:(nullable NSString *)mainField2 mainField2Type:(nullable SDLMetadataType)mainField2Type alignment:(nullable SDLTextAlignment)alignment; +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField1Type:(nullable SDLMetadataType)mainField1Type mainField2:(nullable NSString *)mainField2 mainField2Type:(nullable SDLMetadataType)mainField2Type alignment:(nullable SDLTextAlignment)alignment __deprecated_msg("Use another initializer instead"); /// Convenience init to set template elements with the following parameters /// @@ -65,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param mainField4 The text displayed on the fourth display line /// @param alignment The alignment that specifies how the text should be aligned on display /// @return An SDLShow object -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment; +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment __deprecated_msg("Use another initializer instead"); /// Convenience init to set template elements with the following parameters /// @@ -79,7 +128,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param mainField4Type Text field metadata types /// @param alignment The alignment that specifies how the text should be aligned on display /// @return An SDLShow object -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField1Type:(nullable SDLMetadataType)mainField1Type mainField2:(nullable NSString *)mainField2 mainField2Type:(nullable SDLMetadataType)mainField2Type mainField3:(nullable NSString *)mainField3 mainField3Type:(nullable SDLMetadataType)mainField3Type mainField4:(nullable NSString *)mainField4 mainField4Type:(nullable SDLMetadataType)mainField4Type alignment:(nullable SDLTextAlignment)alignment; +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField1Type:(nullable SDLMetadataType)mainField1Type mainField2:(nullable NSString *)mainField2 mainField2Type:(nullable SDLMetadataType)mainField2Type mainField3:(nullable NSString *)mainField3 mainField3Type:(nullable SDLMetadataType)mainField3Type mainField4:(nullable NSString *)mainField4 mainField4Type:(nullable SDLMetadataType)mainField4Type alignment:(nullable SDLTextAlignment)alignment __deprecated_msg("Use another initializer instead"); /// Convenience init to set template elements with the following parameters /// @@ -90,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param mediaClock The value for the mediaClock field /// @param mediaTrack The text in the track field /// @return An SDLShow object -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack; +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack __deprecated_msg("Use another initializer instead"); /// Convenience init to set template elements with the following parameters /// @@ -107,7 +156,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param customPresets The custom presets defined by the App /// @param metadata Text field metadata /// @return An SDLShow object -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets textFieldMetadata:(nullable SDLMetadataTags *)metadata; +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets textFieldMetadata:(nullable SDLMetadataTags *)metadata __deprecated_msg("Use another initializer instead"); /** * The text displayed in a single-line display, or in the upper display diff --git a/SmartDeviceLink/public/SDLShow.m b/SmartDeviceLink/public/SDLShow.m index c42295dd1b..d57a5ad656 100644 --- a/SmartDeviceLink/public/SDLShow.m +++ b/SmartDeviceLink/public/SDLShow.m @@ -26,6 +26,30 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic secondaryGraphic:(nullable SDLImage *)secondaryGraphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets metadataTags:(nullable SDLMetadataTags *)metadataTags templateTitle:(nullable NSString *)templateTitle windowID:(nullable NSNumber *)windowID templateConfiguration:(nullable SDLTemplateConfiguration *)templateConfiguration { + self = [self init]; + if (!self) { + return nil; + } + self.mainField1 = mainField1; + self.mainField2 = mainField2; + self.mainField3 = mainField3; + self.mainField4 = mainField4; + self.alignment = alignment; + self.statusBar = statusBar; + self.mediaClock = mediaClock; + self.mediaTrack = mediaTrack; + self.graphic = graphic; + self.secondaryGraphic = secondaryGraphic; + self.softButtons = softButtons; + self.customPresets = customPresets; + self.metadataTags = metadataTags; + self.templateTitle = templateTitle; + self.windowID = windowID; + self.templateConfiguration = templateConfiguration; + return self; +} + - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment { return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:nil mainField4:nil alignment:alignment]; } diff --git a/SmartDeviceLink/public/SDLShowAppMenu.h b/SmartDeviceLink/public/SDLShowAppMenu.h index a7ca2cf0f1..b2672e4deb 100644 --- a/SmartDeviceLink/public/SDLShowAppMenu.h +++ b/SmartDeviceLink/public/SDLShowAppMenu.h @@ -1,10 +1,34 @@ -// -// SDLOpenMenu.h -// SmartDeviceLink -// -// Created by Justin Gluck on 7/12/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" @@ -17,13 +41,19 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLShowAppMenu : SDLRPCRequest +/** + * @param menuID - menuID + * @return A SDLShowAppMenu object + */ +- (instancetype)initWithMenuIDParam:(nullable NSNumber *)menuID __deprecated_msg("Eventually an initializer without param will be added"); + /** Creates a ShowAppMenu RPC to open the app menu directly to a AddSubMenu RPC's submenu. @param menuID The ID of the AddSubMenu to open @return SDLShowAppMenu RPCRequest */ -- (instancetype)initWithMenuID:(UInt32)menuID; +- (instancetype)initWithMenuID:(UInt32)menuID __deprecated_msg("Eventually this will be replaced by an initializer with different parameter types"); /** A Menu ID that identifies the AddSubMenu to open if it correlates with the AddSubMenu menuID parameter. If not set the top level menu will be opened. diff --git a/SmartDeviceLink/public/SDLShowAppMenu.m b/SmartDeviceLink/public/SDLShowAppMenu.m index 7d7a5fc236..65971c7af5 100644 --- a/SmartDeviceLink/public/SDLShowAppMenu.m +++ b/SmartDeviceLink/public/SDLShowAppMenu.m @@ -24,6 +24,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithMenuIDParam:(nullable NSNumber *)menuID { + self = [self init]; + if (!self) { + return nil; + } + self.menuID = menuID; + return self; +} + - (instancetype)initWithMenuID:(UInt32)menuID { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLShowAppMenuResponse.h b/SmartDeviceLink/public/SDLShowAppMenuResponse.h index d5acd4c342..d1f4126a33 100644 --- a/SmartDeviceLink/public/SDLShowAppMenuResponse.h +++ b/SmartDeviceLink/public/SDLShowAppMenuResponse.h @@ -1,10 +1,34 @@ -// -// SDLOpenMenuResponse.h -// SmartDeviceLink -// -// Created by Justin Gluck on 7/12/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 "SDLRPCResponse.h" diff --git a/SmartDeviceLink/public/SDLShowConstantTBT.h b/SmartDeviceLink/public/SDLShowConstantTBT.h index 3ac01780dd..27c63ca9a9 100644 --- a/SmartDeviceLink/public/SDLShowConstantTBT.h +++ b/SmartDeviceLink/public/SDLShowConstantTBT.h @@ -1,5 +1,34 @@ -// SDLShowConstantTBT.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" @@ -16,6 +45,22 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLShowConstantTBT : SDLRPCRequest +/** + * @param navigationText1 - navigationText1 + * @param navigationText2 - navigationText2 + * @param eta - eta + * @param timeToDestination - timeToDestination + * @param totalDistance - totalDistance + * @param turnIcon - turnIcon + * @param nextTurnIcon - nextTurnIcon + * @param distanceToManeuver - distanceToManeuver + * @param distanceToManeuverScale - distanceToManeuverScale + * @param maneuverComplete - maneuverComplete + * @param softButtons - softButtons + * @return A SDLShowConstantTBT object + */ +- (instancetype)initWithNavigationText1Param:(nullable NSString *)navigationText1 navigationText2:(nullable NSString *)navigationText2 eta:(nullable NSString *)eta timeToDestination:(nullable NSString *)timeToDestination totalDistance:(nullable NSString *)totalDistance turnIcon:(nullable SDLImage *)turnIcon nextTurnIcon:(nullable SDLImage *)nextTurnIcon distanceToManeuver:(nullable NSNumber *)distanceToManeuver distanceToManeuverScale:(nullable NSNumber *)distanceToManeuverScale maneuverComplete:(nullable NSNumber *)maneuverComplete softButtons:(nullable NSArray *)softButtons __deprecated_msg("Eventually an initializer without param will be added"); + /// Convenience init to create navigation directions /// /// @param navigationText1 The first line of text in a multi-line overlay screen @@ -30,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param maneuverComplete If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay. If omitted the value will be assumed as FALSE /// @param softButtons Three dynamic SoftButtons available (first SoftButton is fixed to "Turns") /// @return An SDLShowConstantTBT object -- (instancetype)initWithNavigationText1:(nullable NSString *)navigationText1 navigationText2:(nullable NSString *)navigationText2 eta:(nullable NSString *)eta timeToDestination:(nullable NSString *)timeToDestination totalDistance:(nullable NSString *)totalDistance turnIcon:(nullable SDLImage *)turnIcon nextTurnIcon:(nullable SDLImage *)nextTurnIcon distanceToManeuver:(double)distanceToManeuver distanceToManeuverScale:(double)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(nullable NSArray *)softButtons; +- (instancetype)initWithNavigationText1:(nullable NSString *)navigationText1 navigationText2:(nullable NSString *)navigationText2 eta:(nullable NSString *)eta timeToDestination:(nullable NSString *)timeToDestination totalDistance:(nullable NSString *)totalDistance turnIcon:(nullable SDLImage *)turnIcon nextTurnIcon:(nullable SDLImage *)nextTurnIcon distanceToManeuver:(double)distanceToManeuver distanceToManeuverScale:(double)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(nullable NSArray *)softButtons __deprecated_msg("Eventually an initializer with different parameter types will be added"); /** * The first line of text in a multi-line overlay screen. diff --git a/SmartDeviceLink/public/SDLShowConstantTBT.m b/SmartDeviceLink/public/SDLShowConstantTBT.m index 70c2c09a1c..20bc6ba4cb 100644 --- a/SmartDeviceLink/public/SDLShowConstantTBT.m +++ b/SmartDeviceLink/public/SDLShowConstantTBT.m @@ -23,6 +23,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithNavigationText1Param:(nullable NSString *)navigationText1 navigationText2:(nullable NSString *)navigationText2 eta:(nullable NSString *)eta timeToDestination:(nullable NSString *)timeToDestination totalDistance:(nullable NSString *)totalDistance turnIcon:(nullable SDLImage *)turnIcon nextTurnIcon:(nullable SDLImage *)nextTurnIcon distanceToManeuver:(nullable NSNumber *)distanceToManeuver distanceToManeuverScale:(nullable NSNumber *)distanceToManeuverScale maneuverComplete:(nullable NSNumber *)maneuverComplete softButtons:(nullable NSArray *)softButtons { + self = [self init]; + if (!self) { + return nil; + } + self.navigationText1 = navigationText1; + self.navigationText2 = navigationText2; + self.eta = eta; + self.timeToDestination = timeToDestination; + self.totalDistance = totalDistance; + self.turnIcon = turnIcon; + self.nextTurnIcon = nextTurnIcon; + self.distanceToManeuver = distanceToManeuver; + self.distanceToManeuverScale = distanceToManeuverScale; + self.maneuverComplete = maneuverComplete; + self.softButtons = softButtons; + return self; +} + - (instancetype)initWithNavigationText1:(nullable NSString *)navigationText1 navigationText2:(nullable NSString *)navigationText2 eta:(nullable NSString *)eta timeToDestination:(nullable NSString *)timeToDestination totalDistance:(nullable NSString *)totalDistance turnIcon:(nullable SDLImage *)turnIcon nextTurnIcon:(nullable SDLImage *)nextTurnIcon distanceToManeuver:(double)distanceToManeuver distanceToManeuverScale:(double)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(nullable NSArray *)softButtons { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLShowConstantTBTResponse.h b/SmartDeviceLink/public/SDLShowConstantTBTResponse.h index c7db2ceb8a..d0c1049922 100644 --- a/SmartDeviceLink/public/SDLShowConstantTBTResponse.h +++ b/SmartDeviceLink/public/SDLShowConstantTBTResponse.h @@ -1,5 +1,34 @@ -// SDLShowConstantTBTResponse.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" diff --git a/SmartDeviceLink/public/SDLShowResponse.h b/SmartDeviceLink/public/SDLShowResponse.h index 2f69910c7a..40b773ca4f 100644 --- a/SmartDeviceLink/public/SDLShowResponse.h +++ b/SmartDeviceLink/public/SDLShowResponse.h @@ -1,5 +1,34 @@ -// SDLShowResponse.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" diff --git a/SmartDeviceLink/public/SDLSingleTireStatus.h b/SmartDeviceLink/public/SDLSingleTireStatus.h index 9ebe1b32e8..5129f3b2e5 100644 --- a/SmartDeviceLink/public/SDLSingleTireStatus.h +++ b/SmartDeviceLink/public/SDLSingleTireStatus.h @@ -1,5 +1,34 @@ -// SDLSingleTireStatus.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,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSingleTireStatus : SDLRPCStruct +/** + * @param status - status + * @return A SDLSingleTireStatus object + */ +- (instancetype)initWithStatus:(SDLComponentVolumeStatus)status; + +/** + * @param status - status + * @param tpms - tpms + * @param pressure - pressure + * @return A SDLSingleTireStatus object + */ +- (instancetype)initWithStatus:(SDLComponentVolumeStatus)status tpms:(nullable SDLTPMS)tpms pressure:(nullable NSNumber *)pressure; + /** * The volume status of a single tire diff --git a/SmartDeviceLink/public/SDLSingleTireStatus.m b/SmartDeviceLink/public/SDLSingleTireStatus.m index e756e8f690..36e62ace60 100644 --- a/SmartDeviceLink/public/SDLSingleTireStatus.m +++ b/SmartDeviceLink/public/SDLSingleTireStatus.m @@ -11,6 +11,25 @@ @implementation SDLSingleTireStatus +- (instancetype)initWithStatus:(SDLComponentVolumeStatus)status { + self = [self init]; + if (!self) { + return nil; + } + self.status = status; + return self; +} + +- (instancetype)initWithStatus:(SDLComponentVolumeStatus)status tpms:(nullable SDLTPMS)tpms pressure:(nullable NSNumber *)pressure { + self = [self initWithStatus:status]; + if (!self) { + return nil; + } + self.monitoringSystemStatus = tpms; + self.pressure = pressure; + return self; +} + - (void)setStatus:(SDLComponentVolumeStatus)status { [self.store sdl_setObject:status forName:SDLRPCParameterNameStatus]; } diff --git a/SmartDeviceLink/public/SDLSlider.h b/SmartDeviceLink/public/SDLSlider.h index 13cef4c396..5c9fa6cbf1 100644 --- a/SmartDeviceLink/public/SDLSlider.h +++ b/SmartDeviceLink/public/SDLSlider.h @@ -1,5 +1,34 @@ -// SDLSlider.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" @@ -15,6 +44,49 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSlider : SDLRPCRequest +/** + * @param numTicks - @(numTicks) + * @param position - @(position) + * @param sliderHeader - sliderHeader + * @return A SDLSlider object + */ +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader; + +/** + * @param numTicks - @(numTicks) + * @param position - @(position) + * @param sliderHeader - sliderHeader + * @param sliderFooter - sliderFooter + * @param timeout - timeout + * @param cancelID - cancelID + * @return A SDLSlider object + */ +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSArray *)sliderFooter timeout:(nullable NSNumber *)timeout cancelID:(nullable NSNumber *)cancelID; + +/** + Creates a slider with all required data and a static footer (or no footer). + + @param numTicks Number of selectable items on a horizontal axis + @param position Initial position of slider control + @param sliderHeader Text header to display + @param sliderFooter Text footer to display + @param timeout Indicates how long of a timeout from the last action (i.e. sliding control resets timeout) + @return An SDLSlider object + */ ++ (instancetype)staticFooterSliderWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSString *)sliderFooter timeout:(nullable NSNumber *)timeout cancelID:(nullable NSNumber *)cancelID; + +/** + Creates an slider with all required data and a dynamic footer (or no footer). + + @param numTicks Number of selectable items on a horizontal axis + @param position Initial position of slider control + @param sliderHeader Text header to display + @param sliderFooters Text footers to display + @param timeout Indicates how long of a timeout from the last action (i.e. sliding control resets timeout) + @return An SDLSlider object + */ ++ (instancetype)dynamicFooterSliderWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(nullable NSNumber *)timeout cancelID:(nullable NSNumber *)cancelID; + /** Convenience init with all parameters. @@ -26,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN @param cancelID An ID for this specific slider to allow cancellation through the `CancelInteraction` RPC. @return An SDLSlider object */ -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(UInt16)timeout cancelID:(UInt32)cancelID; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(UInt16)timeout cancelID:(UInt32)cancelID __deprecated_msg("Use initWithNumTicks:position:sliderHeader:sliderFooter:timeout:cancelID: instead"); /** Creates a slider with only the number of ticks and position. Note that this is not enough to get a SUCCESS response. You must supply additional data. See below for required parameters. @@ -35,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN @param position Initial position of slider control @return An SDLSlider object */ -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position __deprecated_msg("Use initWithNumTicks:position:sliderHeader: instead"); /** Creates a slider with all required data and a static footer (or no footer). @@ -47,7 +119,7 @@ NS_ASSUME_NONNULL_BEGIN @param timeout Indicates how long of a timeout from the last action (i.e. sliding control resets timeout) @return An SDLSlider object */ -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSString *)sliderFooter timeout:(UInt16)timeout; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSString *)sliderFooter timeout:(UInt16)timeout __deprecated_msg("Use staticFooterSliderWithNumTicks:position:sliderHeader:sliderFooter:timeout: instead"); /** Creates an slider with all required data and a dynamic footer (or no footer). @@ -59,7 +131,7 @@ NS_ASSUME_NONNULL_BEGIN @param timeout Indicates how long of a timeout from the last action (i.e. sliding control resets timeout) @return An SDLSlider object */ -- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(UInt16)timeout; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(UInt16)timeout __deprecated_msg("Use dynamicFooterSliderWithNumTicks:position:sliderHeader:sliderFooters:timeout: instead"); /** Represents a number of selectable items on a horizontal axis. diff --git a/SmartDeviceLink/public/SDLSlider.m b/SmartDeviceLink/public/SDLSlider.m index 488b428d65..4ece6e5092 100644 --- a/SmartDeviceLink/public/SDLSlider.m +++ b/SmartDeviceLink/public/SDLSlider.m @@ -21,6 +21,41 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader { + self = [self init]; + if (!self) { + return nil; + } + self.numTicks = @(numTicks); + self.position = @(position); + self.sliderHeader = sliderHeader; + return self; +} + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSArray *)sliderFooter timeout:(nullable NSNumber *)timeout cancelID:(nullable NSNumber *)cancelID { + self = [self initWithNumTicks:numTicks position:position sliderHeader:sliderHeader]; + if (!self) { + return nil; + } + self.sliderFooter = sliderFooter; + self.timeout = timeout; + self.cancelID = cancelID; + return self; +} + ++ (instancetype)staticFooterSliderWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSString *)sliderFooter timeout:(nullable NSNumber *)timeout cancelID:(nullable NSNumber *)cancelID { + NSArray *footer = nil; + if (sliderFooter != nil) { + footer = @[sliderFooter]; + } + + return [[self alloc] initWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooter:footer timeout:timeout cancelID:cancelID]; +} + ++ (instancetype)dynamicFooterSliderWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(nullable NSNumber *)timeout cancelID:(nullable NSNumber *)cancelID { + return [[self alloc] initWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooter:sliderFooters timeout:timeout cancelID:cancelID]; +} + - (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray *)sliderFooters timeout:(UInt16)timeout cancelID:(UInt32)cancelID { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLSliderResponse.h b/SmartDeviceLink/public/SDLSliderResponse.h index c7f7732d99..563723aeb9 100644 --- a/SmartDeviceLink/public/SDLSliderResponse.h +++ b/SmartDeviceLink/public/SDLSliderResponse.h @@ -1,6 +1,34 @@ -// SDLSliderResponse.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" @@ -13,6 +41,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSliderResponse : SDLRPCResponse +/** + * @param sliderPosition - sliderPosition + * @return A SDLSliderResponse object + */ +- (instancetype)initWithSliderPosition:(nullable NSNumber *)sliderPosition; + /** The selected position of the slider. */ diff --git a/SmartDeviceLink/public/SDLSliderResponse.m b/SmartDeviceLink/public/SDLSliderResponse.m index 6d99851119..eb9d404d05 100644 --- a/SmartDeviceLink/public/SDLSliderResponse.m +++ b/SmartDeviceLink/public/SDLSliderResponse.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithSliderPosition:(nullable NSNumber *)sliderPosition { + self = [self init]; + if (!self) { + return nil; + } + self.sliderPosition = sliderPosition; + return self; +} + - (void)setSliderPosition:(nullable NSNumber *)sliderPosition { [self.parameters sdl_setObject:sliderPosition forName:SDLRPCParameterNameSliderPosition]; } diff --git a/SmartDeviceLink/public/SDLSoftButton.h b/SmartDeviceLink/public/SDLSoftButton.h index 8fffc67274..f495fbbae7 100644 --- a/SmartDeviceLink/public/SDLSoftButton.h +++ b/SmartDeviceLink/public/SDLSoftButton.h @@ -1,5 +1,34 @@ -// SDLSoftButton.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" @@ -13,13 +42,33 @@ NS_ASSUME_NONNULL_BEGIN /** Describes an on-screen button which may be presented in various contexts, e.g. templates or alerts + + @added in SmartDeviceLink 2.0.0 */ @interface SDLSoftButton : SDLRPCStruct +/** + * @param type - type + * @param softButtonID - @(softButtonID) + * @return A SDLSoftButton object + */ +- (instancetype)initWithType:(SDLSoftButtonType)type softButtonID:(UInt16)softButtonID; + +/** + * @param type - type + * @param softButtonID - @(softButtonID) + * @param text - text + * @param image - image + * @param isHighlighted - isHighlighted + * @param systemAction - systemAction + * @return A SDLSoftButton object + */ +- (instancetype)initWithType:(SDLSoftButtonType)type softButtonID:(UInt16)softButtonID text:(nullable NSString *)text image:(nullable SDLImage *)image isHighlighted:(nullable NSNumber *)isHighlighted systemAction:(nullable SDLSystemAction)systemAction; + /// Convenience init /// /// @param handler A handler that may optionally be run when the SDLSoftButton has a corresponding notification occur -- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler; +- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler __deprecated_msg("Use initWithType:softButtonID: instead"); /// Convenience init /// @@ -30,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param buttonId Value which is returned via OnButtonPress / OnButtonEvent /// @param systemAction Parameter indicating whether selecting a SoftButton shall call a specific system action /// @param handler A handler that may optionally be run when the SDLSoftButton has a corresponding notification occur. -- (instancetype)initWithType:(SDLSoftButtonType)type text:(nullable NSString *)text image:(nullable SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(nullable SDLSystemAction)systemAction handler:(nullable SDLRPCButtonNotificationHandler)handler; +- (instancetype)initWithType:(SDLSoftButtonType)type text:(nullable NSString *)text image:(nullable SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(nullable SDLSystemAction)systemAction handler:(nullable SDLRPCButtonNotificationHandler)handler __deprecated_msg("Use initWithType:softButtonID: instead"); /// A handler that may optionally be run when the SDLSoftButton has a corresponding notification occur. @property (copy, nonatomic) SDLRPCButtonNotificationHandler handler; diff --git a/SmartDeviceLink/public/SDLSoftButton.m b/SmartDeviceLink/public/SDLSoftButton.m index 6d1082c488..f02433119c 100644 --- a/SmartDeviceLink/public/SDLSoftButton.m +++ b/SmartDeviceLink/public/SDLSoftButton.m @@ -11,6 +11,28 @@ @implementation SDLSoftButton +- (instancetype)initWithType:(SDLSoftButtonType)type softButtonID:(UInt16)softButtonID { + self = [self init]; + if (!self) { + return nil; + } + self.type = type; + self.softButtonID = @(softButtonID); + return self; +} + +- (instancetype)initWithType:(SDLSoftButtonType)type softButtonID:(UInt16)softButtonID text:(nullable NSString *)text image:(nullable SDLImage *)image isHighlighted:(nullable NSNumber *)isHighlighted systemAction:(nullable SDLSystemAction)systemAction { + self = [self initWithType:type softButtonID:softButtonID]; + if (!self) { + return nil; + } + self.text = text; + self.image = image; + self.isHighlighted = isHighlighted; + self.systemAction = systemAction; + return self; +} + - (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLSoftButtonCapabilities.h b/SmartDeviceLink/public/SDLSoftButtonCapabilities.h index 07d57e276b..50ad3187b6 100644 --- a/SmartDeviceLink/public/SDLSoftButtonCapabilities.h +++ b/SmartDeviceLink/public/SDLSoftButtonCapabilities.h @@ -1,5 +1,34 @@ -// SDLSoftButtonCapabilities.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" @@ -13,6 +42,25 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSoftButtonCapabilities : SDLRPCStruct +/** + * @param shortPressAvailable - @(shortPressAvailable) + * @param longPressAvailable - @(longPressAvailable) + * @param upDownAvailable - @(upDownAvailable) + * @param imageSupported - @(imageSupported) + * @return A SDLSoftButtonCapabilities object + */ +- (instancetype)initWithShortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable imageSupported:(BOOL)imageSupported; + +/** + * @param shortPressAvailable - @(shortPressAvailable) + * @param longPressAvailable - @(longPressAvailable) + * @param upDownAvailable - @(upDownAvailable) + * @param imageSupported - @(imageSupported) + * @param textSupported - textSupported + * @return A SDLSoftButtonCapabilities object + */ +- (instancetype)initWithShortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable imageSupported:(BOOL)imageSupported textSupported:(nullable NSNumber *)textSupported; + /** * The button supports a short press. * diff --git a/SmartDeviceLink/public/SDLSoftButtonCapabilities.m b/SmartDeviceLink/public/SDLSoftButtonCapabilities.m index 6d5ea078d7..6f4b39b27e 100644 --- a/SmartDeviceLink/public/SDLSoftButtonCapabilities.m +++ b/SmartDeviceLink/public/SDLSoftButtonCapabilities.m @@ -11,6 +11,27 @@ @implementation SDLSoftButtonCapabilities +- (instancetype)initWithShortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable imageSupported:(BOOL)imageSupported { + self = [self init]; + if (!self) { + return nil; + } + self.shortPressAvailable = @(shortPressAvailable); + self.longPressAvailable = @(longPressAvailable); + self.upDownAvailable = @(upDownAvailable); + self.imageSupported = @(imageSupported); + return self; +} + +- (instancetype)initWithShortPressAvailable:(BOOL)shortPressAvailable longPressAvailable:(BOOL)longPressAvailable upDownAvailable:(BOOL)upDownAvailable imageSupported:(BOOL)imageSupported textSupported:(nullable NSNumber *)textSupported { + self = [self initWithShortPressAvailable:shortPressAvailable longPressAvailable:longPressAvailable upDownAvailable:upDownAvailable imageSupported:imageSupported]; + if (!self) { + return nil; + } + self.textSupported = textSupported; + return self; +} + - (void)setShortPressAvailable:(NSNumber *)shortPressAvailable { [self.store sdl_setObject:shortPressAvailable forName:SDLRPCParameterNameShortPressAvailable]; } diff --git a/SmartDeviceLink/public/SDLSoftButtonType.h b/SmartDeviceLink/public/SDLSoftButtonType.h index 777f64940f..9a52602cd7 100644 --- a/SmartDeviceLink/public/SDLSoftButtonType.h +++ b/SmartDeviceLink/public/SDLSoftButtonType.h @@ -1,11 +1,42 @@ -// SDLSoftButtonType.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 "SDLEnum.h" /** SoftButtonType (TEXT / IMAGE / BOTH). Used by SoftButton. + + @added in SmartDeviceLink 2.0.0 */ typedef SDLEnum SDLSoftButtonType NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLSpeak.h b/SmartDeviceLink/public/SDLSpeak.h index 31b69d85d4..641b318331 100644 --- a/SmartDeviceLink/public/SDLSpeak.h +++ b/SmartDeviceLink/public/SDLSpeak.h @@ -1,5 +1,34 @@ -// SDLSpeak.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" @@ -45,15 +74,21 @@ NS_ASSUME_NONNULL_BEGIN /// Convenience init to create a speak message /// -/// @param ttsText The text to speak +/// @param ttsChunks An array of TTSChunk structs which, taken together, specify the phrase to be spoken /// @return An SDLSpeak object -- (instancetype)initWithTTS:(NSString *)ttsText; +- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks; /// Convenience init to create a speak message /// -/// @param ttsChunks An array of TTSChunk structs which, taken together, specify the phrase to be spoken +/// @param text The text to speak /// @return An SDLSpeak object -- (instancetype)initWithTTSChunks:(NSArray *)ttsChunks; ++ (instancetype)speakWithText:(NSString *)text; + +/// Convenience init to create a speak message +/// +/// @param ttsText The text to speak +/// @return An SDLSpeak object +- (instancetype)initWithTTS:(NSString *)ttsText __deprecated_msg("Use speakWithText: instead"); /** * An array of TTSChunk structs which, taken together, specify the phrase to be spoken diff --git a/SmartDeviceLink/public/SDLSpeak.m b/SmartDeviceLink/public/SDLSpeak.m index 4a8b182445..8088ee4aa7 100644 --- a/SmartDeviceLink/public/SDLSpeak.m +++ b/SmartDeviceLink/public/SDLSpeak.m @@ -22,11 +22,6 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithTTS:(NSString *)ttsText { - NSArray *ttsChunks = [SDLTTSChunk textChunksFromString:ttsText]; - return [self initWithTTSChunks:ttsChunks]; -} - - (instancetype)initWithTTSChunks:(NSArray *)ttsChunks { self = [self init]; if (!self) { @@ -38,6 +33,15 @@ - (instancetype)initWithTTSChunks:(NSArray *)ttsChunks { return self; } ++ (instancetype)speakWithText:(NSString *)text { + return [[self alloc] initWithTTSChunks:[SDLTTSChunk textChunksFromString:text]]; +} + +- (instancetype)initWithTTS:(NSString *)ttsText { + NSArray *ttsChunks = [SDLTTSChunk textChunksFromString:ttsText]; + return [self initWithTTSChunks:ttsChunks]; +} + - (void)setTtsChunks:(NSArray *)ttsChunks { [self.parameters sdl_setObject:ttsChunks forName:SDLRPCParameterNameTTSChunks]; } diff --git a/SmartDeviceLink/public/SDLSpeakResponse.h b/SmartDeviceLink/public/SDLSpeakResponse.h index 0ae8ce88d3..a761a9ea3d 100644 --- a/SmartDeviceLink/public/SDLSpeakResponse.h +++ b/SmartDeviceLink/public/SDLSpeakResponse.h @@ -1,5 +1,34 @@ -// SDLSpeakResponse.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" diff --git a/SmartDeviceLink/public/SDLSpeechCapabilities.h b/SmartDeviceLink/public/SDLSpeechCapabilities.h index 9749907076..e550a60863 100644 --- a/SmartDeviceLink/public/SDLSpeechCapabilities.h +++ b/SmartDeviceLink/public/SDLSpeechCapabilities.h @@ -1,5 +1,34 @@ -// SDLSpeechCapabilities.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLStartTime.h b/SmartDeviceLink/public/SDLStartTime.h index 05645830e6..6a6284e77d 100644 --- a/SmartDeviceLink/public/SDLStartTime.h +++ b/SmartDeviceLink/public/SDLStartTime.h @@ -1,5 +1,34 @@ -// SDLStartTime.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" diff --git a/SmartDeviceLink/public/SDLStationIDNumber.h b/SmartDeviceLink/public/SDLStationIDNumber.h index 22288c1dbc..d31f63577b 100644 --- a/SmartDeviceLink/public/SDLStationIDNumber.h +++ b/SmartDeviceLink/public/SDLStationIDNumber.h @@ -1,24 +1,52 @@ -//SDLStationIDNumber.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" +NS_ASSUME_NONNULL_BEGIN + /** * Describes the hour, minute and second values used to set the media clock. * - * @since SDL 1.0 + * @since SDL 5.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLStationIDNumber : SDLRPCStruct /// Convenience init /// @param countryCode Binary Representation of ITU Country Code. USA Code is 001 -/// @param id Binary representation of unique facility ID assigned by the FCC +/// @param fccFacilityId Binary representation of unique facility ID assigned by the FCC /// @return An SDLStationIDNumber object -- (instancetype)initWithCountryCode:(nullable NSNumber *)countryCode fccFacilityId:(nullable NSNumber *)id; +- (instancetype)initWithCountryCode:(nullable NSNumber *)countryCode fccFacilityId:(nullable NSNumber *)fccFacilityId; /** * @abstract Binary Representation of ITU Country Code. USA Code is 001. diff --git a/SmartDeviceLink/public/SDLStationIDNumber.m b/SmartDeviceLink/public/SDLStationIDNumber.m index a88afe79ae..f4e4eb5ff3 100644 --- a/SmartDeviceLink/public/SDLStationIDNumber.m +++ b/SmartDeviceLink/public/SDLStationIDNumber.m @@ -9,14 +9,14 @@ @implementation SDLStationIDNumber -- (instancetype)initWithCountryCode:(nullable NSNumber *)countryCode fccFacilityId:(nullable NSNumber *)id { +- (instancetype)initWithCountryCode:(nullable NSNumber *)countryCode fccFacilityId:(nullable NSNumber *)fccFacilityId { self = [self init]; if(!self) { return nil; } self.countryCode = countryCode; - self.fccFacilityId = id; + self.fccFacilityId = fccFacilityId; return self; } diff --git a/SmartDeviceLink/public/SDLSubscribeButton.h b/SmartDeviceLink/public/SDLSubscribeButton.h index 75c058d4db..7148c56c50 100644 --- a/SmartDeviceLink/public/SDLSubscribeButton.h +++ b/SmartDeviceLink/public/SDLSubscribeButton.h @@ -1,5 +1,34 @@ -// SDLSubscribeButton.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 "SDLButtonName.h" #import "SDLNotificationConstants.h" @@ -60,6 +89,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSubscribeButton : SDLRPCRequest +/** + * @param buttonName - buttonName + * @return A SDLSubscribeButton object + */ +- (instancetype)initWithButtonName:(SDLButtonName)buttonName; + /** * Construct a SDLSubscribeButton with a handler callback when an event occurs. * @@ -67,14 +102,14 @@ NS_ASSUME_NONNULL_BEGIN * * @return An SDLSubscribeButton object */ -- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler; +- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler __deprecated_msg("Use initWithButtonName: instead"); /// Construct a SDLSubscribeButton with a handler callback when an event occurs with a button name. /// /// @param buttonName The name of the button to subscribe to /// @param handler A callback that will be called when a button event occurs for the subscribed button /// @return An SDLSubscribeButton object -- (instancetype)initWithButtonName:(SDLButtonName)buttonName handler:(nullable SDLRPCButtonNotificationHandler)handler; +- (instancetype)initWithButtonName:(SDLButtonName)buttonName handler:(nullable SDLRPCButtonNotificationHandler)handler __deprecated_msg("Use initWithButtonName: instead"); /** * A handler that will let you know when the button you subscribed to is selected. diff --git a/SmartDeviceLink/public/SDLSubscribeButton.m b/SmartDeviceLink/public/SDLSubscribeButton.m index b8f25b5c8d..28a303708d 100644 --- a/SmartDeviceLink/public/SDLSubscribeButton.m +++ b/SmartDeviceLink/public/SDLSubscribeButton.m @@ -21,6 +21,15 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithButtonName:(SDLButtonName)buttonName { + self = [self init]; + if (!self) { + return nil; + } + self.buttonName = buttonName; + return self; +} + - (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLSubscribeButtonResponse.h b/SmartDeviceLink/public/SDLSubscribeButtonResponse.h index 40f2b4c8d3..8762c86b33 100644 --- a/SmartDeviceLink/public/SDLSubscribeButtonResponse.h +++ b/SmartDeviceLink/public/SDLSubscribeButtonResponse.h @@ -1,5 +1,34 @@ -// SDLSubscribeButtonResponse.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" diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleData.h b/SmartDeviceLink/public/SDLSubscribeVehicleData.h index 27c8301998..91309a87b4 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleData.h +++ b/SmartDeviceLink/public/SDLSubscribeVehicleData.h @@ -1,9 +1,40 @@ -// SDLSubscribeVehicleData.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" +NS_ASSUME_NONNULL_BEGIN + /** * Subscribes to specific published vehicle data items. The data will be only sent if it has changed. The application will be notified by the `onVehicleData` notification whenever new data is available. The update rate is dependent on sensors, vehicle architecture and vehicle type. * @@ -14,46 +45,42 @@ * Since SmartDeviceLink 2.0 * See SDLUnsubscribeVehicleData, SDLGetVehicleData */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLSubscribeVehicleData : SDLRPCRequest /** - * Convenience init for subscribing to all possible vehicle data items. - * - * @param accelerationPedalPosition Subscribe to accelerationPedalPosition - * @param airbagStatus Subscribe to airbagStatus - * @param beltStatus Subscribe to beltStatus - * @param bodyInformation Subscribe to bodyInformation - * @param cloudAppVehicleID Subscribe to cloudAppVehicleID - * @param clusterModeStatus Subscribe to clusterModeStatus - * @param deviceStatus Subscribe to deviceStatus - * @param driverBraking Subscribe to driverBraking - * @param eCallInfo Subscribe to eCallInfo - * @param electronicParkBrakeStatus Subscribe to electronicParkBrakeStatus - * @param emergencyEvent Subscribe to emergencyEvent - * @param engineOilLife Subscribe to engineOilLife - * @param engineTorque Subscribe to engineTorque - * @param externalTemperature Subscribe to externalTemperature - * @param fuelLevel Subscribe to fuelLevel - * @param fuelLevelState Subscribe to fuelLevelState - * @param fuelRange Subscribe to fuelRange - * @param gps Subscribe to gps - * @param headLampStatus Subscribe to headLampStatus - * @param instantFuelConsumption Subscribe to instantFuelConsumption - * @param myKey Subscribe to myKey - * @param odometer Subscribe to odometer - * @param prndl Subscribe to prndl - * @param rpm Subscribe to rpm - * @param speed Subscribe to speed - * @param steeringWheelAngle Subscribe to steeringWheelAngle - * @param tirePressure Subscribe to tirePressure - * @param turnSignal Subscribe to turnSignal - * @param wiperStatus Subscribe to wiperStatus - * @return A SDLSubscribeVehicleData object + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModeStatus - clusterModeStatus + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLSubscribeVehicleData object */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus: instead"); +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey windowStatus:(nullable NSNumber *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering; /** * Convenience init for subscribing to all possible vehicle data items. @@ -90,7 +117,43 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLSubscribeVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSNumber *)windowStatus; +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSNumber *)windowStatus __deprecated_msg("Use another initializer instead"); + +/** + * Convenience init for subscribing to all possible vehicle data items. + * + * @param accelerationPedalPosition Subscribe to accelerationPedalPosition + * @param airbagStatus Subscribe to airbagStatus + * @param beltStatus Subscribe to beltStatus + * @param bodyInformation Subscribe to bodyInformation + * @param cloudAppVehicleID Subscribe to cloudAppVehicleID + * @param clusterModeStatus Subscribe to clusterModeStatus + * @param deviceStatus Subscribe to deviceStatus + * @param driverBraking Subscribe to driverBraking + * @param eCallInfo Subscribe to eCallInfo + * @param electronicParkBrakeStatus Subscribe to electronicParkBrakeStatus + * @param emergencyEvent Subscribe to emergencyEvent + * @param engineOilLife Subscribe to engineOilLife + * @param engineTorque Subscribe to engineTorque + * @param externalTemperature Subscribe to externalTemperature + * @param fuelLevel Subscribe to fuelLevel + * @param fuelLevelState Subscribe to fuelLevelState + * @param fuelRange Subscribe to fuelRange + * @param gps Subscribe to gps + * @param headLampStatus Subscribe to headLampStatus + * @param instantFuelConsumption Subscribe to instantFuelConsumption + * @param myKey Subscribe to myKey + * @param odometer Subscribe to odometer + * @param prndl Subscribe to prndl + * @param rpm Subscribe to rpm + * @param speed Subscribe to speed + * @param steeringWheelAngle Subscribe to steeringWheelAngle + * @param tirePressure Subscribe to tirePressure + * @param turnSignal Subscribe to turnSignal + * @param wiperStatus Subscribe to wiperStatus + * @return A SDLSubscribeVehicleData object + */ +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use another initializer instead"); /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleData.m b/SmartDeviceLink/public/SDLSubscribeVehicleData.m index 0e8b39c533..d813b659de 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleData.m +++ b/SmartDeviceLink/public/SDLSubscribeVehicleData.m @@ -23,6 +23,44 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey windowStatus:(nullable NSNumber *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModeStatus = clusterModeStatus; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus { self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:nil windowStatus:nil]; if (self) { diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h index 5e37053d83..ae11cdf303 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h @@ -1,21 +1,83 @@ -// SDLSubscribeVehicleDataResponse.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" @class SDLVehicleDataResult; +NS_ASSUME_NONNULL_BEGIN /** Response to SDLSubscribeVehicleData Since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLSubscribeVehicleDataResponse : SDLRPCResponse +/** + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModes - clusterModes + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLSubscribeVehicleDataResponse object + */ +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering; + /** * Convenience init for setting all possible values on vehicle data items. * @@ -51,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLSubscribeVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus; +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus __deprecated_msg("Use another initializer instead"); /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m index 332847ed6f..cf05abaad3 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m @@ -24,6 +24,44 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModes = clusterModes; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLSubscribeWayPoints.h b/SmartDeviceLink/public/SDLSubscribeWayPoints.h index d7fd129bc2..258f11c06d 100644 --- a/SmartDeviceLink/public/SDLSubscribeWayPoints.h +++ b/SmartDeviceLink/public/SDLSubscribeWayPoints.h @@ -1,18 +1,47 @@ -// SDLSubscribeWaypoints.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" +NS_ASSUME_NONNULL_BEGIN + /** * A SDLSubscribeWaypoints can be sent to subscribe * for any changes in waypoints/destinations * * @see SDLUnsubscribeWaypoints * + * @added in SmartDeviceLink 4.1.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLSubscribeWayPoints : SDLRPCRequest @end diff --git a/SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h b/SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h index 7bea341e76..918daae4a9 100644 --- a/SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h +++ b/SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h @@ -1,5 +1,34 @@ -// SDLSubscribeWaypointsResponse.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" @@ -7,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN /** Response to SubscribeWayPoints + + @added in SmartDeviceLink 4.1.0 */ @interface SDLSubscribeWayPointsResponse : SDLRPCResponse diff --git a/SmartDeviceLink/public/SDLSupportedSeat.h b/SmartDeviceLink/public/SDLSupportedSeat.h index 15f2887a1f..a647d68921 100644 --- a/SmartDeviceLink/public/SDLSupportedSeat.h +++ b/SmartDeviceLink/public/SDLSupportedSeat.h @@ -1,14 +1,42 @@ -// SDLSupportedSeat.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 "SDLEnum.h" /** * List possible seats that is a remote controllable seat. * - * @deprecated - * @history SDL 5.0.0 - * @since SDL 6.0.0 + * @deprecated in SmartDeviceLink 6.0.0 + * @added in SmartDeviceLink 5.0.0 */ typedef SDLEnum SDLSupportedSeat NS_TYPED_ENUM __deprecated; diff --git a/SmartDeviceLink/public/SDLSystemAction.h b/SmartDeviceLink/public/SDLSystemAction.h index c88a9c6a88..192c77beea 100644 --- a/SmartDeviceLink/public/SDLSystemAction.h +++ b/SmartDeviceLink/public/SDLSystemAction.h @@ -1,5 +1,34 @@ -// SDLSystemAction.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLSystemCapability.h b/SmartDeviceLink/public/SDLSystemCapability.h index d41136c2f6..f7da35af09 100755 --- a/SmartDeviceLink/public/SDLSystemCapability.h +++ b/SmartDeviceLink/public/SDLSystemCapability.h @@ -47,10 +47,30 @@ NS_ASSUME_NONNULL_BEGIN /** * The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist. * - * First implemented in SDL Core v4.4 + * @added in SmartDeviceLink 4.5.0 */ @interface SDLSystemCapability : SDLRPCStruct +/** + * @param systemCapabilityType - systemCapabilityType + * @return A SDLSystemCapability object + */ +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType; + +/** + * @param systemCapabilityType - systemCapabilityType + * @param navigationCapability - navigationCapability + * @param phoneCapability - phoneCapability + * @param videoStreamingCapability - videoStreamingCapability + * @param remoteControlCapability - remoteControlCapability + * @param appServicesCapabilities - appServicesCapabilities + * @param seatLocationCapability - seatLocationCapability + * @param displayCapabilities - displayCapabilities + * @param driverDistractionCapability - driverDistractionCapability + * @return A SDLSystemCapability object + */ +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType navigationCapability:(nullable SDLNavigationCapability *)navigationCapability phoneCapability:(nullable SDLPhoneCapability *)phoneCapability videoStreamingCapability:(nullable SDLVideoStreamingCapability *)videoStreamingCapability remoteControlCapability:(nullable SDLRemoteControlCapabilities *)remoteControlCapability appServicesCapabilities:(nullable SDLAppServicesCapabilities *)appServicesCapabilities seatLocationCapability:(nullable SDLSeatLocationCapability *)seatLocationCapability displayCapabilities:(nullable NSArray *)displayCapabilities driverDistractionCapability:(nullable SDLDriverDistractionCapability *)driverDistractionCapability; + /** * Convenience init for an App Service Capability * diff --git a/SmartDeviceLink/public/SDLSystemCapability.m b/SmartDeviceLink/public/SDLSystemCapability.m index 8cfe47dbea..b2bb15292f 100755 --- a/SmartDeviceLink/public/SDLSystemCapability.m +++ b/SmartDeviceLink/public/SDLSystemCapability.m @@ -48,6 +48,31 @@ @implementation SDLSystemCapability +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType { + self = [self init]; + if (!self) { + return nil; + } + self.systemCapabilityType = systemCapabilityType; + return self; +} + +- (instancetype)initWithSystemCapabilityType:(SDLSystemCapabilityType)systemCapabilityType navigationCapability:(nullable SDLNavigationCapability *)navigationCapability phoneCapability:(nullable SDLPhoneCapability *)phoneCapability videoStreamingCapability:(nullable SDLVideoStreamingCapability *)videoStreamingCapability remoteControlCapability:(nullable SDLRemoteControlCapabilities *)remoteControlCapability appServicesCapabilities:(nullable SDLAppServicesCapabilities *)appServicesCapabilities seatLocationCapability:(nullable SDLSeatLocationCapability *)seatLocationCapability displayCapabilities:(nullable NSArray *)displayCapabilities driverDistractionCapability:(nullable SDLDriverDistractionCapability *)driverDistractionCapability { + self = [self initWithSystemCapabilityType:systemCapabilityType]; + if (!self) { + return nil; + } + self.navigationCapability = navigationCapability; + self.phoneCapability = phoneCapability; + self.videoStreamingCapability = videoStreamingCapability; + self.remoteControlCapability = remoteControlCapability; + self.appServicesCapabilities = appServicesCapabilities; + self.seatLocationCapability = seatLocationCapability; + self.displayCapabilities = displayCapabilities; + self.driverDistractionCapability = driverDistractionCapability; + return self; +} + - (instancetype)initWithAppServicesCapabilities:(SDLAppServicesCapabilities *)capability { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLSystemCapabilityType.h b/SmartDeviceLink/public/SDLSystemCapabilityType.h index 0d184023b5..8b401be565 100755 --- a/SmartDeviceLink/public/SDLSystemCapabilityType.h +++ b/SmartDeviceLink/public/SDLSystemCapabilityType.h @@ -34,6 +34,8 @@ /** The type of system capability to get more information on. Used in GetSystemCapability. + + @added in SmartDeviceLink 4.5.0 */ typedef SDLEnum SDLSystemCapabilityType NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLSystemContext.h b/SmartDeviceLink/public/SDLSystemContext.h index fbdb09d6f7..00c3d80aea 100644 --- a/SmartDeviceLink/public/SDLSystemContext.h +++ b/SmartDeviceLink/public/SDLSystemContext.h @@ -1,5 +1,34 @@ -// SDLSystemContext.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLSystemRequest.h b/SmartDeviceLink/public/SDLSystemRequest.h index 75cd10a6c6..0dfb74d83d 100644 --- a/SmartDeviceLink/public/SDLSystemRequest.h +++ b/SmartDeviceLink/public/SDLSystemRequest.h @@ -1,19 +1,61 @@ -// SDLSystemRequest.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 "SDLRequestType.h" +NS_ASSUME_NONNULL_BEGIN + /** * An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests) * * @since SmartDeviceLink 3.0 */ +@interface SDLSystemRequest : SDLRPCRequest -NS_ASSUME_NONNULL_BEGIN +/** + * @param requestType - requestType + * @return A SDLSystemRequest object + */ +- (instancetype)initWithRequestType:(SDLRequestType)requestType; -@interface SDLSystemRequest : SDLRPCRequest +/** + * @param requestType - requestType + * @param requestSubType - requestSubType + * @param fileName - fileName + * @return A SDLSystemRequest object + */ +- (instancetype)initWithRequestType:(SDLRequestType)requestType requestSubType:(nullable NSString *)requestSubType fileName:(nullable NSString *)fileName; /** Create a generic system request with a file name @@ -22,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN @param fileName The name of the file to use @return The request */ -- (instancetype)initWithType:(SDLRequestType)requestType fileName:(nullable NSString *)fileName; +- (instancetype)initWithType:(SDLRequestType)requestType fileName:(nullable NSString *)fileName __deprecated_msg("Use initWithRequestType: instead"); /** Create an OEM_PROPRIETARY system request with a subtype and file name @@ -31,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN @param fileName The name of the file to use @return The request */ -- (instancetype)initWithProprietaryType:(NSString *)proprietaryType fileName:(nullable NSString *)fileName; +- (instancetype)initWithProprietaryType:(NSString *)proprietaryType fileName:(nullable NSString *)fileName __deprecated_msg("Use initWithRequestType:requestSubType:fileName: instead"); /** * The type of system request. Note that Proprietary requests should forward the binary data to the known proprietary module on the system. diff --git a/SmartDeviceLink/public/SDLSystemRequest.m b/SmartDeviceLink/public/SDLSystemRequest.m index e16968be0e..f57bf47b60 100644 --- a/SmartDeviceLink/public/SDLSystemRequest.m +++ b/SmartDeviceLink/public/SDLSystemRequest.m @@ -21,6 +21,25 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithRequestType:(SDLRequestType)requestType { + self = [self init]; + if (!self) { + return nil; + } + self.requestType = requestType; + return self; +} + +- (instancetype)initWithRequestType:(SDLRequestType)requestType requestSubType:(nullable NSString *)requestSubType fileName:(nullable NSString *)fileName { + self = [self initWithRequestType:requestType]; + if (!self) { + return nil; + } + self.requestSubType = requestSubType; + self.fileName = fileName; + return self; +} + - (instancetype)initWithType:(SDLRequestType)requestType fileName:(nullable NSString *)fileName { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLSystemRequestResponse.h b/SmartDeviceLink/public/SDLSystemRequestResponse.h index d8d57a3447..44f8bbc2f5 100644 --- a/SmartDeviceLink/public/SDLSystemRequestResponse.h +++ b/SmartDeviceLink/public/SDLSystemRequestResponse.h @@ -1,6 +1,34 @@ -// SDLSystemRequestResponse.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" diff --git a/SmartDeviceLink/public/SDLTBTState.h b/SmartDeviceLink/public/SDLTBTState.h index 33f3a945cb..5cfad61f0f 100644 --- a/SmartDeviceLink/public/SDLTBTState.h +++ b/SmartDeviceLink/public/SDLTBTState.h @@ -1,5 +1,34 @@ -// SDLTBTState.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLTPMS.h b/SmartDeviceLink/public/SDLTPMS.h index 23cab375be..3a2d6f85a0 100644 --- a/SmartDeviceLink/public/SDLTPMS.h +++ b/SmartDeviceLink/public/SDLTPMS.h @@ -1,11 +1,42 @@ -// SDLTPMS.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 "SDLEnum.h" /** An enum representing values of the tire pressure monitoring system + + @added in SmartDeviceLink 5.0.0 */ typedef SDLEnum SDLTPMS NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLTTSChunk.h b/SmartDeviceLink/public/SDLTTSChunk.h index d0d04a0fd9..0bf3a5bd0e 100644 --- a/SmartDeviceLink/public/SDLTTSChunk.h +++ b/SmartDeviceLink/public/SDLTTSChunk.h @@ -1,5 +1,34 @@ -// SDLTTSChunk.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" diff --git a/SmartDeviceLink/public/SDLTemperature.h b/SmartDeviceLink/public/SDLTemperature.h index e93fae6d1e..b4a31c2048 100644 --- a/SmartDeviceLink/public/SDLTemperature.h +++ b/SmartDeviceLink/public/SDLTemperature.h @@ -1,6 +1,34 @@ -// -// SDLTemperature.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 "SDLTemperatureUnit.h" @@ -12,13 +40,36 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLTemperature : SDLRPCStruct +/** + * @param unit - unit + * @param valueParam - @(valueParam) + * @return A SDLTemperature object + */ +- (instancetype)initWithUnit:(SDLTemperatureUnit)unit valueParam:(float)valueParam; + +/** + * Convenience init for a fahrenheit temperature value. + * + * @param value Temperature value in fahrenheit + * @return A SDLTemperature object + */ ++ (instancetype)fahrenheitTemperature:(float)value; + +/** + * Convenience init for a celsius temperature value. + * + * @param value Temperature value in celsius + * @return A SDLTemperature object + */ ++ (instancetype)celsiusTemperature:(float)value; + /** * Convenience init for a fahrenheit temperature value. * * @param value Temperature value in fahrenheit * @return A SDLTemperature object */ -- (instancetype)initWithFahrenheitValue:(float)value; +- (instancetype)initWithFahrenheitValue:(float)value __deprecated_msg("Use fahrenheitTemperature: instead"); /** * Convenience init for a celsius temperature value. @@ -26,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN * @param value Temperature value in celsius * @return A SDLTemperature object */ -- (instancetype)initWithCelsiusValue:(float)value; +- (instancetype)initWithCelsiusValue:(float)value __deprecated_msg("Use celsiusTemperature: instead"); /** * Convenience init for all parameters. @@ -35,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN * @param value Temperature value in specified unit * @return A SDLTemperature object */ -- (instancetype)initWithUnit:(SDLTemperatureUnit)unit value:(float)value NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithUnit:(SDLTemperatureUnit)unit value:(float)value __deprecated_msg("Use initWithUnit:valueParam:"); /** * Temperature unit @@ -44,12 +95,18 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) SDLTemperatureUnit unit; +/** + * Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL. + * {"num_min_value": null, "num_max_value": null} + */ +@property (strong, nonatomic) NSNumber *valueParam; + /** * Temperature value in specified unit. Range depends on OEM and is not checked by SDL. * * Required, float */ -@property (strong, nonatomic) NSNumber *value; +@property (strong, nonatomic) NSNumber *value __deprecated_msg("Use valueParam instead"); @end diff --git a/SmartDeviceLink/public/SDLTemperature.m b/SmartDeviceLink/public/SDLTemperature.m index 45d1e22805..230fd1fb47 100644 --- a/SmartDeviceLink/public/SDLTemperature.m +++ b/SmartDeviceLink/public/SDLTemperature.m @@ -10,6 +10,24 @@ @implementation SDLTemperature +- (instancetype)initWithUnit:(SDLTemperatureUnit)unit valueParam:(float)valueParam { + self = [self init]; + if (!self) { + return nil; + } + self.unit = unit; + self.valueParam = @(valueParam); + return self; +} + ++ (instancetype)fahrenheitTemperature:(float)value { + return [[self alloc] initWithUnit:SDLTemperatureUnitFahrenheit valueParam:value]; +} + ++ (instancetype)celsiusTemperature:(float)value { + return [[self alloc] initWithUnit:SDLTemperatureUnitCelsius valueParam:value]; +} + - (instancetype)initWithFahrenheitValue:(float)value { return [self initWithUnit:SDLTemperatureUnitFahrenheit value:value]; } @@ -39,6 +57,15 @@ - (SDLTemperatureUnit)unit { return [self.store sdl_enumForName:SDLRPCParameterNameUnit error:&error]; } +- (void)setValueParam:(NSNumber *)valueParam { + [self.store sdl_setObject:valueParam forName:SDLRPCParameterNameValue]; +} + +- (NSNumber *)valueParam { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameValue ofClass:NSNumber.class error:&error]; +} + - (void)setValue:(NSNumber *)value { [self.store sdl_setObject:value forName:SDLRPCParameterNameValue]; } diff --git a/SmartDeviceLink/public/SDLTemperatureUnit.h b/SmartDeviceLink/public/SDLTemperatureUnit.h index e7bd4a0d6e..ec85dba4f6 100644 --- a/SmartDeviceLink/public/SDLTemperatureUnit.h +++ b/SmartDeviceLink/public/SDLTemperatureUnit.h @@ -1,12 +1,42 @@ -// -// SDLTemperatureUnit.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 "SDLEnum.h" /** The unit of temperature to display. Used in Temperature. + + @added in SmartDeviceLink 4.5.0 */ typedef SDLEnum SDLTemperatureUnit NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLTemplateColorScheme.h b/SmartDeviceLink/public/SDLTemplateColorScheme.h index 5f0c615b26..a5868d511e 100644 --- a/SmartDeviceLink/public/SDLTemplateColorScheme.h +++ b/SmartDeviceLink/public/SDLTemplateColorScheme.h @@ -1,10 +1,34 @@ -// -// SDLTemplateColorScheme.h -// SmartDeviceLink -// -// Created by Joel Fischer on 5/21/18. -// Copyright © 2018 Livio. 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 @@ -15,16 +39,36 @@ NS_ASSUME_NONNULL_BEGIN -/// A color scheme for all display layout templates. +/** + * A color scheme for all display layout templates. + * + * @added in SmartDeviceLink 5.0.0 + */ @interface SDLTemplateColorScheme : SDLRPCStruct +/** + * @param primaryColor - primaryColor + * @param secondaryColor - secondaryColor + * @param backgroundColor - backgroundColor + * @return A SDLTemplateColorScheme object + */ +- (instancetype)initWithPrimaryColorParam:(nullable SDLRGBColor *)primaryColor secondaryColor:(nullable SDLRGBColor *)secondaryColor backgroundColor:(nullable SDLRGBColor *)backgroundColor __deprecated_msg("Eventually an initializer without param will be added"); + +/// Convenience init +/// +/// @param primaryColor This must always be your primary brand color +/// @param secondaryColor This may be an accent or complimentary color to your primary brand color +/// @param backgroundColor he background color to be used on the template +/// @return An SDLTemplateColorScheme ++ (instancetype)schemeWithPrimaryUIColor:(UIColor *)primaryColor secondaryUIColor:(UIColor *)secondaryColor backgroundUIColor:(UIColor *)backgroundColor; + /// Convenience init /// /// @param primaryColor This must always be your primary brand color /// @param secondaryColor This may be an accent or complimentary color to your primary brand color /// @param backgroundColor he background color to be used on the template /// @return An SDLTemplateColorScheme -- (instancetype)initWithPrimaryRGBColor:(SDLRGBColor *)primaryColor secondaryRGBColor:(SDLRGBColor *)secondaryColor backgroundRGBColor:(SDLRGBColor *)backgroundColor; +- (instancetype)initWithPrimaryRGBColor:(SDLRGBColor *)primaryColor secondaryRGBColor:(SDLRGBColor *)secondaryColor backgroundRGBColor:(SDLRGBColor *)backgroundColor __deprecated; /// Convenience init /// @@ -32,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param secondaryColor This may be an accent or complimentary color to your primary brand color /// @param backgroundColor he background color to be used on the template /// @return An SDLTemplateColorScheme -- (instancetype)initWithPrimaryColor:(UIColor *)primaryColor secondaryColor:(UIColor *)secondaryColor backgroundColor:(UIColor *)backgroundColor; +- (instancetype)initWithPrimaryColor:(UIColor *)primaryColor secondaryColor:(UIColor *)secondaryColor backgroundColor:(UIColor *)backgroundColor __deprecated_msg("Use schemeWithPrimaryUIColor:secondaryUIColor:backgroundUIColor: instead"); /** The "primary" color. This must always be your primary brand color. If the OEM only uses one color, this will be the color. It is recommended to the OEMs that the primaryColor should change the `mediaClockTimer` bar and the highlight color of soft buttons. diff --git a/SmartDeviceLink/public/SDLTemplateColorScheme.m b/SmartDeviceLink/public/SDLTemplateColorScheme.m index 0c758fbbd5..91c1867208 100644 --- a/SmartDeviceLink/public/SDLTemplateColorScheme.m +++ b/SmartDeviceLink/public/SDLTemplateColorScheme.m @@ -16,6 +16,17 @@ @implementation SDLTemplateColorScheme +- (instancetype)initWithPrimaryColorParam:(nullable SDLRGBColor *)primaryColor secondaryColor:(nullable SDLRGBColor *)secondaryColor backgroundColor:(nullable SDLRGBColor *)backgroundColor { + self = [self init]; + if (!self) { + return nil; + } + self.primaryColor = primaryColor; + self.secondaryColor = secondaryColor; + self.backgroundColor = backgroundColor; + return self; +} + - (instancetype)initWithPrimaryRGBColor:(SDLRGBColor *)primaryColor secondaryRGBColor:(SDLRGBColor *)secondaryColor backgroundRGBColor:(SDLRGBColor *)backgroundColor { self = [self init]; if (!self) { return nil; } @@ -38,6 +49,16 @@ - (instancetype)initWithPrimaryColor:(UIColor *)primaryColor secondaryColor:(UIC return self; } ++ (instancetype)schemeWithPrimaryUIColor:(UIColor *)primaryColor secondaryUIColor:(UIColor *)secondaryColor backgroundUIColor:(UIColor *)backgroundColor { + SDLTemplateColorScheme *colorScheme = [[SDLTemplateColorScheme alloc] init]; + + colorScheme.primaryColor = [[SDLRGBColor alloc] initWithColor:primaryColor]; + colorScheme.secondaryColor = [[SDLRGBColor alloc] initWithColor:secondaryColor]; + colorScheme.backgroundColor = [[SDLRGBColor alloc] initWithColor:backgroundColor]; + + return colorScheme; +} + - (void)setPrimaryColor:(nullable SDLRGBColor *)primaryColor { [self.store sdl_setObject:primaryColor forName:SDLRPCParameterNamePrimaryColor]; } diff --git a/SmartDeviceLink/public/SDLTemplateConfiguration.h b/SmartDeviceLink/public/SDLTemplateConfiguration.h index 39d0b0df71..3090af8601 100644 --- a/SmartDeviceLink/public/SDLTemplateConfiguration.h +++ b/SmartDeviceLink/public/SDLTemplateConfiguration.h @@ -1,6 +1,34 @@ -// -// SDLTemplateConfiguration.h -// SmartDeviceLink +/* + * 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 "SDLTemplateColorScheme.h" #import "SDLPredefinedLayout.h" @@ -14,7 +42,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLTemplateConfiguration : SDLRPCStruct - /** Constructor with the required values. diff --git a/SmartDeviceLink/public/SDLTextAlignment.h b/SmartDeviceLink/public/SDLTextAlignment.h index f9b0a16ee6..64bfb73343 100644 --- a/SmartDeviceLink/public/SDLTextAlignment.h +++ b/SmartDeviceLink/public/SDLTextAlignment.h @@ -1,5 +1,34 @@ -// SDLTextAlignment.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLTextField.h b/SmartDeviceLink/public/SDLTextField.h index a345ff1459..d5d9e87584 100644 --- a/SmartDeviceLink/public/SDLTextField.h +++ b/SmartDeviceLink/public/SDLTextField.h @@ -1,5 +1,34 @@ -// SDLTextField.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" @@ -16,6 +45,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLTextField : SDLRPCStruct +/** + * @param nameParam - nameParam + * @param characterSet - characterSet + * @param width - @(width) + * @param rows - @(rows) + * @return A SDLTextField object + */ +- (instancetype)initWithNameParam:(SDLTextFieldName)nameParam characterSet:(SDLCharacterSet)characterSet width:(UInt16)width rows:(UInt8)rows; + +/** + * The name that identifies the field. See TextFieldName. + */ +@property (strong, nonatomic) SDLTextFieldName nameParam; + /** * The enumeration identifying the field. * @@ -23,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN * * Required */ -@property (strong, nonatomic) SDLTextFieldName name; +@property (strong, nonatomic) SDLTextFieldName name __deprecated_msg("Use nameParam instead"); /** * The set of characters that are supported by this text field. All text is sent in UTF-8 format, but not all systems may support all of the characters expressed by UTF-8. All systems will support at least ASCII, but they may support more, either the LATIN-1 character set, or the full UTF-8 character set. diff --git a/SmartDeviceLink/public/SDLTextField.m b/SmartDeviceLink/public/SDLTextField.m index 80941cc5fd..52f5509951 100644 --- a/SmartDeviceLink/public/SDLTextField.m +++ b/SmartDeviceLink/public/SDLTextField.m @@ -12,6 +12,39 @@ @implementation SDLTextField +- (instancetype)initWithNameParam:(SDLTextFieldName)nameParam characterSet:(SDLCharacterSet)characterSet width:(UInt16)width rows:(UInt8)rows { + self = [self init]; + if (!self) { + return nil; + } + self.nameParam = nameParam; + self.characterSet = characterSet; + self.width = @(width); + self.rows = @(rows); + return self; +} + +- (instancetype)initWithName:(SDLTextFieldName)name characterSet:(SDLCharacterSet)characterSet width:(NSUInteger)width rows:(NSUInteger)rows { + self = [self init]; + if (!self) { return nil; } + + self.nameParam = name; + self.characterSet = characterSet; + self.width = @(width); + self.rows = @(rows); + + return self; +} + +- (void)setNameParam:(SDLTextFieldName)nameParam { + [self.store sdl_setObject:nameParam forName:SDLRPCParameterNameName]; +} + +- (SDLTextFieldName)nameParam { + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameName error:&error]; +} + - (void)setName:(SDLTextFieldName)name { [self.store sdl_setObject:name forName:SDLRPCParameterNameName]; } @@ -48,18 +81,6 @@ - (void)setRows:(NSNumber *)rows { return [self.store sdl_objectForName:SDLRPCParameterNameRows ofClass:NSNumber.class error:&error]; } -- (instancetype)initWithName:(SDLTextFieldName)name characterSet:(SDLCharacterSet)characterSet width:(NSUInteger)width rows:(NSUInteger)rows { - self = [self init]; - if (!self) { return nil; } - - self.name = name; - self.characterSet = characterSet; - self.width = @(width); - self.rows = @(rows); - - return self; -} - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLTimerMode.h b/SmartDeviceLink/public/SDLTimerMode.h index 416b9df928..b20e844f88 100644 --- a/SmartDeviceLink/public/SDLTimerMode.h +++ b/SmartDeviceLink/public/SDLTimerMode.h @@ -1,5 +1,34 @@ -// SDLTimerMode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLTireStatus.h b/SmartDeviceLink/public/SDLTireStatus.h index 2d00f17871..3913280a93 100644 --- a/SmartDeviceLink/public/SDLTireStatus.h +++ b/SmartDeviceLink/public/SDLTireStatus.h @@ -1,5 +1,34 @@ -// SDLTireStatus.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" @@ -11,9 +40,23 @@ NS_ASSUME_NONNULL_BEGIN /** Struct used in Vehicle Data; the status and pressure of the tires. + + @added in SmartDeviceLink 2.0.0 */ @interface SDLTireStatus : SDLRPCStruct +/** + * @param pressureTelltale - pressureTelltale + * @param leftFront - leftFront + * @param rightFront - rightFront + * @param leftRear - leftRear + * @param rightRear - rightRear + * @param innerLeftRear - innerLeftRear + * @param innerRightRear - innerRightRear + * @return A SDLTireStatus object + */ +- (instancetype)initWithPressureTelltale:(SDLWarningLightStatus)pressureTelltale leftFront:(SDLSingleTireStatus *)leftFront rightFront:(SDLSingleTireStatus *)rightFront leftRear:(SDLSingleTireStatus *)leftRear rightRear:(SDLSingleTireStatus *)rightRear innerLeftRear:(SDLSingleTireStatus *)innerLeftRear innerRightRear:(SDLSingleTireStatus *)innerRightRear; + /** Status of the Tire Pressure Telltale. See WarningLightStatus. diff --git a/SmartDeviceLink/public/SDLTireStatus.m b/SmartDeviceLink/public/SDLTireStatus.m index aa1bac556d..9661d41b24 100644 --- a/SmartDeviceLink/public/SDLTireStatus.m +++ b/SmartDeviceLink/public/SDLTireStatus.m @@ -11,6 +11,21 @@ @implementation SDLTireStatus +- (instancetype)initWithPressureTelltale:(SDLWarningLightStatus)pressureTelltale leftFront:(SDLSingleTireStatus *)leftFront rightFront:(SDLSingleTireStatus *)rightFront leftRear:(SDLSingleTireStatus *)leftRear rightRear:(SDLSingleTireStatus *)rightRear innerLeftRear:(SDLSingleTireStatus *)innerLeftRear innerRightRear:(SDLSingleTireStatus *)innerRightRear { + self = [self init]; + if (!self) { + return nil; + } + self.pressureTelltale = pressureTelltale; + self.leftFront = leftFront; + self.rightFront = rightFront; + self.leftRear = leftRear; + self.rightRear = rightRear; + self.innerLeftRear = innerLeftRear; + self.innerRightRear = innerRightRear; + return self; +} + - (void)setPressureTelltale:(SDLWarningLightStatus)pressureTelltale { [self.store sdl_setObject:pressureTelltale forName:SDLRPCParameterNamePressureTelltale]; } diff --git a/SmartDeviceLink/public/SDLTouch.m b/SmartDeviceLink/public/SDLTouch.m index 5837780625..ec5781ea3a 100644 --- a/SmartDeviceLink/public/SDLTouch.m +++ b/SmartDeviceLink/public/SDLTouch.m @@ -31,7 +31,7 @@ - (instancetype)init { - (instancetype)initWithTouchEvent:(SDLTouchEvent *)touchEvent { self = [self init]; if (self) { - _identifier = touchEvent.touchEventId.integerValue; + _identifier = touchEvent.idParam.integerValue; NSArray *> *timestamp = touchEvent.timeStamp; // In the event we receive a null timestamp, we will supply a device timestamp. if ((timestamp == nil) || (timestamp.count == 0)) { diff --git a/SmartDeviceLink/public/SDLTouchCoord.h b/SmartDeviceLink/public/SDLTouchCoord.h index 2024731679..6ed2dbfa0e 100644 --- a/SmartDeviceLink/public/SDLTouchCoord.h +++ b/SmartDeviceLink/public/SDLTouchCoord.h @@ -1,5 +1,34 @@ -// SDLTouchCoord.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" @@ -8,9 +37,18 @@ NS_ASSUME_NONNULL_BEGIN /** The coordinate of a touch, used in a touch event + + @added in SmartDeviceLink 3.0.0 */ @interface SDLTouchCoord : SDLRPCStruct +/** + * @param x - @(x) + * @param y - @(y) + * @return A SDLTouchCoord object + */ +- (instancetype)initWithX:(UInt16)x y:(UInt16)y; + /** The x value of the touch coordinate diff --git a/SmartDeviceLink/public/SDLTouchCoord.m b/SmartDeviceLink/public/SDLTouchCoord.m index e41a6435c0..0b085db381 100644 --- a/SmartDeviceLink/public/SDLTouchCoord.m +++ b/SmartDeviceLink/public/SDLTouchCoord.m @@ -11,6 +11,16 @@ @implementation SDLTouchCoord +- (instancetype)initWithX:(UInt16)x y:(UInt16)y { + self = [self init]; + if (!self) { + return nil; + } + self.x = @(x); + self.y = @(y); + return self; +} + - (void)setX:(NSNumber *)x { [self.store sdl_setObject:x forName:SDLRPCParameterNameX]; } diff --git a/SmartDeviceLink/public/SDLTouchEvent.h b/SmartDeviceLink/public/SDLTouchEvent.h index b11a9a21ab..e2bbdb2ee1 100644 --- a/SmartDeviceLink/public/SDLTouchEvent.h +++ b/SmartDeviceLink/public/SDLTouchEvent.h @@ -1,5 +1,34 @@ -// SDLTouchEvent.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" @@ -10,9 +39,25 @@ NS_ASSUME_NONNULL_BEGIN /** A touch which occurred on the IVI system during projection + + @added in SmartDeviceLink 3.0.0 */ @interface SDLTouchEvent : SDLRPCStruct +/** + * @param idParam - @(idParam) + * @param ts - ts + * @param c - c + * @return A SDLTouchEvent object + */ +- (instancetype)initWithIdParam:(UInt8)idParam ts:(NSArray *> *)ts c:(NSArray *)c; + +/** + * A touch's unique identifier. The application can track the current touch events by id. If a touch event has type begin, the id should be added to the set of touches. If a touch event has type end, the id should be removed from the set of touches. + * {"num_min_value": 0, "num_max_value": 9} + */ +@property (strong, nonatomic) NSNumber *idParam; + /** A touch's unique identifier. The application can track the current touch events by id. @@ -22,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN Required, 0-9 */ -@property (strong, nonatomic) NSNumber *touchEventId; +@property (strong, nonatomic) NSNumber *touchEventId __deprecated_msg("Use idParam instead"); /** The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds. diff --git a/SmartDeviceLink/public/SDLTouchEvent.m b/SmartDeviceLink/public/SDLTouchEvent.m index 2fbfa90d48..b111a0c755 100644 --- a/SmartDeviceLink/public/SDLTouchEvent.m +++ b/SmartDeviceLink/public/SDLTouchEvent.m @@ -12,6 +12,26 @@ @implementation SDLTouchEvent +- (instancetype)initWithIdParam:(UInt8)idParam ts:(NSArray *> *)ts c:(NSArray *)c { + self = [self init]; + if (!self) { + return nil; + } + self.idParam = @(idParam); + self.timeStamp = ts; + self.coord = c; + return self; +} + +- (void)setIdParam:(NSNumber *)idParam { + [self.store sdl_setObject:idParam forName:SDLRPCParameterNameId]; +} + +- (NSNumber *)idParam { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameId ofClass:NSNumber.class error:&error]; +} + - (void)setTouchEventId:(NSNumber *)touchEventId { [self.store sdl_setObject:touchEventId forName:SDLRPCParameterNameId]; } diff --git a/SmartDeviceLink/public/SDLTouchEventCapabilities.h b/SmartDeviceLink/public/SDLTouchEventCapabilities.h index ff88a7962d..97b9b595ce 100644 --- a/SmartDeviceLink/public/SDLTouchEventCapabilities.h +++ b/SmartDeviceLink/public/SDLTouchEventCapabilities.h @@ -1,5 +1,34 @@ -// SDLTouchEventCapabilities.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" @@ -8,9 +37,19 @@ NS_ASSUME_NONNULL_BEGIN /** The capabilities of touches during projection applications + + @added in SmartDeviceLink 3.0.0 */ @interface SDLTouchEventCapabilities : SDLRPCStruct +/** + * @param pressAvailable - @(pressAvailable) + * @param multiTouchAvailable - @(multiTouchAvailable) + * @param doublePressAvailable - @(doublePressAvailable) + * @return A SDLTouchEventCapabilities object + */ +- (instancetype)initWithPressAvailable:(BOOL)pressAvailable multiTouchAvailable:(BOOL)multiTouchAvailable doublePressAvailable:(BOOL)doublePressAvailable; + /** Whether or not long presses are available */ diff --git a/SmartDeviceLink/public/SDLTouchEventCapabilities.m b/SmartDeviceLink/public/SDLTouchEventCapabilities.m index 5a69566da9..4abb8df4f7 100644 --- a/SmartDeviceLink/public/SDLTouchEventCapabilities.m +++ b/SmartDeviceLink/public/SDLTouchEventCapabilities.m @@ -11,6 +11,17 @@ @implementation SDLTouchEventCapabilities +- (instancetype)initWithPressAvailable:(BOOL)pressAvailable multiTouchAvailable:(BOOL)multiTouchAvailable doublePressAvailable:(BOOL)doublePressAvailable { + self = [self init]; + if (!self) { + return nil; + } + self.pressAvailable = @(pressAvailable); + self.multiTouchAvailable = @(multiTouchAvailable); + self.doublePressAvailable = @(doublePressAvailable); + return self; +} + - (void)setPressAvailable:(NSNumber *)pressAvailable { [self.store sdl_setObject:pressAvailable forName:SDLRPCParameterNamePressAvailable]; } diff --git a/SmartDeviceLink/public/SDLTouchType.h b/SmartDeviceLink/public/SDLTouchType.h index 83faad3c21..b4fd5dbda3 100644 --- a/SmartDeviceLink/public/SDLTouchType.h +++ b/SmartDeviceLink/public/SDLTouchType.h @@ -1,5 +1,34 @@ -// SDLTouchType.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLTriggerSource.h b/SmartDeviceLink/public/SDLTriggerSource.h index f10e7f0b59..f955140135 100644 --- a/SmartDeviceLink/public/SDLTriggerSource.h +++ b/SmartDeviceLink/public/SDLTriggerSource.h @@ -1,5 +1,34 @@ -// SDLTriggerSource.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLTurn.h b/SmartDeviceLink/public/SDLTurn.h index b86d646951..7553700153 100644 --- a/SmartDeviceLink/public/SDLTurn.h +++ b/SmartDeviceLink/public/SDLTurn.h @@ -1,5 +1,34 @@ -// SDLTurn.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" @@ -9,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN /** A struct used in UpdateTurnList for Turn-by-Turn navigation applications + + @added in SmartDeviceLink 2.0.0 */ @interface SDLTurn : SDLRPCStruct diff --git a/SmartDeviceLink/public/SDLTurnSignal.h b/SmartDeviceLink/public/SDLTurnSignal.h index 34c9e7ea92..cb445691d1 100644 --- a/SmartDeviceLink/public/SDLTurnSignal.h +++ b/SmartDeviceLink/public/SDLTurnSignal.h @@ -1,15 +1,41 @@ -// -// SDLTurnSignal.h -// SmartDeviceLink -// -// Created by Nicole on 7/19/18. -// Copyright © 2018 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 "SDLEnum.h" /** * Enumeration that describes the status of the turn light indicator. + * + * @added in SmartDeviceLink 5.0.0 */ typedef SDLEnum SDLTurnSignal NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLUnpublishAppService.h b/SmartDeviceLink/public/SDLUnpublishAppService.h index 56e1f12b76..877976c40e 100644 --- a/SmartDeviceLink/public/SDLUnpublishAppService.h +++ b/SmartDeviceLink/public/SDLUnpublishAppService.h @@ -1,10 +1,34 @@ -// -// SDLUnpublishAppService.h -// SmartDeviceLink -// -// Created by Bretty White on 7/15/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" @@ -12,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN /** * Unpublish an existing service published by this application. + * + * @added in SmartDeviceLink 6.0.0 */ @interface SDLUnpublishAppService : SDLRPCRequest diff --git a/SmartDeviceLink/public/SDLUnpublishAppServiceResponse.h b/SmartDeviceLink/public/SDLUnpublishAppServiceResponse.h index fb048ca4b1..e311a29e16 100644 --- a/SmartDeviceLink/public/SDLUnpublishAppServiceResponse.h +++ b/SmartDeviceLink/public/SDLUnpublishAppServiceResponse.h @@ -1,10 +1,34 @@ -// -// SDLUnpublishAppServiceResponse.h -// SmartDeviceLink -// -// Created by Bretty White on 7/15/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 "SDLRPCResponse.h" @@ -12,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN /** * The response to UnpublishAppService + * + * @added in SmartDeviceLink 6.0.0 */ @interface SDLUnpublishAppServiceResponse : SDLRPCResponse diff --git a/SmartDeviceLink/public/SDLUnregisterAppInterface.h b/SmartDeviceLink/public/SDLUnregisterAppInterface.h index 35ca046396..b359b83870 100644 --- a/SmartDeviceLink/public/SDLUnregisterAppInterface.h +++ b/SmartDeviceLink/public/SDLUnregisterAppInterface.h @@ -1,9 +1,40 @@ -// SDLUnregisterAppInterface.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" +NS_ASSUME_NONNULL_BEGIN + /** * Terminates an application's interface registration. This causes SDL® to * dispose of all resources associated with the application's interface @@ -18,10 +49,9 @@ *

* * See SDLRegisterAppInterface SDLOnAppInterfaceUnregistered + * + * @added in SmartDeviceLink 1.0.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLUnregisterAppInterface : SDLRPCRequest @end diff --git a/SmartDeviceLink/public/SDLUnregisterAppInterfaceResponse.h b/SmartDeviceLink/public/SDLUnregisterAppInterfaceResponse.h index da366a5e42..8cc9527cd6 100644 --- a/SmartDeviceLink/public/SDLUnregisterAppInterfaceResponse.h +++ b/SmartDeviceLink/public/SDLUnregisterAppInterfaceResponse.h @@ -1,5 +1,34 @@ -// SDLUnregisterAppInterfaceResponse.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" @@ -9,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN /** Response to UnregisterAppInterface - SmartDeviceLink 1.0 + @added in SmartDeviceLink 1.0.0 */ @interface SDLUnregisterAppInterfaceResponse : SDLRPCResponse diff --git a/SmartDeviceLink/public/SDLUnsubscribeButton.h b/SmartDeviceLink/public/SDLUnsubscribeButton.h index 9fd78ec252..b7602663ee 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeButton.h +++ b/SmartDeviceLink/public/SDLUnsubscribeButton.h @@ -1,10 +1,40 @@ -// SDLUnsubscribeButton.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 "SDLButtonName.h" +NS_ASSUME_NONNULL_BEGIN /** * Deletes a subscription to button notifications for the specified button. For @@ -15,13 +45,10 @@ *

* HMILevel needs to be FULL, LIMITED or BACKGROUND *

- + * @since SmartDeviceLink 1.0
* See SDLSubscribeButton */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLUnsubscribeButton : SDLRPCRequest /// Convenience init to unsubscribe from a subscription button diff --git a/SmartDeviceLink/public/SDLUnsubscribeButtonResponse.h b/SmartDeviceLink/public/SDLUnsubscribeButtonResponse.h index 23753b0970..9a002e923a 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeButtonResponse.h +++ b/SmartDeviceLink/public/SDLUnsubscribeButtonResponse.h @@ -1,5 +1,34 @@ -// SDLUnsubscribeButtonResponse.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" @@ -9,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN /** Response to UnsubscribeButton - Since SmartDeviceLink 1.0 + @added in SmartDeviceLink 1.0.0 */ @interface SDLUnsubscribeButtonResponse : SDLRPCResponse diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h index 57acba53d3..95225e338d 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h @@ -1,9 +1,40 @@ -// SDLUnsubscribeVehicleData.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" +NS_ASSUME_NONNULL_BEGIN + /** * This function is used to unsubscribe the notifications from the * subscribeVehicleData function @@ -16,11 +47,43 @@ * @since SmartDeviceLink 2.0
* See SDLSubscribeVehicleData SDLGetVehicleData */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLUnsubscribeVehicleData : SDLRPCRequest +/** + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModeStatus - clusterModeStatus + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLUnsubscribeVehicleData object + */ +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey windowStatus:(nullable NSNumber *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering; + /** * Convenience init for unsubscribing to all possible vehicle data items. * @@ -92,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLUnsubscribeVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSNumber *)windowStatus; +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey handsOffSteering:(nullable NSNumber *)handsOffSteering windowStatus:(nullable NSNumber *)windowStatus __deprecated; /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m index 217c23ce5d..89b3c74b0d 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m @@ -23,6 +23,44 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable NSNumber *)gps speed:(nullable NSNumber *)speed rpm:(nullable NSNumber *)rpm instantFuelConsumption:(nullable NSNumber *)instantFuelConsumption fuelRange:(nullable NSNumber *)fuelRange externalTemperature:(nullable NSNumber *)externalTemperature turnSignal:(nullable NSNumber *)turnSignal gearStatus:(nullable NSNumber *)gearStatus tirePressure:(nullable NSNumber *)tirePressure odometer:(nullable NSNumber *)odometer beltStatus:(nullable NSNumber *)beltStatus bodyInformation:(nullable NSNumber *)bodyInformation deviceStatus:(nullable NSNumber *)deviceStatus driverBraking:(nullable NSNumber *)driverBraking wiperStatus:(nullable NSNumber *)wiperStatus headLampStatus:(nullable NSNumber *)headLampStatus engineTorque:(nullable NSNumber *)engineTorque accPedalPosition:(nullable NSNumber *)accPedalPosition steeringWheelAngle:(nullable NSNumber *)steeringWheelAngle engineOilLife:(nullable NSNumber *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber *)stabilityControlsStatus eCallInfo:(nullable NSNumber *)eCallInfo airbagStatus:(nullable NSNumber *)airbagStatus emergencyEvent:(nullable NSNumber *)emergencyEvent clusterModeStatus:(nullable NSNumber *)clusterModeStatus myKey:(nullable NSNumber *)myKey windowStatus:(nullable NSNumber *)windowStatus handsOffSteering:(nullable NSNumber *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModeStatus = clusterModeStatus; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus { self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:nil windowStatus:nil]; if (self) { diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h index cbc79afc3b..f62493ffd1 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h @@ -1,5 +1,34 @@ -// SDLUnsubscribeVehicleDataResponse.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" @@ -15,6 +44,41 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLUnsubscribeVehicleDataResponse : SDLRPCResponse +/** + * @param gps - gps + * @param speed - speed + * @param rpm - rpm + * @param instantFuelConsumption - instantFuelConsumption + * @param fuelRange - fuelRange + * @param externalTemperature - externalTemperature + * @param turnSignal - turnSignal + * @param gearStatus - gearStatus + * @param tirePressure - tirePressure + * @param odometer - odometer + * @param beltStatus - beltStatus + * @param bodyInformation - bodyInformation + * @param deviceStatus - deviceStatus + * @param driverBraking - driverBraking + * @param wiperStatus - wiperStatus + * @param headLampStatus - headLampStatus + * @param engineTorque - engineTorque + * @param accPedalPosition - accPedalPosition + * @param steeringWheelAngle - steeringWheelAngle + * @param engineOilLife - engineOilLife + * @param electronicParkBrakeStatus - electronicParkBrakeStatus + * @param cloudAppVehicleID - cloudAppVehicleID + * @param stabilityControlsStatus - stabilityControlsStatus + * @param eCallInfo - eCallInfo + * @param airbagStatus - airbagStatus + * @param emergencyEvent - emergencyEvent + * @param clusterModes - clusterModes + * @param myKey - myKey + * @param windowStatus - windowStatus + * @param handsOffSteering - handsOffSteering + * @return A SDLUnsubscribeVehicleDataResponse object + */ +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering; + /** * Convenience init for setting all possible values on vehicle data items. * @@ -50,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLUnsubscribeVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus; +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus __deprecated; /** * See GearStatus diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m index 3a44257e11..00a41f1ddc 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m @@ -24,6 +24,44 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering { + self = [self init]; + if (!self) { + return nil; + } + self.gps = gps; + self.speed = speed; + self.rpm = rpm; + self.instantFuelConsumption = instantFuelConsumption; + self.fuelRange = fuelRange; + self.externalTemperature = externalTemperature; + self.turnSignal = turnSignal; + self.gearStatus = gearStatus; + self.tirePressure = tirePressure; + self.odometer = odometer; + self.beltStatus = beltStatus; + self.bodyInformation = bodyInformation; + self.deviceStatus = deviceStatus; + self.driverBraking = driverBraking; + self.wiperStatus = wiperStatus; + self.headLampStatus = headLampStatus; + self.engineTorque = engineTorque; + self.accPedalPosition = accPedalPosition; + self.steeringWheelAngle = steeringWheelAngle; + self.engineOilLife = engineOilLife; + self.electronicParkBrakeStatus = electronicParkBrakeStatus; + self.cloudAppVehicleID = cloudAppVehicleID; + self.stabilityControlsStatus = stabilityControlsStatus; + self.eCallInfo = eCallInfo; + self.airbagStatus = airbagStatus; + self.emergencyEvent = emergencyEvent; + self.clusterModes = clusterModes; + self.myKey = myKey; + self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + return self; +} + - (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLUnsubscribeWayPoints.h b/SmartDeviceLink/public/SDLUnsubscribeWayPoints.h index 4b67ac2772..cf2bc5b0f1 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeWayPoints.h +++ b/SmartDeviceLink/public/SDLUnsubscribeWayPoints.h @@ -1,5 +1,34 @@ -// SDLUnsubscribeWaypoints.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" @@ -7,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN /** Request to unsubscribe from navigation WayPoints and Destination + + @added in SmartDeviceLink 4.1.0 */ @interface SDLUnsubscribeWayPoints : SDLRPCRequest diff --git a/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.h b/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.h index 304930a4d4..ca219017f7 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.h +++ b/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.h @@ -1,15 +1,60 @@ -// SDLUnsubscribeWaypointsResponse.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" +@class SDLLocationDetails; + NS_ASSUME_NONNULL_BEGIN /** Response to UnsubscribeWayPoints + + @added in SmartDeviceLink 4.1.0 */ @interface SDLUnsubscribeWayPointsResponse : SDLRPCResponse +/** + * @param wayPoints - wayPoints + * @return A SDLUnsubscribeWayPointsResponse object + */ +- (instancetype)initWithWayPoints:(nullable NSArray *)wayPoints; + +/** + * See LocationDetails + * {"array_min_size": 1, "array_max_size": 10} + */ +@property (nullable, strong, nonatomic) NSArray *wayPoints; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.m b/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.m index 7eb3e63691..048cef4325 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.m +++ b/SmartDeviceLink/public/SDLUnsubscribeWayPointsResponse.m @@ -4,6 +4,7 @@ #import "SDLUnsubscribeWayPointsResponse.h" #import "NSMutableDictionary+Store.h" +#import "SDLLocationDetails.h" #import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" @@ -20,6 +21,23 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithWayPoints:(nullable NSArray *)wayPoints { + self = [self init]; + if (!self) { + return nil; + } + self.wayPoints = wayPoints; + return self; +} + +- (void)setWayPoints:(nullable NSArray *)wayPoints { + [self.parameters sdl_setObject:wayPoints forName:SDLRPCParameterNameWayPoints]; +} + +- (nullable NSArray *)wayPoints { + return [self.parameters sdl_objectsForName:SDLRPCParameterNameWayPoints ofClass:SDLLocationDetails.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLUpdateMode.h b/SmartDeviceLink/public/SDLUpdateMode.h index fd9cafb2ed..5e91b4a8fe 100644 --- a/SmartDeviceLink/public/SDLUpdateMode.h +++ b/SmartDeviceLink/public/SDLUpdateMode.h @@ -1,5 +1,34 @@ -// SDLUpdateMode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLUpdateTurnList.h b/SmartDeviceLink/public/SDLUpdateTurnList.h index 0133e0e2f2..9df3547b9b 100644 --- a/SmartDeviceLink/public/SDLUpdateTurnList.h +++ b/SmartDeviceLink/public/SDLUpdateTurnList.h @@ -1,5 +1,34 @@ -// SDLUpdateTurnList.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" @@ -7,14 +36,13 @@ @class SDLSoftButton; @class SDLTurn; -/** Updates the list of next maneuvers, which can be requested by the user pressing the softbutton
+NS_ASSUME_NONNULL_BEGIN + +/** Updates the list of next maneuvers, which can be requested by the user pressing the softbutton * “Turns” on the Navigation base screen. Three softbuttons are predefined by the system: Up, Down, Close. - *

+ * * @since SmartDeviceLink 2.0 */ - -NS_ASSUME_NONNULL_BEGIN - @interface SDLUpdateTurnList : SDLRPCRequest /// Convenience init to update a list of maneuvers for navigation diff --git a/SmartDeviceLink/public/SDLUpdateTurnListResponse.h b/SmartDeviceLink/public/SDLUpdateTurnListResponse.h index cc05e2ec7e..ef9bd3036a 100644 --- a/SmartDeviceLink/public/SDLUpdateTurnListResponse.h +++ b/SmartDeviceLink/public/SDLUpdateTurnListResponse.h @@ -1,5 +1,34 @@ -// SDLUpdateTurnListResponse.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" diff --git a/SmartDeviceLink/public/SDLVehicleDataActiveStatus.h b/SmartDeviceLink/public/SDLVehicleDataActiveStatus.h index bfcb31c5b0..da675f57d9 100644 --- a/SmartDeviceLink/public/SDLVehicleDataActiveStatus.h +++ b/SmartDeviceLink/public/SDLVehicleDataActiveStatus.h @@ -1,5 +1,34 @@ -// SDLVehicleDataActiveStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVehicleDataEventStatus.h b/SmartDeviceLink/public/SDLVehicleDataEventStatus.h index 7a453e9644..9d571cf585 100644 --- a/SmartDeviceLink/public/SDLVehicleDataEventStatus.h +++ b/SmartDeviceLink/public/SDLVehicleDataEventStatus.h @@ -1,5 +1,34 @@ -// SDLVehicleDataEventStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVehicleDataNotificationStatus.h b/SmartDeviceLink/public/SDLVehicleDataNotificationStatus.h index 40e28ab8d0..3638e078f1 100644 --- a/SmartDeviceLink/public/SDLVehicleDataNotificationStatus.h +++ b/SmartDeviceLink/public/SDLVehicleDataNotificationStatus.h @@ -1,5 +1,34 @@ -// SDLVehicleDataNotificationStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVehicleDataResult.h b/SmartDeviceLink/public/SDLVehicleDataResult.h index deeb325a94..017e1d71f5 100644 --- a/SmartDeviceLink/public/SDLVehicleDataResult.h +++ b/SmartDeviceLink/public/SDLVehicleDataResult.h @@ -1,5 +1,34 @@ -// SDLVehicleDataResult.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" @@ -21,6 +50,14 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithDataType:(SDLVehicleDataType)dataType resultCode:(SDLVehicleDataResultCode)resultCode; +/** + * @param dataType - dataType + * @param resultCode - resultCode + * @param oemCustomDataType - oemCustomDataType + * @return A SDLVehicleDataResult object + */ +- (instancetype)initWithDataType:(SDLVehicleDataType)dataType resultCode:(SDLVehicleDataResultCode)resultCode oemCustomDataType:(nullable NSString *)oemCustomDataType; + /** * Convenience init for creating a SDLVehicleDataResult with a customDataType * @@ -34,17 +71,25 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) SDLVehicleDataType dataType; +/** + Published data result code + */ +@property (strong, nonatomic) SDLVehicleDataResultCode resultCode; + /** OEM custom defined published data element type - + Added SmartDeviceLink 6.0 */ -@property (nullable, strong, nonatomic) NSString *customOEMDataType; +@property (nullable, strong, nonatomic) NSString *customOEMDataType __deprecated_msg("Use oemCustomDataType instead"); /** - Published data result code + * Type of requested oem specific parameter + * {"string_min_length": 1, "string_max_length": null} + * + * @added in SmartDeviceLink 6.0.0 */ -@property (strong, nonatomic) SDLVehicleDataResultCode resultCode; +@property (nullable, strong, nonatomic) NSString *oemCustomDataType; @end diff --git a/SmartDeviceLink/public/SDLVehicleDataResult.m b/SmartDeviceLink/public/SDLVehicleDataResult.m index db6995051f..46910e8537 100644 --- a/SmartDeviceLink/public/SDLVehicleDataResult.m +++ b/SmartDeviceLink/public/SDLVehicleDataResult.m @@ -22,13 +22,22 @@ - (instancetype)initWithDataType:(SDLVehicleDataType)dataType resultCode:(SDLVeh return self; } +- (instancetype)initWithDataType:(SDLVehicleDataType)dataType resultCode:(SDLVehicleDataResultCode)resultCode oemCustomDataType:(nullable NSString *)oemCustomDataType { + self = [self initWithDataType:dataType resultCode:resultCode]; + if (!self) { + return nil; + } + self.oemCustomDataType = oemCustomDataType; + return self; +} + - (instancetype)initWithCustomOEMDataType:(NSString *)customDataType resultCode:(SDLVehicleDataResultCode)resultCode{ self = [self init]; if (!self) { return nil; } - self.customOEMDataType = customDataType; + self.oemCustomDataType = customDataType; self.resultCode = resultCode; return self; @@ -61,6 +70,14 @@ - (void)setCustomOEMDataType:(nullable NSString *)oemCustomDataType { [self.store sdl_setObject:oemCustomDataType forName:SDLRPCParameterNameOEMCustomDataType]; } +- (void)setOemCustomDataType:(nullable NSString *)oemCustomDataType { + [self.store sdl_setObject:oemCustomDataType forName:SDLRPCParameterNameOEMCustomDataType]; +} + +- (nullable NSString *)oemCustomDataType { + return [self.store sdl_objectForName:SDLRPCParameterNameOEMCustomDataType ofClass:NSString.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLVehicleDataResultCode.h b/SmartDeviceLink/public/SDLVehicleDataResultCode.h index 9dd6f730f6..a403622446 100644 --- a/SmartDeviceLink/public/SDLVehicleDataResultCode.h +++ b/SmartDeviceLink/public/SDLVehicleDataResultCode.h @@ -1,5 +1,34 @@ -// SDLVehicleDataResultCode.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVehicleDataStatus.h b/SmartDeviceLink/public/SDLVehicleDataStatus.h index 16e32700a7..081fc0ca91 100644 --- a/SmartDeviceLink/public/SDLVehicleDataStatus.h +++ b/SmartDeviceLink/public/SDLVehicleDataStatus.h @@ -1,5 +1,34 @@ -// SDLVehicleDataStatus.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVehicleDataType.h b/SmartDeviceLink/public/SDLVehicleDataType.h index 3426695d0b..31649472cd 100644 --- a/SmartDeviceLink/public/SDLVehicleDataType.h +++ b/SmartDeviceLink/public/SDLVehicleDataType.h @@ -1,6 +1,34 @@ -// SDLVehicleDataType.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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVehicleType.h b/SmartDeviceLink/public/SDLVehicleType.h index 0c9c100dc4..9e0c8426cd 100644 --- a/SmartDeviceLink/public/SDLVehicleType.h +++ b/SmartDeviceLink/public/SDLVehicleType.h @@ -1,5 +1,34 @@ -// SDLVehicleType.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" @@ -9,10 +38,19 @@ NS_ASSUME_NONNULL_BEGIN /** * Describes the type of vehicle the mobile phone is connected with. * - * @since SDL 2.0 + * @added in SmartDeviceLink 2.0.0 */ @interface SDLVehicleType : SDLRPCStruct +/** + * @param make - make + * @param model - model + * @param modelYear - modelYear + * @param trim - trim + * @return A SDLVehicleType object + */ +- (instancetype)initWithMake:(nullable NSString *)make model:(nullable NSString *)model modelYear:(nullable NSString *)modelYear trim:(nullable NSString *)trim; + /** * The make of the vehicle * diff --git a/SmartDeviceLink/public/SDLVehicleType.m b/SmartDeviceLink/public/SDLVehicleType.m index 5f3df07001..15a47b9f0f 100644 --- a/SmartDeviceLink/public/SDLVehicleType.m +++ b/SmartDeviceLink/public/SDLVehicleType.m @@ -11,6 +11,18 @@ @implementation SDLVehicleType +- (instancetype)initWithMake:(nullable NSString *)make model:(nullable NSString *)model modelYear:(nullable NSString *)modelYear trim:(nullable NSString *)trim { + self = [self init]; + if (!self) { + return nil; + } + self.make = make; + self.model = model; + self.modelYear = modelYear; + self.trim = trim; + return self; +} + - (void)setMake:(nullable NSString *)make { [self.store sdl_setObject:make forName:SDLRPCParameterNameMake]; } diff --git a/SmartDeviceLink/public/SDLVentilationMode.h b/SmartDeviceLink/public/SDLVentilationMode.h index ea47c56754..7f4d49789d 100644 --- a/SmartDeviceLink/public/SDLVentilationMode.h +++ b/SmartDeviceLink/public/SDLVentilationMode.h @@ -1,11 +1,41 @@ -// -// SDLVentilationMode.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 "SDLEnum.h" /** The ventilation mode. Used in ClimateControlCapabilities + + @added in SmartDeviceLink 4.5.0 */ typedef SDLEnum SDLVentilationMode NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.h b/SmartDeviceLink/public/SDLVideoStreamingCapability.h index 6a28c30bcc..2d3aa0a103 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.h +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.h @@ -1,10 +1,34 @@ -// -// SDLVideoStreamingCapability.h -// SmartDeviceLink-iOS -// -// Created by Brett McIsaac on 7/31/17. -// Copyright © 2017 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 "SDLRPCMessage.h" @@ -15,9 +39,23 @@ NS_ASSUME_NONNULL_BEGIN /** Contains information about this system's video streaming capabilities + + @added in SmartDeviceLink 4.5.0 */ @interface SDLVideoStreamingCapability : SDLRPCStruct +/** + * @param preferredResolution - preferredResolution + * @param maxBitrate - maxBitrate + * @param supportedFormats - supportedFormats + * @param hapticSpatialDataSupported - hapticSpatialDataSupported + * @param diagonalScreenSize - diagonalScreenSize + * @param pixelPerInch - pixelPerInch + * @param scale - scale + * @return A SDLVideoStreamingCapability object + */ +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber *)diagonalScreenSize pixelPerInch:(nullable NSNumber *)pixelPerInch scale:(nullable NSNumber *)scale; + /** Convenience init for creating a video streaming capability with all parameters. @@ -30,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN @param scale The scaling factor the app should use to change the size of the projecting view @return A SDLVideoStreamingCapability object */ -- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale; +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale __deprecated_msg("Use initWithPreferredResolution:maxBitrate:supportedFormats:hapticSpatialDataSupported:diagonalScreenSize:pixelPerInch:scale: instead"); /** The preferred resolution of a video stream for decoding and rendering on HMI diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index ec4f2c5914..153ea20933 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -17,6 +17,21 @@ @implementation SDLVideoStreamingCapability +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber *)diagonalScreenSize pixelPerInch:(nullable NSNumber *)pixelPerInch scale:(nullable NSNumber *)scale { + self = [self init]; + if (!self) { + return nil; + } + self.preferredResolution = preferredResolution; + self.maxBitrate = maxBitrate; + self.supportedFormats = supportedFormats; + self.hapticSpatialDataSupported = hapticSpatialDataSupported; + self.diagonalScreenSize = diagonalScreenSize; + self.pixelPerInch = pixelPerInch; + self.scale = scale; + return self; +} + - (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLVideoStreamingCodec.h b/SmartDeviceLink/public/SDLVideoStreamingCodec.h index 20d9c2a316..dbea7228b8 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCodec.h +++ b/SmartDeviceLink/public/SDLVideoStreamingCodec.h @@ -1,7 +1,34 @@ -// -// SDLVideoStreamingCodec.h -// SmartDeviceLink-iOS -// +/* + * 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 "SDLEnum.h" diff --git a/SmartDeviceLink/public/SDLVideoStreamingFormat.h b/SmartDeviceLink/public/SDLVideoStreamingFormat.h index 958ae43b26..7fde754dff 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingFormat.h +++ b/SmartDeviceLink/public/SDLVideoStreamingFormat.h @@ -1,7 +1,34 @@ -// -// SDLVideoStreamingFormat.h -// SmartDeviceLink-iOS -// +/* + * 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 "SDLVideoStreamingProtocol.h" @@ -11,15 +38,36 @@ NS_ASSUME_NONNULL_BEGIN /** An available format for video streaming in projection applications + + @added in SmartDeviceLink 4.5.0 */ @interface SDLVideoStreamingFormat : SDLRPCStruct +/** + * @param protocolParam - protocolParam + * @param codec - codec + * @return A SDLVideoStreamingFormat object + */ +- (instancetype)initWithProtocolParam:(SDLVideoStreamingProtocol)protocolParam codec:(SDLVideoStreamingCodec)codec; + +/// Convenience init +/// +/// @param codec Codec type, see VideoStreamingCodec +/// @param protocol Protocol type, see VideoStreamingProtocol +/// @return An SDLVideoStreamingFormat object +- (instancetype)initWithCodec:(SDLVideoStreamingCodec)codec protocol:(SDLVideoStreamingProtocol)protocol __deprecated_msg("Use initWithProtocolParam:codec: instead"); + +/** + * Protocol type, see VideoStreamingProtocol + */ +@property (strong, nonatomic) SDLVideoStreamingProtocol protocolParam; + /** Protocol type, see VideoStreamingProtocol Required */ -@property (strong, nonatomic) SDLVideoStreamingProtocol protocol; +@property (strong, nonatomic) SDLVideoStreamingProtocol protocol __deprecated_msg("Use protocolParam instead"); /** Codec type, see VideoStreamingCodec @@ -28,13 +76,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) SDLVideoStreamingCodec codec; -/// Convenience init -/// -/// @param codec Codec type, see VideoStreamingCodec -/// @param protocol Protocol type, see VideoStreamingProtocol -/// @return An SDLVideoStreamingFormat object -- (instancetype)initWithCodec:(SDLVideoStreamingCodec)codec protocol:(SDLVideoStreamingProtocol)protocol; - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLVideoStreamingFormat.m b/SmartDeviceLink/public/SDLVideoStreamingFormat.m index 4fda8d3401..246afa9b62 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingFormat.m +++ b/SmartDeviceLink/public/SDLVideoStreamingFormat.m @@ -14,6 +14,16 @@ @implementation SDLVideoStreamingFormat +- (instancetype)initWithProtocolParam:(SDLVideoStreamingProtocol)protocolParam codec:(SDLVideoStreamingCodec)codec { + self = [self init]; + if (!self) { + return nil; + } + self.protocolParam = protocolParam; + self.codec = codec; + return self; +} + - (instancetype)initWithCodec:(SDLVideoStreamingCodec)codec protocol:(SDLVideoStreamingProtocol)protocol { self = [self init]; if (!self) { return nil; } @@ -24,6 +34,15 @@ - (instancetype)initWithCodec:(SDLVideoStreamingCodec)codec protocol:(SDLVideoSt return self; } +- (void)setProtocolParam:(SDLVideoStreamingProtocol)protocolParam { + [self.store sdl_setObject:protocolParam forName:SDLRPCParameterNameVideoProtocol]; +} + +- (SDLVideoStreamingProtocol)protocolParam { + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameVideoProtocol error:&error]; +} + - (SDLVideoStreamingProtocol)protocol { NSError *error = nil; return [self.store sdl_enumForName:SDLRPCParameterNameVideoProtocol error:&error]; diff --git a/SmartDeviceLink/public/SDLVideoStreamingProtocol.h b/SmartDeviceLink/public/SDLVideoStreamingProtocol.h index 8a285aa801..05b5455d59 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingProtocol.h +++ b/SmartDeviceLink/public/SDLVideoStreamingProtocol.h @@ -1,12 +1,41 @@ -// -// SDLVideoStreamingProtocol.h -// SmartDeviceLink-iOS -// +/* + * 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 "SDLEnum.h" /** * Enum for each type of video streaming protocol, used in VideoStreamingFormat + * + * @added in SmartDeviceLink 4.5.0 */ typedef SDLEnum SDLVideoStreamingProtocol NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLVideoStreamingState.h b/SmartDeviceLink/public/SDLVideoStreamingState.h index c09fea8759..8498439d03 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingState.h +++ b/SmartDeviceLink/public/SDLVideoStreamingState.h @@ -1,15 +1,41 @@ -// -// SDLVideoStreamingState.h -// SmartDeviceLink -// -// Created by Joel Fischer on 6/19/18. -// Copyright © 2018 Livio. 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 "SDLEnum.h" /** * Enum for each type of video streaming protocol, used in VideoStreamingFormat + * + * @added in SmartDeviceLink 5.0.0 */ typedef SDLEnum SDLVideoStreamingState NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLVrCapabilities.h b/SmartDeviceLink/public/SDLVrCapabilities.h index 39ac75da86..568df1fe19 100644 --- a/SmartDeviceLink/public/SDLVrCapabilities.h +++ b/SmartDeviceLink/public/SDLVrCapabilities.h @@ -1,5 +1,34 @@ -// SDLVRCapabilities.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 "SDLEnum.h" @@ -7,7 +36,7 @@ /** * The VR capabilities of the connected SDL platform. Used in RegisterAppInterfaceResponse. * - * @since SDL 1.0 + * @added in SmartDeviceLink 1.0.0 */ typedef SDLEnum SDLVRCapabilities NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLVrHelpItem.h b/SmartDeviceLink/public/SDLVrHelpItem.h index 9587da9c10..ca3f79d569 100644 --- a/SmartDeviceLink/public/SDLVrHelpItem.h +++ b/SmartDeviceLink/public/SDLVrHelpItem.h @@ -1,5 +1,34 @@ -// SDLVRHelpItem.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" @@ -9,15 +38,32 @@ NS_ASSUME_NONNULL_BEGIN /** A help item for voice commands, used locally in interaction lists and globally + + @added in SmartDeviceLink 2.0.0 */ @interface SDLVRHelpItem : SDLRPCStruct +/** + * @param text - text + * @param position - @(position) + * @return A SDLVrHelpItem object + */ +- (instancetype)initWithText:(NSString *)text position:(UInt8)position; + +/** + * @param text - text + * @param position - @(position) + * @param image - image + * @return A SDLVrHelpItem object + */ +- (instancetype)initWithText:(NSString *)text position:(UInt8)position image:(nullable SDLImage *)image; + /// Convenience init to create a VR help item with the following parameters /// /// @param text Text to display for VR Help item /// @param image Image for VR Help item /// @return An SDLVRHelpItem object -- (instancetype)initWithText:(NSString *)text image:(nullable SDLImage *)image; +- (instancetype)initWithText:(NSString *)text image:(nullable SDLImage *)image __deprecated_msg("Use initWithText:position:image: instead"); /// Convenience init to create a VR help item with all parameters /// @@ -25,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param image Image for VR Help item /// @param position Position to display item in VR Help list /// @return An SDLVRHelpItem object -- (instancetype)initWithText:(NSString *)text image:(nullable SDLImage *)image position:(UInt8)position; +- (instancetype)initWithText:(NSString *)text image:(nullable SDLImage *)image position:(UInt8)position __deprecated_msg("Use initWithText:position:image: instead"); /** Text to display for VR Help item diff --git a/SmartDeviceLink/public/SDLVrHelpItem.m b/SmartDeviceLink/public/SDLVrHelpItem.m index 8a9424b624..1e913f55fc 100644 --- a/SmartDeviceLink/public/SDLVrHelpItem.m +++ b/SmartDeviceLink/public/SDLVrHelpItem.m @@ -12,6 +12,25 @@ @implementation SDLVRHelpItem +- (instancetype)initWithText:(NSString *)text position:(UInt8)position { + self = [self init]; + if (!self) { + return nil; + } + self.text = text; + self.position = @(position); + return self; +} + +- (instancetype)initWithText:(NSString *)text position:(UInt8)position image:(nullable SDLImage *)image { + self = [self initWithText:text position:position]; + if (!self) { + return nil; + } + self.image = image; + return self; +} + - (instancetype)initWithText:(NSString *)text image:(nullable SDLImage *)image position:(UInt8)position { self = [self initWithText:text image:image]; if (!self) { diff --git a/SmartDeviceLink/public/SDLWarningLightStatus.h b/SmartDeviceLink/public/SDLWarningLightStatus.h index ad7be994c5..b7f85ea2c8 100644 --- a/SmartDeviceLink/public/SDLWarningLightStatus.h +++ b/SmartDeviceLink/public/SDLWarningLightStatus.h @@ -1,5 +1,34 @@ -// SDLWarningLightStatus.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 "SDLEnum.h" @@ -7,7 +36,7 @@ /** * Reflects the status of a cluster instrument warning light. Used in TireStatus * - * @since SDL 2.0 + * @added in SmartDeviceLink 2.0.0 */ typedef SDLEnum SDLWarningLightStatus NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLWayPointType.h b/SmartDeviceLink/public/SDLWayPointType.h index 639c75a7b1..80566d5fa6 100644 --- a/SmartDeviceLink/public/SDLWayPointType.h +++ b/SmartDeviceLink/public/SDLWayPointType.h @@ -1,10 +1,41 @@ -// SDLWaypointType.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 "SDLEnum.h" /** The type of a navigation waypoint. Used in GetWayPoints. + + @added in SmartDeviceLink 4.1.0 */ typedef SDLEnum SDLWayPointType NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLWeatherAlert.h b/SmartDeviceLink/public/SDLWeatherAlert.h index 21d85456f1..c3981a845d 100644 --- a/SmartDeviceLink/public/SDLWeatherAlert.h +++ b/SmartDeviceLink/public/SDLWeatherAlert.h @@ -1,10 +1,34 @@ -// -// SDLWeatherAlert.h -// SmartDeviceLink -// -// Created by Nicole on 2/6/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" #import "SDLDateTime.h" @@ -13,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN /// Contains information about a weather alert /// -/// @since RPC 5.1 +/// @added in SmartDeviceLink 5.1.0 @interface SDLWeatherAlert : SDLRPCStruct /** diff --git a/SmartDeviceLink/public/SDLWeatherData.h b/SmartDeviceLink/public/SDLWeatherData.h index 68ea63cdc6..647d85ae18 100644 --- a/SmartDeviceLink/public/SDLWeatherData.h +++ b/SmartDeviceLink/public/SDLWeatherData.h @@ -1,10 +1,34 @@ -// -// SDLWeatherData.h -// SmartDeviceLink -// -// Created by Nicole on 2/7/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" @@ -17,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN /// Contains information about the current weather /// -/// @since RPC 5.1 +/// @added in SmartDeviceLink 5.1.0 @interface SDLWeatherData : SDLRPCStruct /** diff --git a/SmartDeviceLink/public/SDLWeatherServiceData.h b/SmartDeviceLink/public/SDLWeatherServiceData.h index 488e30fb30..cd1fa102c2 100644 --- a/SmartDeviceLink/public/SDLWeatherServiceData.h +++ b/SmartDeviceLink/public/SDLWeatherServiceData.h @@ -1,10 +1,34 @@ -// -// SDLWeatherServiceData.h -// SmartDeviceLink -// -// Created by Nicole on 2/7/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" @@ -15,7 +39,9 @@ NS_ASSUME_NONNULL_BEGIN /** - * This data is related to what a weather service would provide. + * This data is related to what a weather service would provide. + * + * @added in SmartDeviceLink 5.1.0 */ @interface SDLWeatherServiceData : SDLRPCStruct @@ -25,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN * @param location The location * @return A SDLWeatherServiceData object */ -- (instancetype)initWithLocation:(SDLLocationDetails *)location NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithLocation:(SDLLocationDetails *)location; /** * Convenience init for all parameters. diff --git a/SmartDeviceLink/public/SDLWeatherServiceManifest.h b/SmartDeviceLink/public/SDLWeatherServiceManifest.h index 761474b44a..382e325308 100644 --- a/SmartDeviceLink/public/SDLWeatherServiceManifest.h +++ b/SmartDeviceLink/public/SDLWeatherServiceManifest.h @@ -1,20 +1,55 @@ -// -// SDLWeatherServiceManifest.h -// SmartDeviceLink -// -// Created by Nicole on 2/8/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" NS_ASSUME_NONNULL_BEGIN /** - * A weather service manifest. + * A weather service manifest. + * @added in SmartDeviceLink 5.1.0 */ @interface SDLWeatherServiceManifest : SDLRPCStruct +/** + * @param currentForecastSupported - currentForecastSupported + * @param maxMultidayForecastAmount - maxMultidayForecastAmount + * @param maxHourlyForecastAmount - maxHourlyForecastAmount + * @param maxMinutelyForecastAmount - maxMinutelyForecastAmount + * @param weatherForLocationSupported - weatherForLocationSupported + * @return A SDLWeatherServiceManifest object + */ +- (instancetype)initWithCurrentForecastSupportedParam:(nullable NSNumber *)currentForecastSupported maxMultidayForecastAmount:(nullable NSNumber *)maxMultidayForecastAmount maxHourlyForecastAmount:(nullable NSNumber *)maxHourlyForecastAmount maxMinutelyForecastAmount:(nullable NSNumber *)maxMinutelyForecastAmount weatherForLocationSupported:(nullable NSNumber *)weatherForLocationSupported __deprecated_msg("Eventually an initializer without param will be added"); + /** * Convenience init for all parameters. * @@ -25,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN * @param weatherForLocationSupported Whether or not the weather for location is supported. * @return A SDLWeatherServiceManifest object */ -- (instancetype)initWithCurrentForecastSupported:(BOOL)currentForecastSupported maxMultidayForecastAmount:(UInt32)maxMultidayForecastAmount maxHourlyForecastAmount:(UInt32)maxHourlyForecastAmount maxMinutelyForecastAmount:(UInt32)maxMinutelyForecastAmount weatherForLocationSupported:(BOOL)weatherForLocationSupported; +- (instancetype)initWithCurrentForecastSupported:(BOOL)currentForecastSupported maxMultidayForecastAmount:(UInt32)maxMultidayForecastAmount maxHourlyForecastAmount:(UInt32)maxHourlyForecastAmount maxMinutelyForecastAmount:(UInt32)maxMinutelyForecastAmount weatherForLocationSupported:(BOOL)weatherForLocationSupported __deprecated_msg("Eventually an initializer with different types will be added"); /** * Whether or not the current forcast is supported. diff --git a/SmartDeviceLink/public/SDLWeatherServiceManifest.m b/SmartDeviceLink/public/SDLWeatherServiceManifest.m index 753a152edf..fc6e674a5e 100644 --- a/SmartDeviceLink/public/SDLWeatherServiceManifest.m +++ b/SmartDeviceLink/public/SDLWeatherServiceManifest.m @@ -15,6 +15,19 @@ @implementation SDLWeatherServiceManifest +- (instancetype)initWithCurrentForecastSupportedParam:(nullable NSNumber *)currentForecastSupported maxMultidayForecastAmount:(nullable NSNumber *)maxMultidayForecastAmount maxHourlyForecastAmount:(nullable NSNumber *)maxHourlyForecastAmount maxMinutelyForecastAmount:(nullable NSNumber *)maxMinutelyForecastAmount weatherForLocationSupported:(nullable NSNumber *)weatherForLocationSupported { + self = [self init]; + if (!self) { + return nil; + } + self.currentForecastSupported = currentForecastSupported; + self.maxMultidayForecastAmount = maxMultidayForecastAmount; + self.maxHourlyForecastAmount = maxHourlyForecastAmount; + self.maxMinutelyForecastAmount = maxMinutelyForecastAmount; + self.weatherForLocationSupported = weatherForLocationSupported; + return self; +} + - (instancetype)initWithCurrentForecastSupported:(BOOL)currentForecastSupported maxMultidayForecastAmount:(UInt32)maxMultidayForecastAmount maxHourlyForecastAmount:(UInt32)maxHourlyForecastAmount maxMinutelyForecastAmount:(UInt32)maxMinutelyForecastAmount weatherForLocationSupported:(BOOL)weatherForLocationSupported { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/public/SDLWindowCapability.h b/SmartDeviceLink/public/SDLWindowCapability.h index 4795e667be..39a1f73c4a 100644 --- a/SmartDeviceLink/public/SDLWindowCapability.h +++ b/SmartDeviceLink/public/SDLWindowCapability.h @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN /** Reflects content of DisplayCapabilities, ButtonCapabilities and SoftButtonCapabilities - @since SDL 6.0 + @added in SmartDeviceLink 6.0.0 */ @interface SDLWindowCapability : SDLRPCStruct diff --git a/SmartDeviceLink/public/SDLWindowState.h b/SmartDeviceLink/public/SDLWindowState.h index fcbab56918..98781e6683 100644 --- a/SmartDeviceLink/public/SDLWindowState.h +++ b/SmartDeviceLink/public/SDLWindowState.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /** - * @since SDL 7.0.0 + * @added in SmartDeviceLink 7.0.0 */ @interface SDLWindowState : SDLRPCStruct diff --git a/SmartDeviceLink/public/SDLWindowStatus.h b/SmartDeviceLink/public/SDLWindowStatus.h index e3e2352426..48749260a1 100644 --- a/SmartDeviceLink/public/SDLWindowStatus.h +++ b/SmartDeviceLink/public/SDLWindowStatus.h @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Describes the status of a window of a door/liftgate etc. * - * @since SDL 7.0.0 + * @added in SmartDeviceLink 7.0.0 */ @interface SDLWindowStatus : SDLRPCStruct diff --git a/SmartDeviceLink/public/SDLWindowType.h b/SmartDeviceLink/public/SDLWindowType.h index 7e47e3ad95..beb0b2143f 100644 --- a/SmartDeviceLink/public/SDLWindowType.h +++ b/SmartDeviceLink/public/SDLWindowType.h @@ -1,12 +1,40 @@ -// -// SDLWindowType.h -// SmartDeviceLink +/* + * 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 "SDLEnum.h" /** The type of the window to be created. Main window or widget. - @since SDL 6.0 + @added in SmartDeviceLink 6.0.0 */ typedef SDLEnum SDLWindowType NS_TYPED_ENUM; diff --git a/SmartDeviceLink/public/SDLWindowTypeCapabilities.h b/SmartDeviceLink/public/SDLWindowTypeCapabilities.h index 551fd692c8..6868be28b4 100644 --- a/SmartDeviceLink/public/SDLWindowTypeCapabilities.h +++ b/SmartDeviceLink/public/SDLWindowTypeCapabilities.h @@ -1,6 +1,34 @@ -// -// SDLWindowTypeCapabilities.h -// SmartDeviceLink +/* + * 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" #import "SDLWindowType.h" @@ -10,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN /** Used to inform an app how many window instances per type that can be created. - @since SDL 6.0 + @added in SmartDeviceLink 6.0.0 */ @interface SDLWindowTypeCapabilities : SDLRPCStruct diff --git a/SmartDeviceLink/public/SDLWiperStatus.h b/SmartDeviceLink/public/SDLWiperStatus.h index 23ddfac7ae..f36701b817 100644 --- a/SmartDeviceLink/public/SDLWiperStatus.h +++ b/SmartDeviceLink/public/SDLWiperStatus.h @@ -1,11 +1,42 @@ -// SDLWiperStatus.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 "SDLEnum.h" /** * The status of the windshield wipers. Used in retrieving vehicle data. + * + * @added in SmartDeviceLink 2.0.0 */ typedef SDLEnum SDLWiperStatus NS_TYPED_ENUM; diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m index 3d636db9e0..bf9cf1f5d5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAddCommandSpec.m @@ -16,10 +16,10 @@ QuickSpecBegin(SDLAddCommandSpec) -describe(@"Getter/Setter Tests", ^ { - SDLMenuParams* menu = [[SDLMenuParams alloc] init]; - SDLImage* image = [[SDLImage alloc] init]; +SDLMenuParams* menu = [[SDLMenuParams alloc] init]; +SDLImage* image = [[SDLImage alloc] init]; +describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { SDLAddCommand* testRequest = [[SDLAddCommand alloc] init]; @@ -81,9 +81,30 @@ expect(testCommand.cmdIcon).to(beNil()); }); + it(@"initWithCmdId:", ^{ + testCommand = [[SDLAddCommand alloc] initWithCmdID:commandId]; + + expect(testCommand.cmdID).to(equal(commandId)); + expect(testCommand.vrCommands).to(beNil()); + expect(testCommand.menuParams).to(beNil()); + expect(testCommand.cmdIcon).to(beNil()); + }); + + it(@"initWithCmdID:menuParams:vrCommands:", ^{ + testCommand = [[SDLAddCommand alloc] initWithCmdID:commandId menuParams:menu vrCommands:vrCommands cmdIcon:image]; + + expect(testCommand.cmdID).to(equal(commandId)); + expect(testCommand.vrCommands).to(equal(vrCommands)); + expect(testCommand.menuParams).to(equal(menu)); + expect(testCommand.cmdIcon).to(equal(image)); + }); + context(@"initWithHandler:", ^{ it(@"should initialize correctly", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithHandler:handler]; +#pragma clang diagnostic pop expect(testCommand).toNot(beNil()); expect(testCommand.vrCommands).to(beNil()); @@ -94,7 +115,10 @@ context(@"initWithId:vrCommands:handler:", ^{ it(@"should initialize correctly", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithId:commandId vrCommands:vrCommands handler:nil]; +#pragma clang diagnostic pop expect(testCommand.cmdID).to(equal(commandId)); expect(testCommand.vrCommands).to(equal(vrCommands)); @@ -105,7 +129,10 @@ context(@"initWithId:vrCommands:menuName:handler:", ^{ it(@"should initialize correctly", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithId:commandId vrCommands:vrCommands menuName:menuName handler:nil]; +#pragma clang diagnostic pop expect(testCommand.cmdID).to(equal(commandId)); expect(testCommand.vrCommands).to(equal(vrCommands)); @@ -123,7 +150,10 @@ SDLImageType imageType = SDLImageTypeDynamic; BOOL imageIsTemplate = YES; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithId:commandId vrCommands:vrCommands menuName:menuName parentId:parentId position:position iconValue:iconValue iconType:imageType iconIsTemplate:imageIsTemplate handler:nil]; +#pragma clang diagnostic pop expect(testCommand.cmdID).to(equal(commandId)); expect(testCommand.vrCommands).to(equal(vrCommands)); @@ -132,13 +162,16 @@ expect(testCommand.menuParams.position).to(equal(position)); expect(testCommand.cmdIcon).toNot(beNil()); - expect(testCommand.cmdIcon.value).to(equal(iconValue)); + expect(testCommand.cmdIcon.valueParam).to(equal(iconValue)); expect(testCommand.cmdIcon.imageType).to(equal(imageType)); expect(testCommand.cmdIcon.isTemplate).to(equal(imageIsTemplate)); }); it(@"should initialize without an image", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithId:commandId vrCommands:vrCommands menuName:menuName parentId:parentId position:position iconValue:nil iconType:nil iconIsTemplate:NO handler:nil]; +#pragma clang diagnostic pop expect(testCommand.cmdID).to(equal(commandId)); expect(testCommand.vrCommands).to(equal(vrCommands)); @@ -154,9 +187,12 @@ __block UInt16 position = 0; it(@"should initialize with an image", ^{ - SDLImage *image = [[SDLImage alloc] initWithName:@"Icon" ofType:SDLImageTypeDynamic isTemplate:YES]; + SDLImage *image = [[SDLImage alloc] initWithValueParam:@"Icon" imageType:SDLImageTypeDynamic isTemplate:@YES]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithId:commandId vrCommands:vrCommands menuName:menuName parentId:parentId position:position icon:image handler:nil]; +#pragma clang diagnostic pop expect(testCommand.cmdID).to(equal(commandId)); expect(testCommand.vrCommands).to(equal(vrCommands)); @@ -165,13 +201,16 @@ expect(testCommand.menuParams.position).to(equal(position)); expect(testCommand.cmdIcon).toNot(beNil()); - expect(testCommand.cmdIcon.value).to(equal(image.value)); + expect(testCommand.cmdIcon.valueParam).to(equal(image.valueParam)); expect(testCommand.cmdIcon.imageType).to(equal(image.imageType)); expect(testCommand.cmdIcon.isTemplate).to(equal(image.isTemplate)); }); it(@"should initialize without an image", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" testCommand = [[SDLAddCommand alloc] initWithId:commandId vrCommands:vrCommands menuName:menuName parentId:parentId position:position icon:nil handler:nil]; +#pragma clang diagnostic pop expect(testCommand.cmdID).to(equal(commandId)); expect(testCommand.vrCommands).to(equal(vrCommands));