Skip to content

Commit d9af689

Browse files
Merge pull request #291 from TakayukiHoshi1984/modify_sony_camera_zoom_param
SonyCameraのZoomのパラメータチェック追加
2 parents 612ac05 + 0b87a69 commit d9af689

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

dConnectDevicePlugin/dConnectDeviceSonyCamera/dConnectDeviceSonyCamera/Classes/profile/SonyCameraCameraProfile.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,27 @@ - (BOOL) didReceivePutZoomRequest:(DConnectRequestMessage *)request response:(DC
8888
[response setErrorToIllegalDeviceStateWithMessage:@"Sony's camera is not ready."];
8989
return YES;
9090
}
91+
if (!direction ||!movement) {
92+
[response setErrorToInvalidRequestParameter];
93+
return YES;
94+
}
95+
if (![direction isEqualToString:@"in"]) {
96+
if (![direction isEqualToString:@"out"]) {
97+
[response setErrorToInvalidRequestParameter];
98+
return YES;
99+
}
100+
}
91101

102+
if (![movement isEqualToString:@"in-start"]) {
103+
if (![movement isEqualToString:@"in-stop"]) {
104+
if (![movement isEqualToString:@"1shot"]) {
105+
if (![movement isEqualToString:@"max"]) {
106+
[response setErrorToInvalidRequestParameter];
107+
return YES;
108+
}
109+
}
110+
}
111+
}
92112
// サポートしていない
93113
if (![manager isSupportedZoom]) {
94114
[response setErrorToNotSupportAttribute];

0 commit comments

Comments
 (0)