update text shown during connect

This commit is contained in:
matthias.ringwald 2009-10-24 14:16:10 +00:00
parent 8a1967bd7f
commit 268eeeee3e
4 changed files with 38 additions and 21 deletions

View File

@ -29,12 +29,16 @@ typedef enum {
id<BTInquiryDelegate> delegate;
bool allowSelection;
// hack
// hacks
bool stopRemoteNameGathering;
BTDevice *remoteDevice;
}
- (void) startInquiry;
- (void) stopInquiry;
- (void) showConnecting:(BTDevice *) device;
@property (nonatomic, assign) bool allowSelection;
@property (nonatomic, retain) NSMutableArray *devices;
@property (nonatomic, retain) id<BTInquiryDelegate> delegate;

View File

@ -37,6 +37,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
bluetoothState = HCI_STATE_OFF;
inquiryState = kInquiryInactive;
allowSelection = false;
remoteDevice = nil;
macAddressFont = [UIFont fontWithName:@"Courier New" size:[UIFont labelFontSize]];
deviceNameFont = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
@ -226,6 +227,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
}
}
- (void) showConnecting:(BTDevice *) device {
remoteDevice = device;
[[self tableView] reloadData];
}
/*
- (void)viewDidLoad {
[super viewDidLoad];
@ -324,23 +330,28 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
label = @"Bluetooth not accessible!";
cell.accessoryView = nil;
} else {
switch (inquiryState){
case kInquiryInactive:
if ([devices count] > 0){
label = @"Find more devices...";
} else {
label = @"Find devices...";
}
cell.accessoryView = nil;
break;
case kInquiryActive:
label = @"Searching...";
cell.accessoryView = bluetoothActivity;
break;
case kInquiryRemoteName:
label = @"Query device names...";
cell.accessoryView = bluetoothActivity;
break;
if (remoteDevice) {
label = @"Connecting...";
cell.accessoryView = bluetoothActivity;
} else {
switch (inquiryState){
case kInquiryInactive:
if ([devices count] > 0){
label = @"Find more devices...";
} else {
label = @"Find devices...";
}
cell.accessoryView = nil;
break;
case kInquiryActive:
label = @"Searching...";
cell.accessoryView = bluetoothActivity;
break;
case kInquiryRemoteName:
label = @"Query device names...";
cell.accessoryView = bluetoothActivity;
break;
}
}
}
} else {

View File

@ -2,17 +2,18 @@
NEXT:
- prepare WiiMoteDemo for release
- update text shown during connect
- disconnect connection to wiimote on exit -- just enforce it
- improve user experience of BTstack Inquiry View
- shorter inquiry interval
- repeat inquiry while BT on
- CocoaTouch user interface
- add bluetooth on/off toggle
- on iPhone sleep, just turn off Bluetooth and disconnect all connections
- and figure out why stack doesn't shut Bluetooth off when in sleep for a while/after wakeup
- prepend all source files with 'new BSD' copyright header
- provide test version by setting up APT repository within BTstack SVN
- instructions: http://www.saurik.com/id/7
- prepend all source files with 'new BSD' copyright header
== Release Version 0.1

View File

@ -180,6 +180,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
NSLog(@"WiiMote found with address %@", [BTDevice stringForAddress:[selectedDevice address]]);
device = selectedDevice;
[inqViewControl stopInquiry];
[inqViewControl showConnecting:device];
// connect to device
[device setConnectionState:kBluetoothConnectionConnecting];