40 lines
1.1 KiB
Objective-C
40 lines
1.1 KiB
Objective-C
//
|
|
// 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
|
|
|