添加设备log日志显示

This commit is contained in:
wbzhan
2019-07-15 18:44:29 +08:00
parent 33254ad734
commit 43bfceb262
4 changed files with 32 additions and 80 deletions
@@ -348,9 +348,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
NSString *newPassword = GIWEI_INITPASS;
self.lastSetPassword = [Utils GetTreatedPassword:newPassword];;
// [[P2PClient sharedClient] setInitPasswordWithId:self.contactID initPassword:self.lastSetPassword];
}else{
}
@@ -398,10 +396,12 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
NSString *deviceID = [deviceDict[@"deviceID"] stringValue];
NSString *deviceIP = deviceDict[@"deviceIP"];
NSString *devicePassword = deviceDict[@"devicePassword"];
weakSelf.contactID = [NSString stringWithFormat:@"%d",deviceID];
if (![deviceDict[@"isInitPassword"] boolValue]) { //设备没有初始化密码,设置密码
[[GWP2PClient sharedClient] setDeviceInitialPassword:@"123" withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"success:%i %@",success,dataDictionary);
[weakSelf.view makeToast:[NSString stringWithFormat:@"未初始化过设备密码,初始化设备密码失败 result = %i",dataDictionary]];
[weakSelf resetPassWord];//初始化密码
if (success) {
[weakSelf initPwdResault:dataDictionary];
@@ -411,14 +411,15 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
weakSelf.lodviewMissStyle =lodingViewdissMissSuccsess;
[weakSelf connectNormalView];
_canDissMissController = YES;
[weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)];
// [weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)];
});
}
}];
} else { //设备已经初始化密码,可以让用户输入正确的密码验证通过后加到本地列表,这里直接使用123
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:@"123" completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
} else {
//设备已经初始化过密码,则直接获取设备信息
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:devicePassword completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"success:%i %@",success,dataDictionary);
[weakSelf.view makeToast:[NSString stringWithFormat:@"获取设备信息失败 result = %i",dataDictionary]];
[weakSelf resetPassWord];//更新密码
if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
@@ -438,7 +439,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
self.lodviewMissStyle =lodingViewdissMissSuccsess;
[self connectNormalView];
_canDissMissController = YES;
[self.view makeToast:NSLocalizedString(@"operator_failure", nil)];
// [self.view makeToast:NSLocalizedString(@"operator_failure", nil)];
});
}
@@ -449,6 +450,7 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) {
//初始化设备密码回调
-(void)initPwdResault:(NSDictionary *)parameter{
NSString * contactName = [NSString stringWithFormat:@"Cam%@", self.contactID];
ContactDAO *contactDAO = [[ContactDAO alloc] init];