diff --git a/DDWRT_MonitorAppDelegate.h b/DDWRT_MonitorAppDelegate.h index 7e44676..bf43e43 100644 --- a/DDWRT_MonitorAppDelegate.h +++ b/DDWRT_MonitorAppDelegate.h @@ -54,10 +54,10 @@ // application prefs: - NSString *hostname; - NSInteger port; - NSString *username; - NSString *password; + NSString *hostname; + int port; + NSString *username; + NSString *password; int refreshTime; bool useBytes; diff --git a/DDWRT_MonitorAppDelegate.m b/DDWRT_MonitorAppDelegate.m index 5bd8663..15fa9d7 100644 --- a/DDWRT_MonitorAppDelegate.m +++ b/DDWRT_MonitorAppDelegate.m @@ -33,7 +33,7 @@ [self readDefaults]; // initialize the client - wrt_client = [[WRTStatusClient alloc] initWithHostname:hostname port:&port username:username password:password]; + wrt_client = [[WRTStatusClient alloc] initWithHostname:hostname port:port username:username password:password]; //_readTimer = [NSTimer scheduledTimerWithTimeInterval:[[NSUserDefaults standardUserDefaults] integerForKey:@"refreshTime"] target:self selector:@selector(updateThroughput:) userInfo:nil repeats:YES]; //[_readTimer fire]; @@ -50,7 +50,7 @@ [AppMenu release]; [_appMenu release]; [ConfigPanel release]; - [BandwidthViewer release]; + //[BandwidthViewer release]; [modalWindow release]; [super dealloc]; } @@ -408,7 +408,7 @@ //[wrtr doRequest:self requestSelector:@selector(wanRequestCallback:) uri:@"Status_Internet.live.asp"]; - [wrt_client getStatusUpdate:@"Status_Bandwidth.asp" delegate:wanRequestCallback]; + //[wrt_client getStatusUpdate:@"Status_Bandwidth.asp" delegate:wanRequestCallback]; } - (void) wanRequestCallback:(NSData *)data diff --git a/WRTStatusClient.h b/WRTStatusClient.h index 245e4db..7f0ac06 100644 --- a/WRTStatusClient.h +++ b/WRTStatusClient.h @@ -13,7 +13,7 @@ BOOL wrtReachable; @private NSString *hostname; - NSInteger *port; + int port; NSString *username; NSString *password; @@ -26,7 +26,7 @@ //SEL errorCallback; } -- (id) initWithHostname:(NSString*)new_hostname port:(NSInteger*)new_port username:(NSString*)new_username password:(NSString*)new_password; +- (id) initWithHostname:(NSString*)new_hostname port:(int)new_port username:(NSString*)new_username password:(NSString*)new_password; - (NSMutableURLRequest*) buildRequest:(NSString*)uri; - (NSMutableURLRequest*) requestForBandwidthViewerForInterface:(NSString*)interface; @@ -35,8 +35,8 @@ - (NSString*) getHostname; - (void) setHostname:(NSString*)new_hostname; -- (NSInteger*) getPort; -- (void) setPort:(NSInteger*)new_port; +- (int) getPort; +- (void) setPort:(int)new_port; - (NSString*) getUsername; - (void) setUsername:(NSString*)new_username; diff --git a/WRTStatusClient.m b/WRTStatusClient.m index 058b89a..e3639f9 100644 --- a/WRTStatusClient.m +++ b/WRTStatusClient.m @@ -11,7 +11,7 @@ @implementation WRTStatusClient -- (id) initWithHostname:(NSString*)new_hostname port:(NSInteger*)new_port username:(NSString*)new_username password:(NSString*)new_password +- (id) initWithHostname:(NSString*)new_hostname port:(int)new_port username:(NSString*)new_username password:(NSString*)new_password { self = [super init]; @@ -33,7 +33,8 @@ hostname, port, uri]; - + NSLog(@"Building request form %@", urlAddress); + NSURL *url = [NSURL URLWithString:urlAddress]; //[self request:url]; // ---V @@ -81,12 +82,12 @@ [old_hostname autorelease]; } -- (NSInteger *) getPort +- (int) getPort { return port; } -- (void) setPort:(NSInteger *)new_port +- (void) setPort:(int)new_port { port = new_port; }