配网页面初步

This commit is contained in:
祝发冬
2023-08-15 21:04:27 +08:00
parent a27efea1f6
commit afd4d2bc2a
7 changed files with 1119 additions and 31 deletions
@@ -0,0 +1,19 @@
//
// EspTouchDelegateImpl.h
// Ifish
//
// Created by 祝发冬 on 2023/8/15.
// Copyright © 2023 lianlian. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ESPTouchTask.h"
#import "ESPTouchResult.h"
#import "ESPTouchDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface EspTouchDelegateImpl : NSObject<ESPTouchDelegate>
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,39 @@
//
// EspTouchDelegateImpl.m
// Ifish
//
// Created by 祝发冬 on 2023/8/15.
// Copyright © 2023 lianlian. All rights reserved.
//
#import "EspTouchDelegateImpl.h"
@implementation EspTouchDelegateImpl
-(void) dismissAlert:(UIAlertView *)alertView
{
[alertView dismissWithClickedButtonIndex:[alertView cancelButtonIndex] animated:YES];
}
-(void) showAlertWithResult: (ESPTouchResult *) result
{
NSString *title = nil;
NSString *message = [NSString stringWithFormat:@"%@ is connected to the wifi" , result.bssid];
NSTimeInterval dismissSeconds = 3.5;
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alertView show];
[self performSelector:@selector(dismissAlert:) withObject:alertView afterDelay:dismissSeconds];
}
-(void) onEsptouchResultAddedWithResult: (ESPTouchResult *) result
{
NSLog(@"EspTouchDelegateImpl onEsptouchResultAddedWithResult bssid: %@", result.bssid);
dispatch_async(dispatch_get_main_queue(), ^{
// [self showAlertWithResult:result];
});
}
@end