summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-09-07 13:10:21 -0400
committerJoel Fischer <joeljfischer@gmail.com>2017-09-07 13:10:21 -0400
commitb0fbca907b4bf13df81fa4538c82e43fea948378 (patch)
treed7256cbeed2d9f06dab3d5073654737bd65ebe39
parent19ea45635bff99df649b47b22171df0b117cc6fa (diff)
downloadsdl_ios-bugfix/issue_714_pcmcapabilities.tar.gz
Add pcmCapabilities property to RAIRbugfix/issue_714_pcmcapabilities
-rw-r--r--SmartDeviceLink/SDLNames.h1
-rw-r--r--SmartDeviceLink/SDLNames.m1
-rw-r--r--SmartDeviceLink/SDLRegisterAppInterfaceResponse.h5
-rw-r--r--SmartDeviceLink/SDLRegisterAppInterfaceResponse.m8
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m73
5 files changed, 54 insertions, 34 deletions
diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h
index 91bdbab8c..2368cac31 100644
--- a/SmartDeviceLink/SDLNames.h
+++ b/SmartDeviceLink/SDLNames.h
@@ -295,6 +295,7 @@ extern SDLName const SDLNamePassengerDoorAjar;
extern SDLName const SDLNamePassengerKneeAirbagDeployed;
extern SDLName const SDLNamePassengerSideAirbagDeployed;
extern SDLName const SDLNamePatchVersion;
+extern SDLName const SDLNamePCMStreamCapabilities;
extern SDLName const SDLNamePDOP;
extern SDLName const SDLNamePerformAudioPassThru;
extern SDLName const SDLNamePerformInteraction;
diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m
index 084d3397f..5b3e6cf90 100644
--- a/SmartDeviceLink/SDLNames.m
+++ b/SmartDeviceLink/SDLNames.m
@@ -289,6 +289,7 @@ SDLName const SDLNamePassengerDoorAjar = @"passengerDoorAjar";
SDLName const SDLNamePassengerKneeAirbagDeployed = @"passengerKneeAirbagDeployed";
SDLName const SDLNamePassengerSideAirbagDeployed = @"passengerSideAirbagDeployed";
SDLName const SDLNamePatchVersion = @"patchVersion";
+SDLName const SDLNamePCMStreamCapabilities = @"pcmStreamCapabilities";
SDLName const SDLNamePDOP = @"pdop";
SDLName const SDLNamePerformAudioPassThru = @"PerformAudioPassThru";
SDLName const SDLNamePerformInteraction = @"PerformInteraction";
diff --git a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.h b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.h
index ec04bc630..89096598e 100644
--- a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.h
+++ b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.h
@@ -124,6 +124,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, strong, nonatomic) NSArray<SDLAudioPassThruCapabilities *> *audioPassThruCapabilities;
/**
+ @see SDLAudioPassThruCapabilities
+ */
+@property (nullable, strong, nonatomic) SDLAudioPassThruCapabilities *pcmStreamCapabilities;
+
+/**
* Specifies the vehicle's type
*
* @see SDLVehicleType
diff --git a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
index 1884e4cb8..f8017f898 100644
--- a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
+++ b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
@@ -122,6 +122,14 @@ NS_ASSUME_NONNULL_BEGIN
return [parameters sdl_objectsForName:SDLNameAudioPassThruCapabilities ofClass:SDLAudioPassThruCapabilities.class];
}
+- (void)setPcmStreamCapabilities:(nullable SDLAudioPassThruCapabilities *)pcmStreamCapabilities {
+ [parameters sdl_setObject:pcmStreamCapabilities forName:SDLNamePCMStreamCapabilities];
+}
+
+- (nullable SDLAudioPassThruCapabilities *)pcmStreamCapabilities {
+ return [parameters sdl_objectForName:SDLNamePCMStreamCapabilities ofClass:SDLAudioPassThruCapabilities.class];
+}
+
- (void)setVehicleType:(nullable SDLVehicleType *)vehicleType {
[parameters sdl_setObject:vehicleType forName:SDLNameVehicleType];
}
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m
index 81f64528f..2e2123c3f 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLRegisterAppInterfaceResponseSpec.m
@@ -31,16 +31,17 @@ describe(@"Getter/Setter Tests", ^ {
testResponse.language = SDLLanguageEsMx;
testResponse.hmiDisplayLanguage = SDLLanguageRuRu;
testResponse.displayCapabilities = info;
- testResponse.buttonCapabilities = [@[button] mutableCopy];
- testResponse.softButtonCapabilities = [@[softButton] mutableCopy];
+ testResponse.buttonCapabilities = @[button];
+ testResponse.softButtonCapabilities = @[softButton];
testResponse.presetBankCapabilities = presetBank;
- testResponse.hmiZoneCapabilities = [@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront] copy];
- testResponse.speechCapabilities = [@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence] copy];
- testResponse.vrCapabilities = [@[SDLVRCapabilitiesText] copy];
- testResponse.audioPassThruCapabilities = [@[audioPassThru] mutableCopy];
+ testResponse.hmiZoneCapabilities = @[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront];
+ testResponse.speechCapabilities = @[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence];
+ testResponse.vrCapabilities = @[SDLVRCapabilitiesText];
+ testResponse.audioPassThruCapabilities = @[audioPassThru];
+ testResponse.pcmStreamCapabilities = audioPassThru;
testResponse.vehicleType = vehicle;
- testResponse.prerecordedSpeech = [@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp] copy];
- testResponse.supportedDiagModes = [@[@67, @99, @111] mutableCopy];
+ testResponse.prerecordedSpeech = @[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp];
+ testResponse.supportedDiagModes = @[@67, @99, @111];
testResponse.hmiCapabilities = hmiCapabilities;
testResponse.sdlVersion = @"sdlVersion";
testResponse.systemSoftwareVersion = @"systemSoftwareVersion";
@@ -49,59 +50,62 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.language).to(equal(SDLLanguageEsMx));
expect(testResponse.hmiDisplayLanguage).to(equal(SDLLanguageRuRu));
expect(testResponse.displayCapabilities).to(equal(info));
- expect(testResponse.buttonCapabilities).to(equal([@[button] mutableCopy]));
- expect(testResponse.softButtonCapabilities).to(equal([@[softButton] mutableCopy]));
+ expect(testResponse.buttonCapabilities).to(equal(@[button]));
+ expect(testResponse.softButtonCapabilities).to(equal(@[softButton]));
expect(testResponse.presetBankCapabilities).to(equal(presetBank));
- expect(testResponse.hmiZoneCapabilities).to(equal([@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront] copy]));
- expect(testResponse.speechCapabilities).to(equal([@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence] copy]));
- expect(testResponse.vrCapabilities).to(equal([@[SDLVRCapabilitiesText] copy]));
- expect(testResponse.audioPassThruCapabilities).to(equal([@[audioPassThru] mutableCopy]));
+ expect(testResponse.hmiZoneCapabilities).to(equal(@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront]));
+ expect(testResponse.speechCapabilities).to(equal(@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence]));
+ expect(testResponse.vrCapabilities).to(equal(@[SDLVRCapabilitiesText]));
+ expect(testResponse.audioPassThruCapabilities).to(equal(@[audioPassThru]));
+ expect(testResponse.pcmStreamCapabilities).to(equal(audioPassThru));
expect(testResponse.vehicleType).to(equal(vehicle));
- expect(testResponse.prerecordedSpeech).to(equal([@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp] copy]));
- expect(testResponse.supportedDiagModes).to(equal([@[@67, @99, @111] mutableCopy]));
+ expect(testResponse.prerecordedSpeech).to(equal(@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp]));
+ expect(testResponse.supportedDiagModes).to(equal(@[@67, @99, @111]));
expect(testResponse.hmiCapabilities).to(equal(hmiCapabilities));
expect(testResponse.sdlVersion).to(equal(@"sdlVersion"));
expect(testResponse.systemSoftwareVersion).to(equal(@"systemSoftwareVersion"));
});
it(@"Should get correctly when initialized", ^ {
- NSMutableDictionary* dict = [@{SDLNameRequest:
+ NSDictionary *dict = @{SDLNameRequest:
@{SDLNameParameters:
@{SDLNameSyncMessageVersion:version,
SDLNameLanguage:SDLLanguageEsMx,
SDLNameHMIDisplayLanguage:SDLLanguageRuRu,
SDLNameDisplayCapabilities:info,
- SDLNameButtonCapabilities:[@[button] mutableCopy],
- SDLNameSoftButtonCapabilities:[@[softButton] mutableCopy],
+ SDLNameButtonCapabilities:@[button],
+ SDLNameSoftButtonCapabilities:@[softButton],
SDLNamePresetBankCapabilities:presetBank,
- SDLNameHMIZoneCapabilities:[@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront] copy],
- SDLNameSpeechCapabilities:[@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence] copy],
- SDLNameVRCapabilities:[@[SDLVRCapabilitiesText] copy],
- SDLNameAudioPassThruCapabilities:[@[audioPassThru] mutableCopy],
+ SDLNameHMIZoneCapabilities:@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront],
+ SDLNameSpeechCapabilities:@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence],
+ SDLNameVRCapabilities:@[SDLVRCapabilitiesText],
+ SDLNameAudioPassThruCapabilities:@[audioPassThru],
+ SDLNamePCMStreamCapabilities: audioPassThru,
SDLNameVehicleType:vehicle,
- SDLNamePrerecordedSpeech:[@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp] mutableCopy],
- SDLNameSupportedDiagnosticModes:[@[@67, @99, @111] mutableCopy],
+ SDLNamePrerecordedSpeech:@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp],
+ SDLNameSupportedDiagnosticModes:@[@67, @99, @111],
SDLNameHMICapabilities: hmiCapabilities,
SDLNameSDLVersion: @"sdlVersion",
SDLNameSystemSoftwareVersion: @"systemSoftwareVersion"
},
- SDLNameOperationName:SDLNameRegisterAppInterface}} mutableCopy];
+ SDLNameOperationName:SDLNameRegisterAppInterface}};
SDLRegisterAppInterfaceResponse* testResponse = [[SDLRegisterAppInterfaceResponse alloc] initWithDictionary:dict];
expect(testResponse.syncMsgVersion).to(equal(version));
expect(testResponse.language).to(equal(SDLLanguageEsMx));
expect(testResponse.hmiDisplayLanguage).to(equal(SDLLanguageRuRu));
expect(testResponse.displayCapabilities).to(equal(info));
- expect(testResponse.buttonCapabilities).to(equal([@[button] mutableCopy]));
- expect(testResponse.softButtonCapabilities).to(equal([@[softButton] mutableCopy]));
+ expect(testResponse.buttonCapabilities).to(equal(@[button]));
+ expect(testResponse.softButtonCapabilities).to(equal(@[softButton]));
expect(testResponse.presetBankCapabilities).to(equal(presetBank));
- expect(testResponse.hmiZoneCapabilities).to(equal([@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront] copy]));
- expect(testResponse.speechCapabilities).to(equal([@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence] copy]));
- expect(testResponse.vrCapabilities).to(equal([@[SDLVRCapabilitiesText] copy]));
- expect(testResponse.audioPassThruCapabilities).to(equal([@[audioPassThru] mutableCopy]));
+ expect(testResponse.hmiZoneCapabilities).to(equal(@[SDLHMIZoneCapabilitiesBack, SDLHMIZoneCapabilitiesFront]));
+ expect(testResponse.speechCapabilities).to(equal(@[SDLSpeechCapabilitiesSAPIPhonemes, SDLSpeechCapabilitiesSilence]));
+ expect(testResponse.vrCapabilities).to(equal(@[SDLVRCapabilitiesText]));
+ expect(testResponse.audioPassThruCapabilities).to(equal(@[audioPassThru]));
+ expect(testResponse.pcmStreamCapabilities).to(equal(audioPassThru));
expect(testResponse.vehicleType).to(equal(vehicle));
- expect(testResponse.prerecordedSpeech).to(equal([@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp] copy]));
- expect(testResponse.supportedDiagModes).to(equal([@[@67, @99, @111] mutableCopy]));
+ expect(testResponse.prerecordedSpeech).to(equal(@[SDLPrerecordedSpeechListen, SDLPrerecordedSpeechHelp]));
+ expect(testResponse.supportedDiagModes).to(equal(@[@67, @99, @111]));
expect(testResponse.hmiCapabilities).to(equal(hmiCapabilities));
expect(testResponse.sdlVersion).to(equal(@"sdlVersion"));
expect(testResponse.systemSoftwareVersion).to(equal(@"systemSoftwareVersion"));
@@ -121,6 +125,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.speechCapabilities).to(beNil());
expect(testResponse.vrCapabilities).to(beNil());
expect(testResponse.audioPassThruCapabilities).to(beNil());
+ expect(testResponse.pcmStreamCapabilities).to(beNil());
expect(testResponse.vehicleType).to(beNil());
expect(testResponse.prerecordedSpeech).to(beNil());
expect(testResponse.supportedDiagModes).to(beNil());