added support for custom host

This commit is contained in:
Diego Waxemberg
2014-10-20 20:08:12 -04:00
parent 37428c8c77
commit 85ee4f6518
6 changed files with 35 additions and 7 deletions
+1
View File
@@ -14,5 +14,6 @@
@property BOOL paired;
- (id) initWithHost:(NSNetService*)host;
- (id) initWithIp:(NSString*)host;
@end
+9
View File
@@ -19,4 +19,13 @@
return self;
}
- (id) initWithIp:(NSString*)host {
self = [super init];
self.hostName = host;
self.displayName = host;
return self;
}
@end
+1 -2
View File
@@ -18,8 +18,7 @@
@property (strong, nonatomic) IBOutlet UIPickerView *StreamConfigs;
@property (strong, nonatomic) NSArray* streamConfigVals;
@property (strong, nonatomic) NSArray* hostPickerVals;
- (void) segueIntoStream;
@property (strong, nonatomic) IBOutlet UITextField *hostTextField;
+ (NSString*) getHost;
+8
View File
@@ -29,6 +29,10 @@ static NSString* host;
- (void)PairButton:(UIButton *)sender
{
NSLog(@"Pair Button Pressed!");
if ([self.hostTextField.text length] > 0) {
_selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text];
NSLog(@"Using custom host: %@", self.hostTextField.text);
}
[CryptoManager generateKeyPairUsingSSl];
NSString* uniqueId = [CryptoManager getUniqueID];
NSData* cert = [CryptoManager readCertFromFile];
@@ -65,6 +69,10 @@ static NSString* host;
- (void)StreamButton:(UIButton *)sender
{
NSLog(@"Stream Button Pressed!");
if ([self.hostTextField.text length] > 0) {
_selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text];
NSLog(@"Using custom host: %@", self.hostTextField.text);
}
host = _selectedHost.hostName;
[self performSegueWithIdentifier:@"createStreamFrame" sender:self];
}