fix state reporting of BTstackManager

This commit is contained in:
matthias.ringwald 2010-04-04 17:28:38 +00:00
parent c0db20ab37
commit 6eb71891e9
3 changed files with 13 additions and 3 deletions

View File

@ -35,7 +35,7 @@
// Created by Matthias Ringwald on 3/30/09.
//
#import "BTDevice.h"
#import "btstack/BTDevice.h"
@implementation BTDevice

View File

@ -205,7 +205,14 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
}
-(BOOL) isActivating {
return state == kW4Activated;
switch (state){
case kW4SysBTState:
case kW4SysBTDisabled:
case kW4Activated:
return YES;
default:
return NO;
}
}
-(BOOL) isDiscoveryActive {
return state == kActivated && (discoveryState != kInactive);
@ -223,7 +230,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
if (state < kActivated) return BTSTACK_NOT_ACTIVATED;
switch (discoveryState){
case kInactive:
state = kDeactivated;
[self sendDiscoveryStoppedEvent];
break;
case kW4InquiryMode:

View File

@ -3,6 +3,10 @@
2009-11-08: Release 0.1
NEXT:
- clean up control flow
- l2cap directly sends data over socket: good/bad?
- split daemon into stack parts
- should there be STACK API/interface?
- BUG: bt_close crashes when used in CocoaTouch app
- add extern "C" to bstack methods
- see: http://stackoverflow.com/questions/376966/using-c-c-static-libraries-from-iphone-objectivec-apps