添加重启、恢复出厂的udp指令实现

This commit is contained in:
xuemh
2018-08-06 22:35:06 +08:00
parent 4546e0b981
commit 1028ffa9ac
12 changed files with 209 additions and 27 deletions
@@ -7,8 +7,9 @@
//
#import "RestartViewController.h"
#import "IFishHotpotUDPHelper.h"
@interface RestartViewController ()
@interface RestartViewController ()<IFishHotpotUDPHelperDelegate>
@end
@@ -19,19 +20,15 @@
self.title = @"重启设备";
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
- (IBAction)restart:(id)sender {
[IFishHotpotUDPHelper sharedInstance].delegate = self;
[[IFishHotpotUDPHelper sharedInstance] broadCastRestartCommand];
}
/*
#pragma mark - Navigation
#pragma mark - IFishHotpotUDPHelperDelegate
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
- (void)udpHelperCommandExecutedSuccess {
[self.view makeToast:@"设备即将重启"];
}
*/
@end
@@ -112,6 +112,9 @@
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="restart:" destination="-1" eventType="touchUpInside" id="JAB-MM-NYi"/>
</connections>
</button>
</subviews>
<constraints>
@@ -7,8 +7,9 @@
//
#import "SettingResetViewController.h"
#import "IFishHotpotUDPHelper.h"
@interface SettingResetViewController ()
@interface SettingResetViewController ()<IFishHotpotUDPHelperDelegate>
@end
@@ -19,20 +20,15 @@
self.title = @"恢复出厂设置";
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
- (IBAction)reset:(id)sender {
[IFishHotpotUDPHelper sharedInstance].delegate = self;
[[IFishHotpotUDPHelper sharedInstance] broadCastRestCommand];
}
/*
#pragma mark - Navigation
#pragma mark - IFishHotpotUDPHelperDelegate
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
- (void)udpHelperCommandExecutedSuccess {
[self.view makeToast:@"设备即将重置"];
}
*/
@end
@@ -112,6 +112,9 @@
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="reset:" destination="-1" eventType="touchUpInside" id="XwX-J9-wjl"/>
</connections>
</button>
</subviews>
<constraints>