no message

This commit is contained in:
wbzhan 2019-10-10 17:35:35 +08:00
parent 79fc0ce36b
commit 347a774be9
2 changed files with 50 additions and 11 deletions

View File

@ -15410,7 +15410,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10.1.2;
CURRENT_PROJECT_VERSION = 10.1.3;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@ -15526,7 +15526,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10.1.2;
CURRENT_PROJECT_VERSION = 10.1.3;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;

View File

@ -54,15 +54,14 @@ Copy NSString *deviceId;
[self.progressView updatePercent:100 animation:YES];
[self.progressView endProgressWithString:@"设备连接中..."];
self.HUD.labelText = @"正在绑定设备";
//AP
[[GWP2PDeviceLinker shareInstance] p2pAPLinkDeviceWithWiFiSSID:self.wifiName wifiPassword:self.wifiPassword devicePassword:@"123" deviceReceive:^(NSString *deviceId, BOOL isSupport) {
//wifi
NSLog(@"设备%@收到WiFi,isSupport:%d",deviceId,isSupport);
self.deviceId = deviceId;
} deviceLinkIn:^(NSDictionary *deviceDict) {
//AP//wifi
[self bindDeviceWithDeviceId:self.deviceId];
}];
if ( [GWP2PClient sharedClient].linkStatus==P2PLinkStatusOK) {
[self connectDevice];
}else{
UserModel *model=[dataContorl getUserInfo];
[self loginGewellWith:model];
}
//wifi
// [self sendToDeviceWithSSIDName:self.wifiName andSSIDPWD:self.wifiPassword];
// // Do any additional setup after loading the view.
@ -70,6 +69,46 @@ Copy NSString *deviceId;
self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
//AP
-(void)connectDevice{
[[GWP2PDeviceLinker shareInstance] p2pAPLinkDeviceWithWiFiSSID:self.wifiName wifiPassword:self.wifiPassword devicePassword:@"123" deviceReceive:^(NSString *deviceId, BOOL isSupport) {
//wifi
NSLog(@"设备%@收到WiFi,isSupport:%d",deviceId,isSupport);
self.HUD.labelText = @"设备WiFi配置成功之后会断开设备热点连接设备到路由器";
self.deviceId = deviceId;
} deviceLinkIn:^(NSDictionary *deviceDict) {
//AP//wifi
if (IsEmptyStr(self.deviceId)) {
[self bindDeviceWithDeviceId:self.deviceId];
}
}];
}
//P2P线
-(void)loginGewellWith:(UserModel *)model
{
NSString *accountId =[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
if ([accountId isEqualToString:@"0"]) {
[self.view makeToast:@"暂未检测到设备"];
return;
}
if ([model.P2PVerifyCode1 isEqualToString:@""]) {
[self.view makeToast:@"暂未检测到设备"];
return;
}
if ([model.P2PVerifyCode2 isEqualToString:@""]) {
[self.view makeToast:@"暂未检测到设备"];
return;
}
if ([GWP2PClient sharedClient]!=P2PLinkStatusOK) {
[[GWP2PClient sharedClient] connectWithAccount:accountId codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
[self connectDevice];
}
//loginResult.contactId ID
NSLog(@"%@%@%@",accountId,model.P2PVerifyCode1,model.P2PVerifyCode2,model.sessionID,model.sessionID2);
}
-(void)bindDeviceWithDeviceId:(NSString*)deviceId{
NSLog(@"设备bssid_%@",deviceId);