New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SDL 0071 Remote Control Baseline (no zones, no driver/passenger, immediate control) #692
Implement SDL 0071 Remote Control Baseline (no zones, no driver/passenger, immediate control) #692
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a full review, only of the first bunch of files, but I found some general stuff to watch for.
SmartDeviceLink-iOS.podspec
Outdated
@@ -47,6 +47,7 @@ ss.public_header_files = [ | |||
'SmartDeviceLink/SDLAddSubMenu.h', | |||
'SmartDeviceLink/SDLAlert.h', | |||
'SmartDeviceLink/SDLAlertManeuver.h', | |||
'SmartDeviceLink/SDLButtonPress.h', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The podspecs need to list every public file, based on looking at the pbxproj changes, most of the new public files are not included.
SmartDeviceLink/SDLButtonName.h
Outdated
/** | ||
* @abstract Represents AC max button * | ||
*/ | ||
extern SDLButtonName const SDLButtonNameAcMax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Ac" here would be "AC" because it's an acronym. Acronyms should be all the same (upper or lower).
SmartDeviceLink/SDLButtonName.h
Outdated
/** | ||
* @abstract Represents AC button * | ||
*/ | ||
extern SDLButtonName const SDLButtonNameAc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also should be "AC"
@interface SDLClimateControlCapabilities : SDLRPCStruct | ||
|
||
/** | ||
* @abstractThe short friendly name of the climate control module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe we need the @abstract
anymore in the latest versions of Xcode.
} | ||
|
||
- (void)setDefrostZone:(nullable NSArray <SDLDefrostZone>*)defrostZone { | ||
[store sdl_setObject:defrostZone forName:SDLNameDefrostZone]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful of random extra spaces.
} | ||
|
||
- (nullable NSArray<SDLDefrostZone> *)defrostZone { | ||
return [store sdl_objectForName:SDLNameDefrostZone]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is supposed to use sdl_objectsForName:ofClass:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDLDefrostZone is an SDLEnum, I believe this one may be ok based on the description found here:
#713
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
|
||
- (nullable SDLTemperature *)desiredTemperature { | ||
return [store sdl_objectForName:SDLNameDesiredTemperature]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is supposed to use sdlObjectForName:ofClass:
SmartDeviceLink/SDLFunctionID.m
Outdated
@@ -28,7 +28,7 @@ - (instancetype)init { | |||
if (!self) { | |||
return nil; | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful of adding extra whitespace. I'd recommend turning on Xcode->Preferences->Text Editing->Automatically trim trailing whitespace (and also Including whitespace-only lines)
@jamescs Note that this branch now has conflicts, sorry! |
SmartDeviceLink/SDLNames.m
Outdated
@@ -47,6 +56,7 @@ | |||
SDLName const SDLNameButtonCapabilities = @"buttonCapabilities"; | |||
SDLName const SDLNameButtonEventMode = @"buttonEventMode"; | |||
SDLName const SDLNameButtonName = @"buttonName"; | |||
SDLName const SDLNameButtonPress = @"buttonPress"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please change @"buttonPress"; to @"ButtonPress"; to match spec.
SmartDeviceLink/SDLVentilationMode.h
Outdated
/** | ||
* @abstract A SDLDefrostZone with the value of *NORTH* | ||
*/ | ||
extern SDLVentilationMode const SDLVentilationModeNorth; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change North to None
SmartDeviceLink/SDLVentilationMode.m
Outdated
SDLVentilationMode const SDLVentilationModeUpper = @"UPPER"; | ||
SDLVentilationMode const SDLVentilationModeLower = @"LOWER"; | ||
SDLVentilationMode const SDLVentilationModeBoth = @"BOTH"; | ||
SDLVentilationMode const SDLVentilationModeNorth = @"NONE"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change North to None
SmartDeviceLink/SDLRadioState.h
Outdated
* @abstract Represents Radio state as ACQUIRING | ||
* | ||
*/ | ||
extern SDLRadioState const SDLRadioBandAcquiring; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change SDLRadioBandAcquiring to SDLRadioStateAcquiring
SmartDeviceLink/SDLRadioState.m
Outdated
|
||
#import "SDLRadioState.h" | ||
|
||
SDLRadioState const SDLRadioBandAcquiring = @"ACQUIRING"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change SDLRadioBandAcquiring to SDLRadioStateAcquiring
# Conflicts: # SmartDeviceLink-iOS.podspec # SmartDeviceLink-iOS.xcodeproj/project.pbxproj # SmartDeviceLink.podspec # SmartDeviceLink/SDLFunctionID.m # SmartDeviceLink/SDLNames.h # SmartDeviceLink/SDLNames.m # SmartDeviceLink/SmartDeviceLink.h
SmartDeviceLink-iOS.podspec
Outdated
@@ -164,6 +172,8 @@ ss.public_header_files = [ | |||
'SmartDeviceLink/SDLOnDriverDistraction.h', | |||
'SmartDeviceLink/SDLOnEncodedSyncPData.h', | |||
'SmartDeviceLink/SDLOnHashChange.h', | |||
'SmartDeviceLink/SDLOnInteriorVehicleData.h', | |||
'SmartDeviceLink/SDLOnInteriorVehicleData', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appears to be an extra.
SmartDeviceLink-iOS.podspec
Outdated
@@ -283,6 +303,7 @@ ss.public_header_files = [ | |||
'SmartDeviceLink/SDLTransportDelegate.h', | |||
'SmartDeviceLink/SDLTriggerSource.h', | |||
'SmartDeviceLink/SDLTTSChunk.h', | |||
'SmartDeviceLink/SDLTTSChunkFactory.h', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file no longer exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this and the above comment do not appear on the below SmartDeviceLink.podspec
.
SmartDeviceLink/SDLButtonName.h
Outdated
*/ | ||
extern SDLButtonName const SDLButtonNameAC; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes this uses one newline, sometimes it two, it should be one.
SmartDeviceLink/SDLButtonName.h
Outdated
extern SDLButtonName const SDLButtonNameShuffle; | ||
|
||
/** | ||
* @abstract Represents a Repeat button * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the *
SmartDeviceLink/SDLButtonPress.h
Outdated
|
||
@interface SDLButtonPress : SDLRPCRequest | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the 2 lines and 1 line consistent with other files. If you stick with 1 line, you should be okay.
SmartDeviceLink/SDLTemperature.m
Outdated
} | ||
|
||
-(instancetype) initWithUnit: (SDLTemperatureUnit) unit andValue:(NSNumber<SDLFloat> *) value { | ||
self = [self init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!self)
#import "SDLModuleData.h" | ||
|
||
QuickSpecBegin(SDLOnInteriorVehicleDataSpec) | ||
SDLModuleData* someModuleData = [[SDLModuleData alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a describe
in a beforeEach
so that it's reset every time.
#import "SDLNames.h" | ||
|
||
QuickSpecBegin(SDLGetInteriorVehicleDataResponseSpec) | ||
SDLModuleData* someModuleData = [[SDLModuleData alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a describe
block in a beforeEach
|
||
QuickSpecBegin(SDLSetInteriorVehicleDataResponseSpec) | ||
|
||
SDLModuleData *someModuleData = [[SDLModuleData alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a describe
block in a beforeEach
#import "SDLNames.h" | ||
|
||
QuickSpecBegin(SDLClimateControlDataSpec) | ||
__block SDLTemperature* currentTemp = [[SDLTemperature alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a describe
block in a beforeEach
@mrapitis I'm seeing a merge conflict again |
@joeljfischer thanks, it looks like project.pbxproj is conflicting. We will merge the base and resolve the conflict. |
Conflicts: SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@joeljfischer base branch has been merged and conflicting file resolved. thanks. |
Codecov Report
@@ Coverage Diff @@
## release/5.0.0 #692 +/- ##
=================================================
+ Coverage 54.43% 54.45% +0.02%
=================================================
Files 318 333 +15
Lines 7299 7586 +287
Branches 662 677 +15
=================================================
+ Hits 3973 4131 +158
- Misses 3085 3213 +128
- Partials 241 242 +1 |
# Conflicts: # SmartDeviceLink-iOS.xcodeproj/project.pbxproj
SmartDeviceLink/SDLRdsData.h
Outdated
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface SDLRdsData : SDLRPCStruct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because RDS is an acronym, this class should be SDLRDSData
|
||
@interface SDLRadioControlData : SDLRPCStruct | ||
|
||
- (instancetype)initWithFrequencyInteger:(nullable NSNumber<SDLInt> *)frequencyInteger frequencyFraction:(nullable NSNumber<SDLInt> *)frequencyFraction band:(nullable SDLRadioBand)band rdsData:(nullable SDLRdsData *)rdsData availableHDs:(nullable NSNumber<SDLInt> *)availableHDs hdChannel:(nullable NSNumber<SDLInt> *)hdChannel signalStrength:(nullable NSNumber<SDLInt> *)signalStrength signalChangeThreshold:(nullable NSNumber<SDLInt> *)signalChangeThreshold radioEnable:(nullable NSNumber<SDLBool> *)radioEnable state:(nullable SDLRadioState)state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This initializer should only contain properties such that are actually currently settable by developers (e.g. rdsData
is readonly).
* | ||
*SDLRdsData | ||
*/ | ||
@property (nullable, strong, nonatomic) SDLRdsData *rdsData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A number of these properties are readonly, and the documentation should note it is such.
* | ||
* Optional | ||
*/ | ||
@property (nullable, strong, nonatomic) SDLTemperature *currentTemperature; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property is readonly and the documentation should mark it as such.
|
||
@interface SDLClimateControlData : SDLRPCStruct | ||
|
||
- (instancetype)initWithFanSpeed:(nullable NSNumber<SDLInt> *)fanSpeed currentTemperature:(nullable SDLTemperature *)currentTemperature desiredTemperature:(nullable SDLTemperature *)desiredTemperature acEnable:(nullable NSNumber<SDLBool> *)acEnable circulateAirEnable:(nullable NSNumber<SDLBool> *)circulateAirEnable autoModeEnable:(nullable NSNumber<SDLBool> *)autoModeEnable defrostZone:(nullable SDLDefrostZone)defrostZone dualModeEnable:(nullable NSNumber<SDLBool> *)dualModeEnable acMaxEnable:(nullable NSNumber<SDLBool> *)acMaxEnable ventilationMode:(nullable SDLVentilationMode)ventilationMode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This initializer should not contain the currentTemperature
due to it being a readonly parameter
SmartDeviceLink/SDLNames.m
Outdated
@@ -56,6 +66,10 @@ | |||
SDLName const SDLNameCharacterSet = @"characterSet"; | |||
SDLName const SDLNameChoiceId = @"choiceID"; | |||
SDLName const SDLNameChoiceSet = @"choiceSet"; | |||
SDLName const SDLNameCirculateAirEnable = @"circulateAirEnableAvailable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be circulateAirEnable
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN | |||
|
|||
@interface SDLRadioControlData : SDLRPCStruct | |||
|
|||
- (instancetype)initWithFrequencyInteger:(nullable NSNumber<SDLInt> *)frequencyInteger frequencyFraction:(nullable NSNumber<SDLInt> *)frequencyFraction band:(nullable SDLRadioBand)band rdsData:(nullable SDLRdsData *)rdsData availableHDs:(nullable NSNumber<SDLInt> *)availableHDs hdChannel:(nullable NSNumber<SDLInt> *)hdChannel signalStrength:(nullable NSNumber<SDLInt> *)signalStrength signalChangeThreshold:(nullable NSNumber<SDLInt> *)signalChangeThreshold radioEnable:(nullable NSNumber<SDLBool> *)radioEnable state:(nullable SDLRadioState)state; | |||
- (instancetype)initWithFrequencyInteger:(nullable NSNumber<SDLInt> *)frequencyInteger frequencyFraction:(nullable NSNumber<SDLInt> *)frequencyFraction band:(nullable SDLRadioBand)band availableHDs:(nullable NSNumber<SDLInt> *)availableHDs hdChannel:(nullable NSNumber<SDLInt> *)hdChannel signalStrength:(nullable NSNumber<SDLInt> *)signalStrength signalChangeThreshold:(nullable NSNumber<SDLInt> *)signalChangeThreshold radioEnable:(nullable NSNumber<SDLBool> *)radioEnable state:(nullable SDLRadioState)state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
availableHDs
, signalStrength
signalChangeThreshold
state
are read only and should be removed from this initializer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also appears that a few documentation notes about read only are missing.
@@ -39,6 +39,13 @@ | |||
expect(testRequest.systemCapabilityType).to(beNil()); | |||
}); | |||
|
|||
it(@"Should get correctly when initialized with systemCapabilityType", ^ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be an entirely identical test to the below test.
@@ -75,6 +75,21 @@ | |||
expect(testStruct.ventilationModeAvailable).to(equal(@NO)); | |||
expect(testStruct.ventilationMode).to(equal([@[SDLVentilationModeUpper] copy])); | |||
}); | |||
|
|||
it(@"Should get correctly when initialized with module data and other climate control capabilite's parameters", ^ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling "capabilite's" -> "capabilities"
expect(testStruct.radioControlData).to(equal(someRadioData)); | ||
}); | ||
|
||
it(@"Should get correctly when initialized with ClimateControlData", ^ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test and the above test should also test the other parameters and make sure they're nil (see above for how to do that), or whatever they should be.
Fixes #650
This PR is ready for review.
Risk
This PR makes minor API changes.
Testing Plan
Added unit tests for each RPC.
Summary
Implements SDL 0071
Changelog
Enhancements
Tasks Remaining:
CLA