first version with inquiry view working

This commit is contained in:
matthias.ringwald 2009-10-23 21:53:38 +00:00
parent 141679a411
commit edeeb1de6a
4 changed files with 14 additions and 14 deletions

View File

@ -5,9 +5,9 @@ NEXT:
- on device select: - on device select:
- if name != WiiMote - if name != WiiMote
- show alert: need wiimote - show alert: need wiimote
- stop inquiry - set flag to connecting for WiiMote
- set flag to connecting for wiimote
- on connect, switch view - on connect, switch view
- on back button, disconnect device
- improve user experience of BTstack Inquiry View - improve user experience of BTstack Inquiry View
- shorter inquiry interval - shorter inquiry interval
- repeat inquiry while BT on - repeat inquiry while BT on

View File

@ -12,6 +12,8 @@
#import <OpenGLES/ES1/gl.h> #import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h> #import <OpenGLES/ES1/glext.h>
#define USE_BLUETOOTH
/* /*
This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 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. The view content is basically an EAGL surface you render your OpenGL scene into.

View File

@ -18,7 +18,7 @@
UILabel *status; UILabel *status;
} }
- (void)startDemo:(id) arg; - (void)startDemo;
@property (nonatomic, retain) UIWindow *window; @property (nonatomic, retain) UIWindow *window;

View File

@ -14,8 +14,6 @@
#import <btstack/run_loop.h> #import <btstack/run_loop.h>
#import <btstack/hci_cmds.h> #import <btstack/hci_cmds.h>
#define USE_BLUETOOTH
BTDevice *device; BTDevice *device;
WiiMoteOpenGLDemoAppDelegate * theMainApp; 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 }; uint8_t setLEDs[] = { 0x52, 0x11, 0x10 };
bt_send_l2cap( source_cid, setLEDs, sizeof(setLEDs)); bt_send_l2cap( source_cid, setLEDs, sizeof(setLEDs));
// start GL demo // start demo
// [device setConnectionState:kBluetoothConnectionConnected]; [theMainApp startDemo];
// [[[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];
} }
break; break;
@ -115,8 +107,14 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
break; break;
} }
} }
- (void)startDemo:(id) arg { - (void)startDemo {
NSLog(@"startDemo"); NSLog(@"startDemo");
// stop connection icon
[device setConnectionState:kBluetoothConnectionConnected];
// push glViewControl on stack
[[[theMainApp inqViewControl] tableView] reloadData];
[navControl pushViewController:glViewControl animated:YES]; [navControl pushViewController:glViewControl animated:YES];
} }