Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add remoteControl to HMICapabilities #1398

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions SmartDeviceLink/SDLHMICapabilities.h
Expand Up @@ -29,6 +29,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, copy, nonatomic) NSNumber<SDLBool> *videoStreaming;

/**
Availability of built in remote control. True: Available, False: Not Available

Boolean value. Optional.
joeljfischer marked this conversation as resolved.
Show resolved Hide resolved
**/
@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