Skip to content

Commit 2427e35

Browse files
Merge pull request #154 from TakayukiHoshi1984/modify_host_takephoto_rotation
Hostプラグインのtakephotoの画像の向き調整
2 parents 66a06c0 + b5db3ab commit 2427e35

20 files changed

Lines changed: 145 additions & 109 deletions

dConnectDevicePlugin/dConnectDeviceAWSIoT/Tests/Tests.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ - (void)testExample {
6262
// Shadow取得
6363
- (void)fetchShadow:(XCTestExpectation*)expectation {
6464
[[DPAWSIoTManager sharedManager] fetchShadowWithName:kShadowName completionHandler:^(id json, NSError *error) {
65-
NSLog(@"%@", json);
66-
NSLog(@"%@", error);
67-
6865
XCTAssertNil(error, @"error");
6966
[expectation fulfill];
7067
}];
@@ -81,7 +78,6 @@ - (void)updateShadow:(XCTestExpectation*)expectation {
8178
// MQTT/Sub
8279
- (void)subscribeMQTT:(XCTestExpectation*)expectation {
8380
[[DPAWSIoTManager sharedManager] subscribeWithTopic:@"tp" messageHandler:^(id json, NSError *error) {
84-
NSLog(@"%@", json);
8581
XCTAssertNil(error, @"error");
8682
[expectation fulfill];
8783
}];
@@ -96,7 +92,6 @@ - (void)publishMQTT:(XCTestExpectation*)expectation {
9692
// HTTP
9793
- (void)http:(XCTestExpectation*)expectation {
9894
[DPAWSIoTNetworkManager sendRequestWithPath:@"http://gclue.com" method:@"get" params:@{@"test": @"param"} handler:^(NSData *data, NSURLResponse *response, NSError *error) {
99-
NSLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
10095
XCTAssertNil(error, @"error");
10196
[expectation fulfill];
10297
}];

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTController.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,6 @@ - (void)subscribeRequest {
522522
}
523523
}
524524
// URI変換 ここまで
525-
526-
527525
// MQTTからHTTPへ
528526
[DPAWSIoTUtils sendRequestDictionary:requestDic callback:^(DConnectResponseMessage *response) {
529527
// 返却形式にフォーマット
@@ -547,7 +545,6 @@ - (void)unsubscribeRequest {
547545
// EventTopic購読
548546
- (void)subscribeEvent:(NSString*)uuid {
549547
NSString *topic = [DPAWSIoTController topic:kTopicEvent uuid:uuid];
550-
NSLog(@"subscribeEvent: topic = %@", topic);
551548
[[DPAWSIoTManager sharedManager] subscribeWithTopic:topic messageHandler:^(id json, NSError *error) {
552549
if (error) {
553550
NSLog(@"Error on SubscribeWithTopic: [%@] %@", topic, error);
@@ -566,8 +563,7 @@ - (void)subscribeEvent:(NSString*)uuid {
566563
// EventTopic購読解除
567564
- (void)unsubscribeEvent:(NSString*)uuid {
568565
NSString *topic = [DPAWSIoTController topic:kTopicEvent uuid:uuid];
569-
NSLog(@"unsubscribeEvent: topic = %@", topic);
570-
[[DPAWSIoTManager sharedManager] unsubscribeWithTopic:topic];
566+
[[DPAWSIoTManager sharedManager] unsubscribeWithTopic:topic];
571567
}
572568

573569
// 生存報告
@@ -720,7 +716,7 @@ - (void)receivedResponseFromMQTT:(id)json from:(NSDictionary*)manager uuid:(NSSt
720716

721717
// P2Pの処理
722718
if (json[@"p2p_local"]) {
723-
NSDictionary *p2pLocalJson = json[@"p2p_local"];
719+
NSDictionary *p2pLocalJson = json[@"p2p_local"];
724720
if (p2pLocalJson) {
725721
NSError *error = nil;
726722
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:p2pLocalJson options:0 error:&error];

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTDevicePlugin.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ - (void)enterForeground {
7474
// リクエスト処理
7575
- (BOOL)executeRequest:(DConnectRequestMessage *)request response:(DConnectResponseMessage *)response
7676
{
77-
//NSLog(@"*********** executeRequest: %@, %@,%@,%@", [request serviceId], [request profile], [request interface], [request attribute]);
7877
// リクエストコード生成
7978
u_int32_t requestCode = arc4random();
8079

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTManager.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ - (void)connectWithAccessKey:(NSString*)accessKey secretKey:(NSString*)secretKey
4747
// MQTT接続
4848
NSString *clientID = [[NSUUID UUID] UUIDString];
4949
if (![manager connectUsingWebSocketWithClientId:clientID cleanSession:YES statusCallback:^(AWSIoTMQTTStatus status) {
50-
// NSLog(@"* mqtt status: %ld", (long)status);
5150
dispatch_async(dispatch_get_main_queue(), ^{
5251
// 接続成功
5352
if (status == AWSIoTMQTTStatusConnected) {
@@ -158,7 +157,6 @@ - (void)unsubscribeWithTopic:(NSString*)topic {
158157

159158
// MQTTのTopicにメッセージを配信
160159
- (BOOL)publishWithTopic:(NSString*)topic message:(NSString*)message {
161-
// NSLog(@"publish: %@, %@", topic, message);
162160
AWSIoTDataManager *manager = [AWSIoTDataManager IoTDataManagerForKey:@"dconnect"];
163161
return [manager publishString:message onTopic:topic QoS:AWSIoTMQTTQoSMessageDeliveryAttemptedAtMostOnce];
164162
}

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTSettingViewController.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ - (void)viewWillAppear:(BOOL)animated {
3838
_syncText.text = [@([DPAWSIoTUtils eventSyncInterval]) stringValue];
3939
[DPAWSIoTController fetchManagerInfoWithHandler:^(NSDictionary *managers, NSDictionary *myInfo, NSError *error) {
4040
if (myInfo) {
41-
//NSLog(@"myInfo:%@", myInfo);
4241
_statusSwitch.on = [myInfo[@"online"] boolValue];
4342
_syncText.enabled = !_statusSwitch.on;
4443
}

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTUtils.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ + (void) authProfile:(NSString *)profile handler:(void (^)(NSError *error))handl
159159
@"serviceinformation",
160160
@"system",
161161
@"battery",
162-
@"connect",
162+
@"connection",
163163
@"deviceorientation",
164164
@"filedescriptor",
165165
@"file",
@@ -168,7 +168,7 @@ + (void) authProfile:(NSString *)profile handler:(void (^)(NSError *error))handl
168168
@"notification",
169169
@"phone",
170170
@"proximity",
171-
@"settings",
171+
@"setting",
172172
@"vibration",
173173
@"light",
174174
@"remotecontroller",
@@ -195,7 +195,8 @@ + (void) authProfile:(NSString *)profile handler:(void (^)(NSError *error))handl
195195
@"poseEstimation",
196196
@"stressEstimation",
197197
@"walkState",
198-
@"gpio"] mutableCopy];
198+
@"gpio",
199+
@"geolocation"] mutableCopy];
199200
if (profile && ![requestScopes containsObject:profile]) {
200201
[requestScopes addObject:profile];
201202
}

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTWebSocket.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ - (void)webSocket:(PSWebSocket *)webSocket didReceiveMessage:(id)message {
101101
}
102102

103103
- (void)webSocket:(PSWebSocket *)webSocket didFailWithError:(NSError *)error {
104-
NSLog(@"The websocket handshake/connection failed with an error: %@, %zd", error, webSocket.retryCount);
105-
106104
if (_retryCount-- > 0) {
107105
[self openWebSocketWithAccessToken:webSocket.key];
108106
} else {
@@ -111,7 +109,6 @@ - (void)webSocket:(PSWebSocket *)webSocket didFailWithError:(NSError *)error {
111109
}
112110

113111
- (void)webSocket:(PSWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean {
114-
NSLog(@"The websocket closed with code: %@, reason: %@, wasClean: %@", @(code), reason, (wasClean) ? @"YES" : @"NO");
115112
}
116113

117114
@end

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/Core/DPAWSIoTP2PConnection.mm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ - (BOOL) connectToAddress:(NSString *)address port:(int)port
6262
if (!address || port == 0) {
6363
return NO;
6464
}
65-
66-
NSLog(@"DPAWSIoTP2PConnection::connectToAddress:%@ port:%@", address, @(port));
67-
6865
_client = [DPAWSIoTRelayClient new];
6966
_client.delegate = self;
7067
return [_client connect:address port:port];
@@ -130,8 +127,6 @@ - (void) startTimeoutTimer
130127

131128
- (void) onTimeout
132129
{
133-
NSLog(@"DPAWSIoTP2PConnection::onTimeout");
134-
135130
if ([_delegate respondsToSelector:@selector(connectionDidTimeout:)]) {
136131
[_delegate connectionDidTimeout:self];
137132
}

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/Core/DPAWSIoTSocketTask.mm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (void) sendData:(const char *)data length:(int)length;
5454
- (void) sendData:(const char *)data offset:(int)offset length:(int)length
5555
{
5656
if (offset < 0 || length < 0) {
57-
NSLog(@"DPAWSIoTSocketTask send error 1.");
57+
NSLog(@"DPAWSIoTSocketTask send error .");
5858
return;
5959
}
6060

@@ -65,12 +65,12 @@ - (void) sendData:(const char *)data offset:(int)offset length:(int)length
6565
[self intToByte:length to:_sendBuffer];
6666

6767
if (UDT::ERROR == UDT::send(_socket, HEADER, 4, 0)) {
68-
NSLog(@"DPAWSIoTSocketTask send error 2.");
68+
NSLog(@"DPAWSIoTSocketTask send error .");
6969
return;
7070
}
7171

7272
if (UDT::ERROR == UDT::send(_socket, _sendBuffer, 4, 0)) {
73-
NSLog(@"DPAWSIoTSocketTask send error 3.");
73+
NSLog(@"DPAWSIoTSocketTask send error .");
7474
return;
7575
}
7676

@@ -82,7 +82,7 @@ - (void) sendData:(const char *)data offset:(int)offset length:(int)length
8282
_length = BUFFER_SIZE;
8383
}
8484
if (UDT::ERROR == UDT::send(_socket, data + _offset, _length, 0)) {
85-
NSLog(@"DPAWSIoTSocketTask send error 4.");
85+
NSLog(@"DPAWSIoTSocketTask send error .");
8686
return;
8787
}
8888
_offset += _length;
@@ -129,8 +129,6 @@ - (void) execute
129129

130130
- (void) close
131131
{
132-
NSLog(@"DPAWSIoTSocketTask::close.");
133-
134132
if (_closeFlag) {
135133
return;
136134
}

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/DPAWSIoTHttpSocketAdapter.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// Released under the MIT license
77
// http://opensource.org/licenses/mit-license.php
88
//
9-
109
#import "DPAWSIoTHttpSocketAdapter.h"
1110
#import "GCDAsyncSocket.h"
1211

@@ -36,7 +35,6 @@ - (BOOL) openSocket
3635
NSError *error = nil;
3736
_socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
3837
if (![_socket connectToHost:self.hostname onPort:self.port error:&error]) {
39-
NSLog(@"DPAWSIoTSocketAdapter::openSocket: %@", error);
4038
return NO;
4139
}
4240
return YES;
@@ -76,14 +74,11 @@ - (BOOL) isRetry
7674

7775
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port
7876
{
79-
NSLog(@"DPAWSIoTSocketAdapter::socket:didConnectToHost: %@", host);
8077
[_socket readDataWithTimeout:5 tag:0];
8178
}
8279

8380
- (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag
8481
{
85-
NSLog(@"DPAWSIoTSocketAdapter::socket:didReadData:%p %d", sock, (int)[data length]);
86-
8782
if (self.connection) {
8883
[self.connection sendData:[data bytes] length:(int)[data length]];
8984
[_socket readDataWithTimeout:5 tag:0];
@@ -92,8 +87,6 @@ - (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)t
9287

9388
- (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err
9489
{
95-
NSLog(@"DPAWSIoTSocketAdapter::socketDidDisconnect");
96-
9790
// TODO UDPが送り終わっていないのにcloseしてしまうと問題があるので、一旦保留
9891
// if (self.connection) {
9992
// [self.connection close];
@@ -104,8 +97,6 @@ - (NSTimeInterval)socket:(GCDAsyncSocket *)sock shouldTimeoutReadWithTag:(long)t
10497
elapsed:(NSTimeInterval)elapsed
10598
bytesDone:(NSUInteger)length
10699
{
107-
NSLog(@"DPAWSIoTSocketAdapter::shouldTimeoutReadWithTag: %@", @(tag));
108-
109100
if (![self isRetry]) {
110101
[self closeSocket];
111102
}
@@ -116,8 +107,6 @@ - (NSTimeInterval)socket:(GCDAsyncSocket *)sock shouldTimeoutWriteWithTag:(long)
116107
elapsed:(NSTimeInterval)elapsed
117108
bytesDone:(NSUInteger)length
118109
{
119-
NSLog(@"DPAWSIoTSocketAdapter::shouldTimeoutWriteWithTag: %@", @(tag));
120-
121110
if (![self isRetry]) {
122111
[self closeSocket];
123112
}

0 commit comments

Comments
 (0)