-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192867671099?code=TOF4TeyJrZXkiOiJ1bjFRQnhqOHYzOVpwNkJlQUhSUTZ2WVhyaTVtN3ZtYiIsImlzcyI6IjEwLjI4LjgzLjE1MCIsImhrIjoiIiwiYXVkIjoidGVnX3RhcGRfYXV0aCIsImhhc2giOiI3RkE2NjhFREFCODI4RkE2MjdGQTIyQUZGOERBQzM2NzY2QjNEQUVGMDhCQzM0NEQ3REJFN0FFQjNENDc2NzA4IiwibmgiOiI0MEY3OTAwODRGQjEyMjZEQUYzMjkxRDQ5MEZGOUE2M0U0NzA4MjNCQzdGODQxRkY3MzZBREQ4MTlBQTVCMDQyIn0 Change-Id: I07fd90f631e8d89484be465d237420c0c7e1421d
- Loading branch information
1 parent
3641af6
commit 627f28d
Showing
9 changed files
with
185 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Source/LinkSDKDemo/Core/Controller/Device/TIoTAllDevicesVC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// TIoTAllDevicesVC.h | ||
// TIoTAllDevicesVC | ||
// | ||
// Created by whalensun on 2021/9/14. | ||
// Copyright © 2021 Tencent. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface TIoTAllDevicesVC : UIViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
50 changes: 50 additions & 0 deletions
50
Source/LinkSDKDemo/Core/Controller/Device/TIoTAllDevicesVC.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// TIoTAllDevicesVC.m | ||
// TIoTAllDevicesVC | ||
// | ||
// Created by whalensun on 2021/9/14. | ||
// Copyright © 2021 Tencent. All rights reserved. | ||
// | ||
|
||
#import "TIoTAllDevicesVC.h" | ||
|
||
@interface TIoTAllDevicesVC () | ||
|
||
@property (weak, nonatomic) IBOutlet UITextField *accessTokenTextField; | ||
@property (weak, nonatomic) IBOutlet UITextField *platformIdTextField; | ||
@property (weak, nonatomic) IBOutlet UILabel *devicesLabel; | ||
|
||
@end | ||
|
||
@implementation TIoTAllDevicesVC | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view. | ||
} | ||
|
||
- (IBAction)showAllDevices:(UIButton *)sender { | ||
[self.view endEditing:YES]; | ||
[[TIoTCoreDeviceSet shared] getVirtualBindDeviceListWithAccessToken:self.accessTokenTextField.text platformId:self.platformIdTextField.text offset:0 limit:0 success:^(id _Nonnull responseObject) { | ||
|
||
DDLogVerbose(@"getVirtualBindDeviceList==%@",responseObject); | ||
NSArray *devicesArr = [responseObject objectForKey:@"VirtualBindDeviceList"]; | ||
if (devicesArr) { | ||
NSString *content = @""; | ||
for (NSDictionary *device in devicesArr) { | ||
content = [content stringByAppendingString:[NSString stringWithFormat:@"%@\n", [device objectForKey:@"DeviceName"]]]; | ||
} | ||
self.devicesLabel.text = content; | ||
} else { | ||
[MBProgressHUD showError:@"没有设备"]; | ||
} | ||
|
||
} failure:^(NSString * _Nullable reason, NSError * _Nullable error,NSDictionary *dic) { | ||
if (dic) { | ||
[MBProgressHUD showError:[NSString stringWithFormat:@"code: %@, msg: %@", [dic objectForKey:@"code"], [dic objectForKey:@"msg"]]]; | ||
} | ||
}]; | ||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters