Created new host discovery system

- now store host uuid and mac address
- use uuid to check for duplicate hosts
- try local and external IPs
- pair status is shown
- server status is shown
- validate host when manually adding
This commit is contained in:
Diego Waxemberg
2015-01-01 22:30:03 -05:00
parent 0e2765ad86
commit e8c8f4f8e9
17 changed files with 326 additions and 154 deletions
+1 -1
View File
@@ -19,6 +19,6 @@
- (Settings*) retrieveSettings;
- (NSArray*) retrieveHosts;
- (void) saveHosts;
- (Host*) createHost:(NSString*)name hostname:(NSString*)address;
- (Host*) createHost;
@end
+1 -4
View File
@@ -45,12 +45,9 @@
}
}
- (Host*) createHost:(NSString*)name hostname:(NSString*)address {
- (Host*) createHost {
NSEntityDescription* entity = [NSEntityDescription entityForName:@"Host" inManagedObjectContext:[self.appDelegate managedObjectContext]];
Host* host = [[Host alloc] initWithEntity:entity insertIntoManagedObjectContext:[self.appDelegate managedObjectContext]];
host.name = name;
host.address = address;
return host;
}
+8 -2
View File
@@ -8,11 +8,17 @@
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "Utils.h"
@interface Host : NSManagedObject
@property (nonatomic, retain) NSString * address;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSString * address;
@property (nonatomic, retain) NSString * localAddress;
@property (nonatomic, retain) NSString * externalAddress;
@property (nonatomic, retain) NSString * uuid;
@property (nonatomic, retain) NSString * mac;
@property (nonatomic) BOOL online;
@property (nonatomic) PairState pairState;
@end
+7 -1
View File
@@ -11,7 +11,13 @@
@implementation Host
@dynamic address;
@dynamic name;
@dynamic address;
@dynamic localAddress;
@dynamic externalAddress;
@dynamic uuid;
@dynamic mac;
@dynamic pairState;
@synthesize online;
@end