From edeeb1de6a7f0e7a979995715bc04ec44e68622c Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Fri, 23 Oct 2009 21:53:38 +0000 Subject: [PATCH] first version with inquiry view working --- TODO.txt | 4 ++-- example/WiiMoteOpenGLDemo/Classes/EAGLView.h | 2 ++ .../Classes/WiiMoteOpenGLDemoAppDelegate.h | 2 +- .../Classes/WiiMoteOpenGLDemoAppDelegate.m | 20 +++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/TODO.txt b/TODO.txt index bf6ba3bc0..7a47f52e2 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,9 +5,9 @@ NEXT: - on device select: - if name != WiiMote - show alert: need wiimote - - stop inquiry - - set flag to connecting for wiimote + - set flag to connecting for WiiMote - on connect, switch view + - on back button, disconnect device - improve user experience of BTstack Inquiry View - shorter inquiry interval - repeat inquiry while BT on diff --git a/example/WiiMoteOpenGLDemo/Classes/EAGLView.h b/example/WiiMoteOpenGLDemo/Classes/EAGLView.h index 9a7caf310..63ab9a34d 100644 --- a/example/WiiMoteOpenGLDemo/Classes/EAGLView.h +++ b/example/WiiMoteOpenGLDemo/Classes/EAGLView.h @@ -12,6 +12,8 @@ #import #import +#define USE_BLUETOOTH + /* This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. The view content is basically an EAGL surface you render your OpenGL scene into. diff --git a/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.h b/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.h index 71d5d05a4..abc30c04b 100644 --- a/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.h +++ b/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.h @@ -18,7 +18,7 @@ UILabel *status; } -- (void)startDemo:(id) arg; +- (void)startDemo; @property (nonatomic, retain) UIWindow *window; diff --git a/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.m b/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.m index 40e8145f8..341f764b5 100644 --- a/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.m +++ b/example/WiiMoteOpenGLDemo/Classes/WiiMoteOpenGLDemoAppDelegate.m @@ -14,8 +14,6 @@ #import #import -#define USE_BLUETOOTH - BTDevice *device; WiiMoteOpenGLDemoAppDelegate * theMainApp; @@ -96,14 +94,8 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint uint8_t setLEDs[] = { 0x52, 0x11, 0x10 }; bt_send_l2cap( source_cid, setLEDs, sizeof(setLEDs)); - // start GL demo - // [device setConnectionState:kBluetoothConnectionConnected]; - // [[[theMainApp inqViewControl] tableView] reloadData]; - - // do perform on main thread stuff - // [[theMainApp navControl] pushViewController:[theMainApp glViewControl] animated:YES]; - [theMainApp performSelectorOnMainThread:@selector(startDemo:) - withObject:nil waitUntilDone:false]; + // start demo + [theMainApp startDemo]; } break; @@ -115,8 +107,14 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint break; } } -- (void)startDemo:(id) arg { +- (void)startDemo { NSLog(@"startDemo"); + + // stop connection icon + [device setConnectionState:kBluetoothConnectionConnected]; + + // push glViewControl on stack + [[[theMainApp inqViewControl] tableView] reloadData]; [navControl pushViewController:glViewControl animated:YES]; }