Kaydet (Commit) b202d328 authored tarafından siqi's avatar siqi

before checkout

üst 894d19ab
...@@ -55,14 +55,18 @@ ...@@ -55,14 +55,18 @@
- (void) connectionStatusHandler:(NSNotification *)note - (void) connectionStatusHandler:(NSNotification *)note
{ {
if([[note name] isEqualToString:@"connection.status.connected"]){ if([[note name] isEqualToString:@"connection.status.connected"]){
NSLog(@"Connected"); if (self.state!=CONNECTED){
self.transmitter = [[CommandTransmitter alloc] initWithClient:self.client]; NSLog(@"Connected");
self.state = CONNECTED; self.transmitter = [[CommandTransmitter alloc] initWithClient:self.client];
[self.delegate setPinLabelText:[NSString stringWithFormat:@"%@", [self getPairingPin]]]; self.state = CONNECTED;
[self.delegate setPinLabelText:[NSString stringWithFormat:@"%@", [self getPairingPin]]];
}
} else if ([[note name] isEqualToString:@"connection.status.disconnected"]){ } else if ([[note name] isEqualToString:@"connection.status.disconnected"]){
NSLog(@"Connection Failed"); if (self.state != DISCONNECTED) {
self.state = DISCONNECTED; NSLog(@"Connection Failed");
[self.client disconnect]; self.state = DISCONNECTED;
[self.client disconnect];
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment