on applicationWillResignActive: just disconnect, power off and push 'don't know yet'

This commit is contained in:
matthias.ringwald 2009-10-24 16:31:40 +00:00
parent b76b202763
commit 979044ba98
2 changed files with 29 additions and 15 deletions

View File

@ -1,14 +1,14 @@
/* new todo file for BTstack */
NEXT:
- on applicationWillResignActive: just disconnect, power off and push "Not clear yet"
- 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
== Release Version 0.1
- figure out how to receive iPhone System Power IONotifications to detect,
when phone gets locked
- create <btstack/errors.h>
- add timeouts to cocoa run loop
- implement rest of L2CAP state machine

View File

@ -151,18 +151,18 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
inqViewControl = [[BTInquiryViewController alloc] init];
[inqViewControl setTitle:@"BTstack Device Selector"];
[inqViewControl setAllowSelection:NO];
// UILabel *footer = [[UILabel alloc] initWithFrame:CGRectMake(10,0,300,30)];
// footer.text = @"Please press the 1+2 buttons\nof your WiiMote at the same time\nto make it discoverable";
UITextView *footer = [[UITextView alloc] initWithFrame:CGRectMake(10,00,300,85)];
footer.text = @"Please make your WiiMote discoverable by pressing the 1+2 buttons at the same time";
footer.textColor = [UIColor blackColor];
footer.font = [UIFont fontWithName:@"Arial" size:18];
// footer.textAlignment = UITextAlignmentCenter;
footer.backgroundColor = [UIColor whiteColor];
footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
footer.editable = false;
[[inqViewControl tableView] setTableFooterView:footer];
if (btOK) {
UITextView *footer = [[UITextView alloc] initWithFrame:CGRectMake(10,00,300,85)];
footer.text = @"Please make your WiiMote discoverable by pressing the 1+2 buttons at the same time.";
footer.textColor = [UIColor blackColor];
footer.font = [UIFont fontWithName:@"Arial" size:18];
// footer.textAlignment = UITextAlignmentCenter;
footer.backgroundColor = [UIColor whiteColor];
footer.autoresizingMask = UIViewAutoresizingFlexibleWidth;
footer.editable = false;
[[inqViewControl tableView] setTableFooterView:footer];
}
// create nav view controller
navControl = [[UINavigationController alloc] initWithRootViewController:inqViewControl];
@ -186,7 +186,21 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
- (void)applicationWillResignActive:(UIApplication *)application {
glView.animationInterval = 1.0 / 5.0;
// glView.animationInterval = 1.0 / 5.0;
// if (wiiMoteConHandle) {
// bt_send_cmd(&hci_disconnect, wiiMoteConHandle, 0x13); // remote closed connection
// }
bt_send_cmd(&btstack_set_power_mode, HCI_POWER_OFF );
UIAlertView* alertView = [[UIAlertView alloc] init];
alertView.title = @"Power Management ?";
alertView.message = @"Don't know yet, what to do when\n"
"phone gets locked.\n"
"Turning Bluetooth off for now. :)\n";
NSLog(@"Alert: %@ - %@", alertView.title, alertView.message);
// [alertView addButtonWithTitle:@"Dismiss"];
[alertView show];
}