添加回调数据的解析过程

This commit is contained in:
xuemh
2018-08-06 22:51:30 +08:00
parent 1028ffa9ac
commit 5614a0a931
5 changed files with 61 additions and 4 deletions
@@ -12,6 +12,7 @@
#import "ConnectHotspotModel.h"
#import "ResetDeviceModel.h"
#import "RestartDeviceModel.h"
#import "IFishUDPHelperBackMsgModel.h"
@interface IFishHotpotUDPHelper ()
{
@@ -135,10 +136,14 @@
NSLog(@"didReceiveData%@",result);
NSLog(@"port%hu",port);
AppDelegate *app =(AppDelegate*)[UIApplication sharedApplication].delegate;
[app.window makeToast:[NSString stringWithFormat:@"收到答复:%@", result]];
if ([self.delegate respondsToSelector:@selector(udpHelperCommandExecutedSuccess)]) {
[self.delegate udpHelperCommandExecutedSuccess];
IFishUDPHelperBackMsgModel *model = [[IFishUDPHelperBackMsgModel alloc] initWithData:data];
if ([model.result isEqualToString:@"01"]) {
if ([self.delegate respondsToSelector:@selector(udpHelperCommandExecutedSuccess)]) {
[self.delegate udpHelperCommandExecutedSuccess];
}
} else {
AppDelegate *app =(AppDelegate*)[UIApplication sharedApplication].delegate;
[app.window makeToast:[NSString stringWithFormat:@"收到答复:%@", result]];
}
[self.loopTimer invalidate];
return YES;