Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
/* Begin PBXBuildFile section */
8EB854501D42406F0035C0DC /* dconnect_icon_off.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EB8544E1D42406F0035C0DC /* dconnect_icon_off.png */; };
8EB854511D42406F0035C0DC /* dconnect_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 8EB8544F1D42406F0035C0DC /* dconnect_icon.png */; };
AB65A00E1ED43DA900E68B86 /* SampleAvContentApi.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A0051ED43DA900E68B86 /* SampleAvContentApi.m */; };
AB65A00F1ED43DA900E68B86 /* SampleCameraApi.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A0081ED43DA900E68B86 /* SampleCameraApi.m */; };
AB65A0101ED43DA900E68B86 /* SampleCameraEventObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A00B1ED43DA900E68B86 /* SampleCameraEventObserver.m */; };
AB65A0111ED43DA900E68B86 /* SampleRemoteApi.m in Sources */ = {isa = PBXBuildFile; fileRef = AB65A00D1ED43DA900E68B86 /* SampleRemoteApi.m */; };
BE24CF04197F7BC4007BBC69 /* SampleLiveviewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BE24CF03197F7BC3007BBC69 /* SampleLiveviewManager.m */; };
BE4B295D19809B8900338159 /* sonycamera_img01@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE4B295819809B8900338159 /* sonycamera_img01@2x.png */; };
BE4B295E19809B8900338159 /* sonycamera_img02@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE4B295919809B8900338159 /* sonycamera_img02@2x.png */; };
Expand Down Expand Up @@ -69,8 +73,6 @@
C2540C68195A853600AE012C /* UdpRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C59195A853600AE012C /* UdpRequest.m */; };
C2540C69195A853600AE012C /* HttpAsynchronousRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C5D195A853600AE012C /* HttpAsynchronousRequest.m */; };
C2540C6A195A853600AE012C /* HttpSynchronousRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C5F195A853600AE012C /* HttpSynchronousRequest.m */; };
C2540C6B195A853600AE012C /* SampleCameraEventObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C62195A853600AE012C /* SampleCameraEventObserver.m */; };
C2540C6C195A853600AE012C /* SampleRemoteApi.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C64195A853600AE012C /* SampleRemoteApi.m */; };
C2540C73195AAFB400AE012C /* SonyCameraRemoteApiUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C2540C72195AAFB400AE012C /* SonyCameraRemoteApiUtil.m */; };
C2540C7A195ACC0800AE012C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2540C79195ACC0800AE012C /* CoreFoundation.framework */; };
C2540C80195ACC0800AE012C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C2540C7E195ACC0800AE012C /* InfoPlist.strings */; };
Expand Down Expand Up @@ -107,6 +109,17 @@
/* Begin PBXFileReference section */
8EB8544E1D42406F0035C0DC /* dconnect_icon_off.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dconnect_icon_off.png; sourceTree = "<group>"; };
8EB8544F1D42406F0035C0DC /* dconnect_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dconnect_icon.png; sourceTree = "<group>"; };
AB65A0031ED43DA900E68B86 /* RemoteApiList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteApiList.h; sourceTree = "<group>"; };
AB65A0041ED43DA900E68B86 /* SampleAvContentApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleAvContentApi.h; sourceTree = "<group>"; };
AB65A0051ED43DA900E68B86 /* SampleAvContentApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleAvContentApi.m; sourceTree = "<group>"; };
AB65A0061ED43DA900E68B86 /* SampleAvContentDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleAvContentDefinitions.h; sourceTree = "<group>"; };
AB65A0071ED43DA900E68B86 /* SampleCameraApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraApi.h; sourceTree = "<group>"; };
AB65A0081ED43DA900E68B86 /* SampleCameraApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleCameraApi.m; sourceTree = "<group>"; };
AB65A0091ED43DA900E68B86 /* SampleCameraDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraDefinitions.h; sourceTree = "<group>"; };
AB65A00A1ED43DA900E68B86 /* SampleCameraEventObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraEventObserver.h; sourceTree = "<group>"; };
AB65A00B1ED43DA900E68B86 /* SampleCameraEventObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleCameraEventObserver.m; sourceTree = "<group>"; };
AB65A00C1ED43DA900E68B86 /* SampleRemoteApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleRemoteApi.h; sourceTree = "<group>"; };
AB65A00D1ED43DA900E68B86 /* SampleRemoteApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleRemoteApi.m; sourceTree = "<group>"; };
ABB1838F19F626930059E7F8 /* SonyCameraCameraProfile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SonyCameraCameraProfile.h; sourceTree = "<group>"; };
ABB1839019F626B30059E7F8 /* SonyCameraDevicePlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SonyCameraDevicePlugin.h; sourceTree = "<group>"; };
BE24CF02197F7BC3007BBC69 /* SampleLiveviewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleLiveviewManager.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -162,11 +175,6 @@
C2540C5D195A853600AE012C /* HttpAsynchronousRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpAsynchronousRequest.m; sourceTree = "<group>"; };
C2540C5E195A853600AE012C /* HttpSynchronousRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpSynchronousRequest.h; sourceTree = "<group>"; };
C2540C5F195A853600AE012C /* HttpSynchronousRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpSynchronousRequest.m; sourceTree = "<group>"; };
C2540C60195A853600AE012C /* RemoteApiList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteApiList.h; sourceTree = "<group>"; };
C2540C61195A853600AE012C /* SampleCameraEventObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleCameraEventObserver.h; sourceTree = "<group>"; };
C2540C62195A853600AE012C /* SampleCameraEventObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleCameraEventObserver.m; sourceTree = "<group>"; };
C2540C63195A853600AE012C /* SampleRemoteApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleRemoteApi.h; sourceTree = "<group>"; };
C2540C64195A853600AE012C /* SampleRemoteApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleRemoteApi.m; sourceTree = "<group>"; };
C2540C6E195A875800AE012C /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
C2540C71195AAFB400AE012C /* SonyCameraRemoteApiUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SonyCameraRemoteApiUtil.h; sourceTree = "<group>"; };
C2540C72195AAFB400AE012C /* SonyCameraRemoteApiUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SonyCameraRemoteApiUtil.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -398,12 +406,18 @@
C2540C5A195A853600AE012C /* webapi */ = {
isa = PBXGroup;
children = (
AB65A0031ED43DA900E68B86 /* RemoteApiList.h */,
AB65A0041ED43DA900E68B86 /* SampleAvContentApi.h */,
AB65A0051ED43DA900E68B86 /* SampleAvContentApi.m */,
AB65A0061ED43DA900E68B86 /* SampleAvContentDefinitions.h */,
AB65A0071ED43DA900E68B86 /* SampleCameraApi.h */,
AB65A0081ED43DA900E68B86 /* SampleCameraApi.m */,
AB65A0091ED43DA900E68B86 /* SampleCameraDefinitions.h */,
AB65A00A1ED43DA900E68B86 /* SampleCameraEventObserver.h */,
AB65A00B1ED43DA900E68B86 /* SampleCameraEventObserver.m */,
AB65A00C1ED43DA900E68B86 /* SampleRemoteApi.h */,
AB65A00D1ED43DA900E68B86 /* SampleRemoteApi.m */,
C2540C5B195A853600AE012C /* HttpRequest */,
C2540C60195A853600AE012C /* RemoteApiList.h */,
C2540C61195A853600AE012C /* SampleCameraEventObserver.h */,
C2540C62195A853600AE012C /* SampleCameraEventObserver.m */,
C2540C63195A853600AE012C /* SampleRemoteApi.h */,
C2540C64195A853600AE012C /* SampleRemoteApi.m */,
);
path = webapi;
sourceTree = "<group>";
Expand Down Expand Up @@ -600,24 +614,26 @@
buildActionMask = 2147483647;
files = (
BEC39A151E8BAEEE00F13F40 /* SonyCameraPreview.m in Sources */,
AB65A00F1ED43DA900E68B86 /* SampleCameraApi.m in Sources */,
D6D172741D62E7CD00444337 /* SonyCameraReachability.m in Sources */,
D662E99F1D49F61600919C69 /* SonyCameraMediaStreamRecordingProfile.m in Sources */,
BE75D30D199495BF00F1BFC9 /* SonyCameraSettingView02Controller.m in Sources */,
C2540C67195A853600AE012C /* SampleDeviceDiscovery.m in Sources */,
AB65A0111ED43DA900E68B86 /* SampleRemoteApi.m in Sources */,
BE75D3051994884200F1BFC9 /* SonyCameraModelController.m in Sources */,
C2540C28195A83D500AE012C /* SonyCameraDevicePlugin.m in Sources */,
C2540C65195A853600AE012C /* DeviceInfo.m in Sources */,
BE75D3161994A44500F1BFC9 /* SonyCameraSettingView04Controller.m in Sources */,
C2540C6C195A853600AE012C /* SampleRemoteApi.m in Sources */,
BE75D3041994884200F1BFC9 /* SonyCameraDataViewController.m in Sources */,
C2540C6B195A853600AE012C /* SampleCameraEventObserver.m in Sources */,
AB65A00E1ED43DA900E68B86 /* SampleAvContentApi.m in Sources */,
D6C860481D3B436400232EEF /* SonyCameraService.m in Sources */,
C2540C69195A853600AE012C /* HttpAsynchronousRequest.m in Sources */,
D662E99C1D49F5D900919C69 /* SonyCameraSystemProfile.m in Sources */,
BE75D310199497F600F1BFC9 /* SonyCameraSettingView01Controller.m in Sources */,
C2540C6A195A853600AE012C /* HttpSynchronousRequest.m in Sources */,
C2540C73195AAFB400AE012C /* SonyCameraRemoteApiUtil.m in Sources */,
C2540C66195A853600AE012C /* DeviceList.m in Sources */,
AB65A0101ED43DA900E68B86 /* SampleCameraEventObserver.m in Sources */,
BE75D3061994884200F1BFC9 /* SonyCameraViewController.m in Sources */,
BE4FDFCC198765B5001A3C86 /* SonyCameraCameraProfile.m in Sources */,
D662E9A51D4A16B300919C69 /* SonyCameraManager.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ - (void) didTakePicture:(NSString *)postImageUrl {
}

- (void) didAddedService:(SonyCameraService *)service {

// NSLog(@"didAddedService:%@", service.name);
[self.serviceProvider addService:service];
}

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

- (void) applicationWillEnterForeground
{
// NSLog(@"applicationWillEnterForeground");
if ([self.sonyCameraManager checkSSID]) {
// NSLog(@"checkSSID YES");
[self.sonyCameraManager connectSonyCamera];
} else {
// NSLog(@"checkSSID NO");
[self.sonyCameraManager disconnectSonyCamera];
}

if (self.delegate && [self.delegate respondsToSelector:@selector(didReceiveUpdateDevice)]) {
// NSLog(@"didReceiveUpdateDevice");
[self.delegate didReceiveUpdateDevice];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (void) encodeWithCoder:(NSCoder *)coder {



@interface SonyCameraManager() <SampleDiscoveryDelegate, SonyCameraRemoteApiUtilDelegate>
@interface SonyCameraManager() <SampleDeviceDiscoveryDelegate, SonyCameraRemoteApiUtilDelegate>

@property (nonatomic, strong) SonyCameraReachability *reachability;
@property (nonatomic, strong) SonyCameraPreview *sonyCameraPreview;
Expand Down Expand Up @@ -112,6 +112,7 @@ - (BOOL) checkSSID {
@"ILCE-7R/B", @"ILCE-7/B"];
for (NSString *name in array) {
NSRange searchResult = [ssid rangeOfString:name];

if (searchResult.location != NSNotFound) {
return YES;
}
Expand Down Expand Up @@ -145,7 +146,6 @@ - (void) connectSonyCamera {
return;
}
self.searchFlag = YES;

[self disconnectSonyCamera];

SampleDeviceDiscovery* discovery = [SampleDeviceDiscovery new];
Expand Down Expand Up @@ -456,7 +456,7 @@ - (SonyCameraService *) foundSonyCamera {
*stop = YES;
}
}];

// NSLog(@"foundSonyCamera:%@", ssid);
// リストにSonyCameraが存在しない場合
if (!result) {
result = [[SonyCameraService alloc] initWithServiceId:ssid
Expand Down Expand Up @@ -559,7 +559,7 @@ -(void) notifiedNetworkStatus:(NSNotification *)notification {

- (void) didReceiveDeviceList:(BOOL)discovery {
self.searchFlag = NO;

// NSLog(@"didReceiveDeviceList");
if (discovery) {
SonyCameraService *service = [self foundSonyCamera];
if (service) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (id) init

// SonyCameraの監視を開始する.
SampleCameraEventObserver *observer = [SampleCameraEventObserver getInstance];
[observer start:self];
[observer startWithDelegate:self];
}
return self;
}
Expand All @@ -65,7 +65,7 @@ - (id) init

- (void) destroy
{
[[SampleCameraEventObserver getInstance] destroy];
[[SampleCameraEventObserver getInstance] stop];
}

- (void) actGetApiList
Expand Down Expand Up @@ -332,7 +332,6 @@ - (void) parseMessage:(NSData *)response apiName:(NSString *)apiName {
errorMessage = errorArray[1];
}
}

// レスポンス格納用のdictionaryにデータをつめる
if([apiName isEqualToString:API_getAvailableApiList]) {
[self.responseDic setObject:dict forKey:API_getAvailableApiList];
Expand All @@ -358,8 +357,8 @@ - (void) parseMessage:(NSData *)response apiName:(NSString *)apiName {

#pragma mark - SampleEventObserverDelegate Methods -

- (void) didApiListModified:(NSArray*) api_list {
self.apiList = api_list;
- (void) didAvailableApiListChanged:(NSArray*) API_CAMERA_list {
self.apiList = API_CAMERA_list;
}

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

- (void) didTakePicture:(NSString *)imageUri {
- (void) didStorageInformationChanged:(NSString *)storagId {
if (self.delegate) {
[self.delegate didReceivedImage:imageUri];
[self.delegate didReceivedImage:storagId];
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
//
// DeviceInfo.h
// CameraRemoteSampleApp
// Copyright 2014 Sony Corporation
//

#import <Foundation/Foundation.h>
/**
* @file DeviceInfo.h
* @brief CameraRemoteSampleApp
*
* Copyright 2014 Sony Corporation
*/

@interface DeviceInfo : NSObject

- (void) setFriendlyName :(NSString*) friendlyName;
- (void)setFriendlyName:(NSString *)friendlyName;

- (NSString*) getFriendlyName;
- (NSString *)getFriendlyName;

- (void) setVersion :(NSString*) version;
- (void)setVersion:(NSString *)version;

- (NSString*) getVersion;
- (NSString *)getVersion;

- (void) addService : (NSString*) serviceName : (NSString*) serviceUrl;
- (void)addService:(NSString *)serviceName serviceUrl:(NSString *)serviceUrl;

- (NSString*) findActionListUrl : (NSString*) service;
- (NSString *)findActionListUrl:(NSString *)service;

@end
Original file line number Diff line number Diff line change
@@ -1,71 +1,72 @@
//
// DeviceInfo.m
// CameraRemoteSampleApp
// Copyright 2014 Sony Corporation
//
/**
* @file DeviceInfo.m
* @brief CameraRemoteSampleApp
*
* Copyright 2014 Sony Corporation
*/

#import "DeviceInfo.h"

@implementation DeviceInfo
{
NSString* _friendlyName;
NSString* _version;
NSMutableArray* _serviceNameArray;
NSMutableArray* _serviceURLArray;
@implementation DeviceInfo {
NSString *_friendlyName;
NSString *_version;
NSMutableArray *_serviceNameArray;
NSMutableArray *_serviceURLArray;
}

// set friendly name of the device
- (void) setFriendlyName :(NSString*) friendlyName
- (void)setFriendlyName:(NSString *)friendlyName
{
// NSLog(@"DeviceInfo setFriendlyName = %@", friendlyName);
_friendlyName = friendlyName;
}

// get friendly name of the device
- (NSString*) getFriendlyName
- (NSString *)getFriendlyName
{
return _friendlyName;
}

// set version of the device
- (void) setVersion :(NSString*) version
- (void)setVersion:(NSString *)version
{
// NSLog(@"DeviceInfo setVersion = %@", version);
// NSLog(@"DeviceInfo setVersion = %@", version);
_version = version;
}

// get version of the device
- (NSString*) getVersion
- (NSString *)getVersion
{
return _version;
}

// adds service to the list
- (void) addService : (NSString*) serviceName : (NSString*) serviceUrl
- (void)addService:(NSString *)serviceName serviceUrl:(NSString *)serviceUrl
{
// NSLog(@"DeviceInfo addService = %@:%@", serviceName, serviceUrl);
if(_serviceNameArray == NULL || _serviceNameArray.count == 0)
{
if (_serviceNameArray == NULL || _serviceNameArray.count == 0) {
_serviceNameArray = [[NSMutableArray alloc] init];
}
if(_serviceURLArray == NULL || _serviceURLArray.count == 0)
{
if (_serviceURLArray == NULL || _serviceURLArray.count == 0) {
_serviceURLArray = [[NSMutableArray alloc] init];
}
[_serviceNameArray addObject:serviceName];
[_serviceURLArray addObject:[serviceUrl stringByAppendingFormat:@"/%@",serviceName]];
// NSLog(@"DeviceInfo _serviceNameArray size = %lu", (unsigned long)_serviceNameArray.count);
[_serviceURLArray
addObject:[serviceUrl stringByAppendingFormat:@"/%@", serviceName]];
// NSLog(@"DeviceInfo _serviceNameArray size = %lu",
// (unsigned long)_serviceNameArray.count);
}

// finds the ActionListURL for a given service
- (NSString*) findActionListUrl : (NSString*) service
- (NSString *)findActionListUrl:(NSString *)service
{
long index = [_serviceNameArray indexOfObject:service];
if(index >= 0)
{
return [_serviceURLArray objectAtIndex:index];
if ([_serviceNameArray containsObject:service]) {
long index = [_serviceNameArray indexOfObject:service];
if (index >= 0) {
return _serviceURLArray[index];
}
}
return @"Not found";
return NULL;
}

@end
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
//
// DeviceList.h
// CameraRemoteSampleApp
// Copyright 2014 Sony Corporation
//
/**
* @file DeviceList.h
* @brief CameraRemoteSampleApp
*
* Copyright 2014 Sony Corporation
*/

#import <Foundation/Foundation.h>
#import "DeviceInfo.h"

@interface DeviceList : NSObject

+ (void) addDevice : (DeviceInfo*) device;
+ (void)addDevice:(DeviceInfo *)device;

+ (void) selectDeviceAt:(long) position;
+ (void)selectDeviceAt:(long)position;

+ (DeviceInfo*) getDeviceAt:(long) position;
+ (DeviceInfo *)getDeviceAt:(long)position;

+ (DeviceInfo*) getSelectedDevice;
+ (DeviceInfo *)getSelectedDevice;

+ (long) getSize;
+ (long)getSize;

+ (void) reset;
+ (void)reset;

@end
Loading