Skip to content

Commit 6e29b88

Browse files
Merge pull request #146 from TakayukiHoshi1984/modify_update_sonycamera_sdk
SonyCamera用のSDKのアップデート
2 parents d14c037 + 0262a1b commit 6e29b88

33 files changed

+2169
-615
lines changed

dConnectDevicePlugin/dConnectDeviceSonyCamera/dConnectDeviceSonyCamera.xcodeproj/project.pbxproj

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
/* Begin PBXBuildFile section */
3535
8EB854501D42406F0035C0DC /* dconnect_icon_off.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EB8544E1D42406F0035C0DC /* dconnect_icon_off.png */; };
3636
8EB854511D42406F0035C0DC /* dconnect_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EB8544F1D42406F0035C0DC /* dconnect_icon.png */; };
37+
AB65A00E1ED43DA900E68B86 /* SampleAvContentApi.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A0051ED43DA900E68B86 /* SampleAvContentApi.m */; };
38+
AB65A00F1ED43DA900E68B86 /* SampleCameraApi.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A0081ED43DA900E68B86 /* SampleCameraApi.m */; };
39+
AB65A0101ED43DA900E68B86 /* SampleCameraEventObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A00B1ED43DA900E68B86 /* SampleCameraEventObserver.m */; };
40+
AB65A0111ED43DA900E68B86 /* SampleRemoteApi.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A00D1ED43DA900E68B86 /* SampleRemoteApi.m */; };
3741
BE24CF04197F7BC4007BBC69 /* SampleLiveviewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BE24CF03197F7BC3007BBC69 /* SampleLiveviewManager.m */; };
3842
BE4B295D19809B8900338159 /* sonycamera_img01@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE4B295819809B8900338159 /* sonycamera_img01@2x.png */; };
3943
BE4B295E19809B8900338159 /* sonycamera_img02@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE4B295919809B8900338159 /* sonycamera_img02@2x.png */; };
@@ -69,8 +73,6 @@
6973
C2540C68195A853600AE012C /* UdpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C59195A853600AE012C /* UdpRequest.m */; };
7074
C2540C69195A853600AE012C /* HttpAsynchronousRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C5D195A853600AE012C /* HttpAsynchronousRequest.m */; };
7175
C2540C6A195A853600AE012C /* HttpSynchronousRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C5F195A853600AE012C /* HttpSynchronousRequest.m */; };
72-
C2540C6B195A853600AE012C /* SampleCameraEventObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C62195A853600AE012C /* SampleCameraEventObserver.m */; };
73-
C2540C6C195A853600AE012C /* SampleRemoteApi.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C64195A853600AE012C /* SampleRemoteApi.m */; };
7476
C2540C73195AAFB400AE012C /* SonyCameraRemoteApiUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C72195AAFB400AE012C /* SonyCameraRemoteApiUtil.m */; };
7577
C2540C7A195ACC0800AE012C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2540C79195ACC0800AE012C /* CoreFoundation.framework */; };
7678
C2540C80195ACC0800AE012C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2540C7E195ACC0800AE012C /* InfoPlist.strings */; };
@@ -107,6 +109,17 @@
107109
/* Begin PBXFileReference section */
108110
8EB8544E1D42406F0035C0DC /* dconnect_icon_off.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dconnect_icon_off.png; sourceTree = "<group>"; };
109111
8EB8544F1D42406F0035C0DC /* dconnect_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dconnect_icon.png; sourceTree = "<group>"; };
112+
AB65A0031ED43DA900E68B86 /* RemoteApiList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteApiList.h; sourceTree = "<group>"; };
113+
AB65A0041ED43DA900E68B86 /* SampleAvContentApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleAvContentApi.h; sourceTree = "<group>"; };
114+
AB65A0051ED43DA900E68B86 /* SampleAvContentApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleAvContentApi.m; sourceTree = "<group>"; };
115+
AB65A0061ED43DA900E68B86 /* SampleAvContentDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleAvContentDefinitions.h; sourceTree = "<group>"; };
116+
AB65A0071ED43DA900E68B86 /* SampleCameraApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraApi.h; sourceTree = "<group>"; };
117+
AB65A0081ED43DA900E68B86 /* SampleCameraApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleCameraApi.m; sourceTree = "<group>"; };
118+
AB65A0091ED43DA900E68B86 /* SampleCameraDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraDefinitions.h; sourceTree = "<group>"; };
119+
AB65A00A1ED43DA900E68B86 /* SampleCameraEventObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraEventObserver.h; sourceTree = "<group>"; };
120+
AB65A00B1ED43DA900E68B86 /* SampleCameraEventObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleCameraEventObserver.m; sourceTree = "<group>"; };
121+
AB65A00C1ED43DA900E68B86 /* SampleRemoteApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleRemoteApi.h; sourceTree = "<group>"; };
122+
AB65A00D1ED43DA900E68B86 /* SampleRemoteApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleRemoteApi.m; sourceTree = "<group>"; };
110123
ABB1838F19F626930059E7F8 /* SonyCameraCameraProfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SonyCameraCameraProfile.h; sourceTree = "<group>"; };
111124
ABB1839019F626B30059E7F8 /* SonyCameraDevicePlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SonyCameraDevicePlugin.h; sourceTree = "<group>"; };
112125
BE24CF02197F7BC3007BBC69 /* SampleLiveviewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleLiveviewManager.h; sourceTree = "<group>"; };
@@ -162,11 +175,6 @@
162175
C2540C5D195A853600AE012C /* HttpAsynchronousRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpAsynchronousRequest.m; sourceTree = "<group>"; };
163176
C2540C5E195A853600AE012C /* HttpSynchronousRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpSynchronousRequest.h; sourceTree = "<group>"; };
164177
C2540C5F195A853600AE012C /* HttpSynchronousRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpSynchronousRequest.m; sourceTree = "<group>"; };
165-
C2540C60195A853600AE012C /* RemoteApiList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteApiList.h; sourceTree = "<group>"; };
166-
C2540C61195A853600AE012C /* SampleCameraEventObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraEventObserver.h; sourceTree = "<group>"; };
167-
C2540C62195A853600AE012C /* SampleCameraEventObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleCameraEventObserver.m; sourceTree = "<group>"; };
168-
C2540C63195A853600AE012C /* SampleRemoteApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleRemoteApi.h; sourceTree = "<group>"; };
169-
C2540C64195A853600AE012C /* SampleRemoteApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleRemoteApi.m; sourceTree = "<group>"; };
170178
C2540C6E195A875800AE012C /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
171179
C2540C71195AAFB400AE012C /* SonyCameraRemoteApiUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SonyCameraRemoteApiUtil.h; sourceTree = "<group>"; };
172180
C2540C72195AAFB400AE012C /* SonyCameraRemoteApiUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SonyCameraRemoteApiUtil.m; sourceTree = "<group>"; };
@@ -398,12 +406,18 @@
398406
C2540C5A195A853600AE012C /* webapi */ = {
399407
isa = PBXGroup;
400408
children = (
409+
AB65A0031ED43DA900E68B86 /* RemoteApiList.h */,
410+
AB65A0041ED43DA900E68B86 /* SampleAvContentApi.h */,
411+
AB65A0051ED43DA900E68B86 /* SampleAvContentApi.m */,
412+
AB65A0061ED43DA900E68B86 /* SampleAvContentDefinitions.h */,
413+
AB65A0071ED43DA900E68B86 /* SampleCameraApi.h */,
414+
AB65A0081ED43DA900E68B86 /* SampleCameraApi.m */,
415+
AB65A0091ED43DA900E68B86 /* SampleCameraDefinitions.h */,
416+
AB65A00A1ED43DA900E68B86 /* SampleCameraEventObserver.h */,
417+
AB65A00B1ED43DA900E68B86 /* SampleCameraEventObserver.m */,
418+
AB65A00C1ED43DA900E68B86 /* SampleRemoteApi.h */,
419+
AB65A00D1ED43DA900E68B86 /* SampleRemoteApi.m */,
401420
C2540C5B195A853600AE012C /* HttpRequest */,
402-
C2540C60195A853600AE012C /* RemoteApiList.h */,
403-
C2540C61195A853600AE012C /* SampleCameraEventObserver.h */,
404-
C2540C62195A853600AE012C /* SampleCameraEventObserver.m */,
405-
C2540C63195A853600AE012C /* SampleRemoteApi.h */,
406-
C2540C64195A853600AE012C /* SampleRemoteApi.m */,
407421
);
408422
path = webapi;
409423
sourceTree = "<group>";
@@ -600,24 +614,26 @@
600614
buildActionMask = 2147483647;
601615
files = (
602616
BEC39A151E8BAEEE00F13F40 /* SonyCameraPreview.m in Sources */,
617+
AB65A00F1ED43DA900E68B86 /* SampleCameraApi.m in Sources */,
603618
D6D172741D62E7CD00444337 /* SonyCameraReachability.m in Sources */,
604619
D662E99F1D49F61600919C69 /* SonyCameraMediaStreamRecordingProfile.m in Sources */,
605620
BE75D30D199495BF00F1BFC9 /* SonyCameraSettingView02Controller.m in Sources */,
606621
C2540C67195A853600AE012C /* SampleDeviceDiscovery.m in Sources */,
622+
AB65A0111ED43DA900E68B86 /* SampleRemoteApi.m in Sources */,
607623
BE75D3051994884200F1BFC9 /* SonyCameraModelController.m in Sources */,
608624
C2540C28195A83D500AE012C /* SonyCameraDevicePlugin.m in Sources */,
609625
C2540C65195A853600AE012C /* DeviceInfo.m in Sources */,
610626
BE75D3161994A44500F1BFC9 /* SonyCameraSettingView04Controller.m in Sources */,
611-
C2540C6C195A853600AE012C /* SampleRemoteApi.m in Sources */,
612627
BE75D3041994884200F1BFC9 /* SonyCameraDataViewController.m in Sources */,
613-
C2540C6B195A853600AE012C /* SampleCameraEventObserver.m in Sources */,
628+
AB65A00E1ED43DA900E68B86 /* SampleAvContentApi.m in Sources */,
614629
D6C860481D3B436400232EEF /* SonyCameraService.m in Sources */,
615630
C2540C69195A853600AE012C /* HttpAsynchronousRequest.m in Sources */,
616631
D662E99C1D49F5D900919C69 /* SonyCameraSystemProfile.m in Sources */,
617632
BE75D310199497F600F1BFC9 /* SonyCameraSettingView01Controller.m in Sources */,
618633
C2540C6A195A853600AE012C /* HttpSynchronousRequest.m in Sources */,
619634
C2540C73195AAFB400AE012C /* SonyCameraRemoteApiUtil.m in Sources */,
620635
C2540C66195A853600AE012C /* DeviceList.m in Sources */,
636+
AB65A0101ED43DA900E68B86 /* SampleCameraEventObserver.m in Sources */,
621637
BE75D3061994884200F1BFC9 /* SonyCameraViewController.m in Sources */,
622638
BE4FDFCC198765B5001A3C86 /* SonyCameraCameraProfile.m in Sources */,
623639
D662E9A51D4A16B300919C69 /* SonyCameraManager.m in Sources */,

dConnectDevicePlugin/dConnectDeviceSonyCamera/dConnectDeviceSonyCamera/Classes/SonyCameraDevicePlugin.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ - (void) didTakePicture:(NSString *)postImageUrl {
101101
}
102102

103103
- (void) didAddedService:(SonyCameraService *)service {
104+
105+
// NSLog(@"didAddedService:%@", service.name);
104106
[self.serviceProvider addService:service];
105107
}
106108

@@ -114,13 +116,16 @@ - (void) didReceiveWiFiStatus {
114116

115117
- (void) applicationWillEnterForeground
116118
{
119+
// NSLog(@"applicationWillEnterForeground");
117120
if ([self.sonyCameraManager checkSSID]) {
121+
// NSLog(@"checkSSID YES");
118122
[self.sonyCameraManager connectSonyCamera];
119123
} else {
124+
// NSLog(@"checkSSID NO");
120125
[self.sonyCameraManager disconnectSonyCamera];
121126
}
122-
123127
if (self.delegate && [self.delegate respondsToSelector:@selector(didReceiveUpdateDevice)]) {
128+
// NSLog(@"didReceiveUpdateDevice");
124129
[self.delegate didReceiveUpdateDevice];
125130
}
126131
}

dConnectDevicePlugin/dConnectDeviceSonyCamera/dConnectDeviceSonyCamera/Classes/SonyCameraManager.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (void) encodeWithCoder:(NSCoder *)coder {
5959

6060

6161

62-
@interface SonyCameraManager() <SampleDiscoveryDelegate, SonyCameraRemoteApiUtilDelegate>
62+
@interface SonyCameraManager() <SampleDeviceDiscoveryDelegate, SonyCameraRemoteApiUtilDelegate>
6363

6464
@property (nonatomic, strong) SonyCameraReachability *reachability;
6565
@property (nonatomic, strong) SonyCameraPreview *sonyCameraPreview;
@@ -112,6 +112,7 @@ - (BOOL) checkSSID {
112112
@"ILCE-7R/B", @"ILCE-7/B"];
113113
for (NSString *name in array) {
114114
NSRange searchResult = [ssid rangeOfString:name];
115+
115116
if (searchResult.location != NSNotFound) {
116117
return YES;
117118
}
@@ -145,7 +146,6 @@ - (void) connectSonyCamera {
145146
return;
146147
}
147148
self.searchFlag = YES;
148-
149149
[self disconnectSonyCamera];
150150

151151
SampleDeviceDiscovery* discovery = [SampleDeviceDiscovery new];
@@ -456,7 +456,7 @@ - (SonyCameraService *) foundSonyCamera {
456456
*stop = YES;
457457
}
458458
}];
459-
459+
// NSLog(@"foundSonyCamera:%@", ssid);
460460
// リストにSonyCameraが存在しない場合
461461
if (!result) {
462462
result = [[SonyCameraService alloc] initWithServiceId:ssid
@@ -559,7 +559,7 @@ -(void) notifiedNetworkStatus:(NSNotification *)notification {
559559

560560
- (void) didReceiveDeviceList:(BOOL)discovery {
561561
self.searchFlag = NO;
562-
562+
// NSLog(@"didReceiveDeviceList");
563563
if (discovery) {
564564
SonyCameraService *service = [self foundSonyCamera];
565565
if (service) {

dConnectDevicePlugin/dConnectDeviceSonyCamera/dConnectDeviceSonyCamera/Classes/SonyCameraRemoteApiUtil.m

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (id) init
5656

5757
// SonyCameraの監視を開始する.
5858
SampleCameraEventObserver *observer = [SampleCameraEventObserver getInstance];
59-
[observer start:self];
59+
[observer startWithDelegate:self];
6060
}
6161
return self;
6262
}
@@ -65,7 +65,7 @@ - (id) init
6565

6666
- (void) destroy
6767
{
68-
[[SampleCameraEventObserver getInstance] destroy];
68+
[[SampleCameraEventObserver getInstance] stop];
6969
}
7070

7171
- (void) actGetApiList
@@ -332,7 +332,6 @@ - (void) parseMessage:(NSData *)response apiName:(NSString *)apiName {
332332
errorMessage = errorArray[1];
333333
}
334334
}
335-
336335
// レスポンス格納用のdictionaryにデータをつめる
337336
if([apiName isEqualToString:API_getAvailableApiList]) {
338337
[self.responseDic setObject:dict forKey:API_getAvailableApiList];
@@ -358,8 +357,8 @@ - (void) parseMessage:(NSData *)response apiName:(NSString *)apiName {
358357

359358
#pragma mark - SampleEventObserverDelegate Methods -
360359

361-
- (void) didApiListModified:(NSArray*) api_list {
362-
self.apiList = api_list;
360+
- (void) didAvailableApiListChanged:(NSArray*) API_CAMERA_list {
361+
self.apiList = API_CAMERA_list;
363362
}
364363

365364
- (void) didCameraStatusChanged:(NSString*) status {
@@ -378,9 +377,9 @@ - (void) didZoomPositionChanged:(int) zoomPosition {
378377
self.zoomPosition = zoomPosition / (double) 100;
379378
}
380379

381-
- (void) didTakePicture:(NSString *)imageUri {
380+
- (void) didStorageInformationChanged:(NSString *)storagId {
382381
if (self.delegate) {
383-
[self.delegate didReceivedImage:imageUri];
382+
[self.delegate didReceivedImage:storagId];
384383
}
385384
}
386385

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
//
2-
// DeviceInfo.h
3-
// CameraRemoteSampleApp
4-
// Copyright 2014 Sony Corporation
5-
//
6-
7-
#import <Foundation/Foundation.h>
1+
/**
2+
* @file DeviceInfo.h
3+
* @brief CameraRemoteSampleApp
4+
*
5+
* Copyright 2014 Sony Corporation
6+
*/
87

98
@interface DeviceInfo : NSObject
109

11-
- (void) setFriendlyName :(NSString*) friendlyName;
10+
- (void)setFriendlyName:(NSString *)friendlyName;
1211

13-
- (NSString*) getFriendlyName;
12+
- (NSString *)getFriendlyName;
1413

15-
- (void) setVersion :(NSString*) version;
14+
- (void)setVersion:(NSString *)version;
1615

17-
- (NSString*) getVersion;
16+
- (NSString *)getVersion;
1817

19-
- (void) addService : (NSString*) serviceName : (NSString*) serviceUrl;
18+
- (void)addService:(NSString *)serviceName serviceUrl:(NSString *)serviceUrl;
2019

21-
- (NSString*) findActionListUrl : (NSString*) service;
20+
- (NSString *)findActionListUrl:(NSString *)service;
2221

2322
@end
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,72 @@
1-
//
2-
// DeviceInfo.m
3-
// CameraRemoteSampleApp
4-
// Copyright 2014 Sony Corporation
5-
//
1+
/**
2+
* @file DeviceInfo.m
3+
* @brief CameraRemoteSampleApp
4+
*
5+
* Copyright 2014 Sony Corporation
6+
*/
67

78
#import "DeviceInfo.h"
89

9-
@implementation DeviceInfo
10-
{
11-
NSString* _friendlyName;
12-
NSString* _version;
13-
NSMutableArray* _serviceNameArray;
14-
NSMutableArray* _serviceURLArray;
10+
@implementation DeviceInfo {
11+
NSString *_friendlyName;
12+
NSString *_version;
13+
NSMutableArray *_serviceNameArray;
14+
NSMutableArray *_serviceURLArray;
1515
}
1616

1717
// set friendly name of the device
18-
- (void) setFriendlyName :(NSString*) friendlyName
18+
- (void)setFriendlyName:(NSString *)friendlyName
1919
{
2020
// NSLog(@"DeviceInfo setFriendlyName = %@", friendlyName);
2121
_friendlyName = friendlyName;
2222
}
2323

2424
// get friendly name of the device
25-
- (NSString*) getFriendlyName
25+
- (NSString *)getFriendlyName
2626
{
2727
return _friendlyName;
2828
}
2929

3030
// set version of the device
31-
- (void) setVersion :(NSString*) version
31+
- (void)setVersion:(NSString *)version
3232
{
33-
// NSLog(@"DeviceInfo setVersion = %@", version);
33+
// NSLog(@"DeviceInfo setVersion = %@", version);
3434
_version = version;
3535
}
3636

3737
// get version of the device
38-
- (NSString*) getVersion
38+
- (NSString *)getVersion
3939
{
4040
return _version;
4141
}
4242

4343
// adds service to the list
44-
- (void) addService : (NSString*) serviceName : (NSString*) serviceUrl
44+
- (void)addService:(NSString *)serviceName serviceUrl:(NSString *)serviceUrl
4545
{
4646
// NSLog(@"DeviceInfo addService = %@:%@", serviceName, serviceUrl);
47-
if(_serviceNameArray == NULL || _serviceNameArray.count == 0)
48-
{
47+
if (_serviceNameArray == NULL || _serviceNameArray.count == 0) {
4948
_serviceNameArray = [[NSMutableArray alloc] init];
5049
}
51-
if(_serviceURLArray == NULL || _serviceURLArray.count == 0)
52-
{
50+
if (_serviceURLArray == NULL || _serviceURLArray.count == 0) {
5351
_serviceURLArray = [[NSMutableArray alloc] init];
5452
}
5553
[_serviceNameArray addObject:serviceName];
56-
[_serviceURLArray addObject:[serviceUrl stringByAppendingFormat:@"/%@",serviceName]];
57-
// NSLog(@"DeviceInfo _serviceNameArray size = %lu", (unsigned long)_serviceNameArray.count);
54+
[_serviceURLArray
55+
addObject:[serviceUrl stringByAppendingFormat:@"/%@", serviceName]];
56+
// NSLog(@"DeviceInfo _serviceNameArray size = %lu",
57+
// (unsigned long)_serviceNameArray.count);
5858
}
5959

6060
// finds the ActionListURL for a given service
61-
- (NSString*) findActionListUrl : (NSString*) service
61+
- (NSString *)findActionListUrl:(NSString *)service
6262
{
63-
long index = [_serviceNameArray indexOfObject:service];
64-
if(index >= 0)
65-
{
66-
return [_serviceURLArray objectAtIndex:index];
63+
if ([_serviceNameArray containsObject:service]) {
64+
long index = [_serviceNameArray indexOfObject:service];
65+
if (index >= 0) {
66+
return _serviceURLArray[index];
67+
}
6768
}
68-
return @"Not found";
69+
return NULL;
6970
}
7071

7172
@end
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
//
2-
// DeviceList.h
3-
// CameraRemoteSampleApp
4-
// Copyright 2014 Sony Corporation
5-
//
1+
/**
2+
* @file DeviceList.h
3+
* @brief CameraRemoteSampleApp
4+
*
5+
* Copyright 2014 Sony Corporation
6+
*/
67

7-
#import <Foundation/Foundation.h>
88
#import "DeviceInfo.h"
99

1010
@interface DeviceList : NSObject
1111

12-
+ (void) addDevice : (DeviceInfo*) device;
12+
+ (void)addDevice:(DeviceInfo *)device;
1313

14-
+ (void) selectDeviceAt:(long) position;
14+
+ (void)selectDeviceAt:(long)position;
1515

16-
+ (DeviceInfo*) getDeviceAt:(long) position;
16+
+ (DeviceInfo *)getDeviceAt:(long)position;
1717

18-
+ (DeviceInfo*) getSelectedDevice;
18+
+ (DeviceInfo *)getSelectedDevice;
1919

20-
+ (long) getSize;
20+
+ (long)getSize;
2121

22-
+ (void) reset;
22+
+ (void)reset;
2323

2424
@end

0 commit comments

Comments
 (0)