#ifndef WIFI_SSID
#error "WIFI_SSID not defined"
#endif
#ifndef WIFI_PASSWORD
#error "WIFI_PASSWORD not defined"
#endif
}
@end
@implementation MyAppDelegate
- (void)dealloc {
[_timer release];
[super dealloc];
}
- (void)applicationDidFinishLaunching:(id)application {
NXLog(@"WiFi not supported on this board");
[application terminateWithExitStatus:-1];
return;
}
if ([wifi connect:net withPassword:@WIFI_PASSWORD] ==
NO) {
NXLog(@"Failed to initiate connection to network: %@", net);
}
[_timer setDelegate:self];
}
NXLog(@"Application received signal: %d", (int)signal);
}
NXLog(@"Connection started to network: %@", network);
}
NXLog(@"Connection failed to network: %@, error: %d", network, (int)error);
switch (error) {
NXLog(@" >>>> Bad authentication");
break;
NXLog(@" >>>> Network not found");
break;
NXLog(@" >>>> General error");
break;
}
}
NXLog(@"Connected to network: %@", network);
}
NXLog(@"Disconnected from network: %@", network);
}
NXLog(@"Network time updated: %@", time);
}
- (void)timerFired:(
NXTimer *)timer {
NXLog(@"Current time: %@", now);
}
@end
int main(int argc, char *argv[]) {
}