-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathNeo_controller.m
99 lines (65 loc) · 1.44 KB
/
Neo_controller.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//
// Neo_controller.m
// data_m
//
// Created by Mike Fluff on 14.02.11.
// Copyright 2011 Altell ltd. All rights reserved.
//
#import "Neo_controller.h"
#import "Expecter.h"
#import "NSStringArgs.h"
@implementation Neo_controller
-(void)disableManagementInt
{
[iface startProcess:@"disableManagement"];
}
-(void)startConnectionType:(NSString *)typ
{
[iface initWithController:self addr:ip type:typ];
}
-(void)setMngIp:(NSString *)ip
{
NSArray *arguments = [[NSArray alloc] initWithObjects:@"eth0",ip,nil];
[iface startArgProcess:@"setip" arguments:arguments];
}
-(void)setint:(NSString *)name addr:(NSString *)ip
{
NSArray *arguments = [[NSArray alloc] initWithObjects:name,ip,nil];
[iface startArgProcess:@"setint" arguments:arguments];
}
//this method get physical interfaces number from device
-(int)checkIntNumber
{
int result;
[self startConnectionType:@"ssh"];
result = [[iface startProcess:@"checkIntNumber"] intValue];
return result;
}
-(BOOL)checkAvaliability
{
return isAvailable;
}
-(void)pingDevice
{
pingThread = [[NSThread alloc] initWithTarget:png selector:@selector(runPing) object:nil];
[pingThread start];
// [NSThread detachNewThreadSelector:@selector(runPing) toTarget:png withObject:nil];
//[png runPing];
}
//pingProto support methods
-(void)pingOK
{
isAvailable = YES;
}
-(void)pingNotOK
{
isAvailable = NO;
}
- (id)processFinished:(id)sender
{
}
- (void)dealloc
{
[pingThread cancel];
}
@end