deselect row immediately in inq view

This commit is contained in:
matthias.ringwald 2009-12-20 15:46:45 +00:00
parent 66537421ff
commit 3f9faf6c44
3 changed files with 21 additions and 27 deletions

View File

@ -105,10 +105,10 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
- (void) myStartInquiry{ - (void) myStartInquiry{
if (inquiryState != kInquiryInactive) { if (inquiryState != kInquiryInactive) {
NSLog(@"Inquiry already active"); // NSLog(@"Inquiry already active");
return; return;
} }
NSLog(@"Inquiry started"); // NSLog(@"Inquiry started");
stopRemoteNameGathering = false; stopRemoteNameGathering = false;
restartInquiry = true; restartInquiry = true;
@ -160,7 +160,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
bd_addr_t addr; bd_addr_t addr;
bt_flip_addr(addr, &packet[3+i*6]); bt_flip_addr(addr, &packet[3+i*6]);
if ([inqView getDeviceForAddress:&addr]) { if ([inqView getDeviceForAddress:&addr]) {
NSLog(@"Device %@ already in list", [BTDevice stringForAddress:&addr]); // NSLog(@"Device %@ already in list", [BTDevice stringForAddress:&addr]);
continue; continue;
} }
BTDevice *dev = [[BTDevice alloc] init]; BTDevice *dev = [[BTDevice alloc] init];
@ -178,7 +178,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
} }
} }
NSLog(@"adding %@", [dev toString] ); // NSLog(@"adding %@", [dev toString] );
[devices addObject:dev]; [devices addObject:dev];
if (delegate) { if (delegate) {
@ -217,7 +217,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
case HCI_EVENT_COMMAND_COMPLETE: case HCI_EVENT_COMMAND_COMPLETE:
if (COMMAND_COMPLETE_EVENT(packet, hci_inquiry_cancel)){ if (COMMAND_COMPLETE_EVENT(packet, hci_inquiry_cancel)){
// inquiry canceled // inquiry canceled
NSLog(@"Inquiry cancelled successfully"); // NSLog(@"Inquiry cancelled successfully");
inquiryState = kInquiryInactive; inquiryState = kInquiryInactive;
[[self tableView] reloadData]; [[self tableView] reloadData];
if (notifyDelegateOnInquiryStopped){ if (notifyDelegateOnInquiryStopped){
@ -229,7 +229,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
} }
if (COMMAND_COMPLETE_EVENT(packet, hci_remote_name_request_cancel)){ if (COMMAND_COMPLETE_EVENT(packet, hci_remote_name_request_cancel)){
// inquiry canceled // inquiry canceled
NSLog(@"Remote name request cancelled successfully"); // NSLog(@"Remote name request cancelled successfully");
inquiryState = kInquiryInactive; inquiryState = kInquiryInactive;
[[self tableView] reloadData]; [[self tableView] reloadData];
if (notifyDelegateOnInquiryStopped){ if (notifyDelegateOnInquiryStopped){
@ -259,7 +259,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
[deviceInfo setObject:deviceDict forKey:[dev addressString]]; [deviceInfo setObject:deviceDict forKey:[dev addressString]];
} }
[deviceDict setObject:linkKey forKey:PREFS_LINK_KEY]; [deviceDict setObject:linkKey forKey:PREFS_LINK_KEY];
NSLog(@"Adding link key for %@, value %@", devAddress, linkKey); // NSLog(@"Adding link key for %@, value %@", devAddress, linkKey);
} }
break; break;
@ -277,7 +277,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
} }
} }
if (linkKey) { if (linkKey) {
NSLog(@"Sending link key for %@, value %@", devAddress, linkKey); // NSLog(@"Sending link key for %@, value %@", devAddress, linkKey);
bt_send_cmd(&hci_link_key_request_reply, &event_addr, [linkKey bytes]); bt_send_cmd(&hci_link_key_request_reply, &event_addr, [linkKey bytes]);
} else { } else {
bt_send_cmd(&hci_link_key_request_negative_reply, &event_addr); bt_send_cmd(&hci_link_key_request_negative_reply, &event_addr);
@ -378,7 +378,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
bt_send_cmd(&hci_inquiry_cancel); bt_send_cmd(&hci_inquiry_cancel);
break; break;
case kInquiryInactive: case kInquiryInactive:
NSLog(@"stop inquiry called although inquiry inactive?"); // NSLog(@"stop inquiry called although inquiry inactive?");
break; break;
case kInquiryRemoteName: case kInquiryRemoteName:
if (remoteNameDevice) { if (remoteNameDevice) {
@ -562,7 +562,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"didSelectRowAtIndexPath %@", indexPath); // NSLog(@"didSelectRowAtIndexPath %@", indexPath);
// pro-actively deselect row
[tableView deselectRowAtIndexPath:indexPath animated:NO];
// Navigation logic may go here. Create and push another view controller. // Navigation logic may go here. Create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController]; // [self.navigationController pushViewController:anotherViewController];

View File

@ -98,7 +98,7 @@ HOOK(SpringBoard, applicationDidFinishLaunching$, void, id app) {
extern "C" void SpringBoardAccessInitialize(){ extern "C" void SpringBoardAccessInitialize(){
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog(@"SpringBoardAccessInitialize called for SpringBoard!"); // NSLog(@"SpringBoardAccessInitialize called for SpringBoard!");
// Setup hooks // Setup hooks
Class $SpringBoard(objc_getClass("SpringBoard")); Class $SpringBoard(objc_getClass("SpringBoard"));

View File

@ -3,7 +3,11 @@
2009-11-08: Release 0.1 2009-11-08: Release 0.1
NEXT: NEXT:
- fix SDK 2.0 detection - Add BluetoothToggle (shutdown of Apple's stack)
- Add improved RFCOMM user-client
- use switch on RFCOMM control field in rfcomm.c packet handler
- BUG: bt_close crashes when used in CocoaTouch app
- BUG: BTdaemon crashes on iPhone when CocoaTouch app is closed (sometimes)
- implement rest of L2CAP state machine - implement rest of L2CAP state machine
- incoming connections - incoming connections
- list of supported PSM - list of supported PSM
@ -16,13 +20,10 @@ NEXT:
- would be nice, if we could get woken up by Bluetooth data - would be nice, if we could get woken up by Bluetooth data
- create <btstack/errors.h> - create <btstack/errors.h>
- add timeouts to cocoa run loop - add timeouts to cocoa run loop
- RFCOMM implementation
- use switch on RFCOMM control field in rfcomm.c packet handler
- CocoaTouch User Interface Components - CocoaTouch User Interface Components
- Provide BTstack class - Provide BTstack class
- Warning and shutdown of Apple's stack - Warning and shutdown of Apple's stack
- create new GPG key for gmail account and sign APT package - BUG (non-reproducible): hci_state gets confused.
- non-reproducible bug: hci_state gets confused.
- BlueTool used although hci state should be on (right after quitting example/test) - BlueTool used although hci state should be on (right after quitting example/test)
- BlueTool not used although stack not working - BlueTool not used although stack not working
- more log messages - more log messages
@ -30,9 +31,6 @@ NEXT:
== Release 0.2 - Incoming L2CAP supported + UI Support == Release 0.2 - Incoming L2CAP supported + UI Support
- better deal with Apple stack
- figure out how to shut it down
- user interface
- extend SpringBoard feedback - extend SpringBoard feedback
- show alerts/messages using SpringBoardAcccess, e.g. Bluetooth disconnected by remote device - show alerts/messages using SpringBoardAcccess, e.g. Bluetooth disconnected by remote device
- add code to notify about remote disconnets - add code to notify about remote disconnets
@ -47,14 +45,6 @@ NEXT:
- error notification - error notification
- flow control - flow control
- reassembly/segmentation - reassembly/segmentation
- automatic disable of alternative Bluetooth Stack (e.g., BTServer on iPhone)
- DEMOS:
- BTstack-cmd
- info
- inquiry
- remote name
- open/close l2cap connection
- evtl. SDP browser
== Release Version 0.3 == Release Version 0.3
- implement RFCOMM - implement RFCOMM