Skip to content

Commit

Permalink
Merge pull request #1398 from smartdevicelink/bug/issue-1395-Missing-…
Browse files Browse the repository at this point in the history
…remote-control-availability

Add remoteControl to HMICapabilities
  • Loading branch information
joeljfischer committed Sep 18, 2019
2 parents 9b5a2f4 + 60d39e4 commit 616e704
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
20 changes: 20 additions & 0 deletions SmartDeviceLink/SDLHMICapabilities.h
Expand Up @@ -6,29 +6,49 @@

NS_ASSUME_NONNULL_BEGIN

/**
Contains information about the HMI capabilities.
Since SDL 3.0
**/
@interface SDLHMICapabilities : SDLRPCStruct

/**
Availability of built in Nav. True: Available, False: Not Available
Boolean value. Optional.
Since SDL 3.0
*/
@property (nullable, copy, nonatomic) NSNumber<SDLBool> *navigation;

/**
Availability of built in phone. True: Available, False: Not Available
Boolean value. Optional.
Since SDL 3.0
*/
@property (nullable, copy, nonatomic) NSNumber<SDLBool> *phoneCall;

/**
Availability of built in video streaming. True: Available, False: Not Available
Boolean value. Optional.
Since SDL 4.5
*/
@property (nullable, copy, nonatomic) NSNumber<SDLBool> *videoStreaming;

/**
Availability of built in remote control. True: Available, False: Not Available
Boolean value. Optional.
Since SDL 4.5
**/
@property (nullable, copy, nonatomic) NSNumber<SDLBool> *remoteControl;

@end

NS_ASSUME_NONNULL_END
8 changes: 8 additions & 0 deletions SmartDeviceLink/SDLHMICapabilities.m
Expand Up @@ -35,6 +35,14 @@ - (void)setVideoStreaming:(nullable NSNumber<SDLBool> *)videoStreaming {
return [self.store sdl_objectForName:SDLRPCParameterNameVideoStreaming ofClass:NSNumber.class error:nil];
}

- (void)setRemoteControl:(nullable NSNumber<SDLBool> *)remoteControl {
[self.store sdl_setObject:remoteControl forName:SDLRPCParameterNameRemoteControl];
}

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

@end

NS_ASSUME_NONNULL_END
1 change: 1 addition & 0 deletions SmartDeviceLink/SDLRPCParameterNames.h
Expand Up @@ -506,6 +506,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameRect;
extern SDLRPCParameterName const SDLRPCParameterNameRed;
extern SDLRPCParameterName const SDLRPCParameterNameRegion;
extern SDLRPCParameterName const SDLRPCParameterNameRegions;
extern SDLRPCParameterName const SDLRPCParameterNameRemoteControl;
extern SDLRPCParameterName const SDLRPCParameterNameRemoteControlCapability;
extern SDLRPCParameterName const SDLRPCParameterNameRequest;
extern SDLRPCParameterName const SDLRPCParameterNameRequestServiceActive;
Expand Down
1 change: 1 addition & 0 deletions SmartDeviceLink/SDLRPCParameterNames.m
Expand Up @@ -500,6 +500,7 @@
SDLRPCParameterName const SDLRPCParameterNameRect = @"rect";
SDLRPCParameterName const SDLRPCParameterNameRegion = @"REG";
SDLRPCParameterName const SDLRPCParameterNameRegions = @"regions";
SDLRPCParameterName const SDLRPCParameterNameRemoteControl = @"remoteControl";
SDLRPCParameterName const SDLRPCParameterNameRemoteControlCapability = @"remoteControlCapability";
SDLRPCParameterName const SDLRPCParameterNameRequest = @"request";
SDLRPCParameterName const SDLRPCParameterNameRequestServiceActive = @"requestServiceActive";
Expand Down
Expand Up @@ -17,13 +17,15 @@
__block NSNumber *somePhoneCallState = @NO;
__block NSNumber *someNavigationState = @YES;
__block NSNumber *someVideoStreamState = @NO;
__block NSNumber *someRemoteControlState = @YES;

context(@"When initialized with properties", ^{
beforeEach(^{
testStruct = [[SDLHMICapabilities alloc] init];
testStruct.phoneCall = somePhoneCallState;
testStruct.navigation = someNavigationState;
testStruct.videoStreaming = someVideoStreamState;
testStruct.remoteControl = someRemoteControlState;
});

it(@"should properly set phone call", ^{
Expand All @@ -37,14 +39,19 @@
it(@"should properly set video streaming", ^{
expect(testStruct.videoStreaming).to(equal(someVideoStreamState));
});

it(@"should properly set remote control", ^{
expect(testStruct.remoteControl).to(equal(someRemoteControlState));
});
});

context(@"When initialized with a dictionary", ^{
beforeEach(^{
NSDictionary<NSString *, NSNumber *> *structInitDict = @{
SDLRPCParameterNameNavigation: someNavigationState,
SDLRPCParameterNamePhoneCall: somePhoneCallState,
SDLRPCParameterNameVideoStreaming: someVideoStreamState
SDLRPCParameterNameVideoStreaming: someVideoStreamState,
SDLRPCParameterNameRemoteControl: someRemoteControlState
};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Expand All @@ -63,6 +70,10 @@
it(@"should properly set video streaming", ^{
expect(testStruct.videoStreaming).to(equal(someVideoStreamState));
});

it(@"should properly set remote control", ^{
expect(testStruct.remoteControl).to(equal(someRemoteControlState));
});
});

context(@"When not initialized", ^{
Expand All @@ -81,6 +92,10 @@
it(@"video streaming should be nil", ^{
expect(testStruct.videoStreaming).to(beNil());
});

it(@"remote control should be nil", ^{
expect(testStruct.remoteControl).to(beNil());
});
});
});

Expand Down

0 comments on commit 616e704

Please sign in to comment.