added cocoa inquiry dialog to sources - not called though

This commit is contained in:
matthias.ringwald 2009-10-22 21:21:27 +00:00
parent 5edccd66e5
commit aeccc34dce
2 changed files with 14 additions and 12 deletions

View File

@ -36,18 +36,13 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
switch (packet[0]){
case BTSTACK_EVENT_STATE:
// bt stack activated, get started - set local name
// bt stack activated, get started - // use pairing yes/no
if (packet[2] == HCI_STATE_WORKING) {
bt_send_cmd(&hci_write_local_name, "BTstack-Test");
bt_send_cmd(&hci_write_authentication_enable, 0);
(*state_cb)("BT running");
}
break;
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Please enter PIN 1234 on remote device\n");
break;
case L2CAP_EVENT_CHANNEL_OPENED:
// inform about new l2cap connection
bt_flip_addr(event_addr, &packet[3]);
@ -70,11 +65,6 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
}
case HCI_EVENT_COMMAND_COMPLETE:
// use pairing yes/no
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_local_name) ) {
bt_send_cmd(&hci_write_authentication_enable, 0);
}
// connect to HID device (PSM 0x13) at addr
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_authentication_enable) ) {
(*state_cb)("Connecting to WiiMote");

View File

@ -14,6 +14,8 @@
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
9C0D06391091035200FC3BBA /* BTDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C0D06361091035200FC3BBA /* BTDevice.m */; };
9C0D063A1091035200FC3BBA /* BTInquiryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C0D06381091035200FC3BBA /* BTInquiryViewController.m */; };
9C180042108B95B000824BE7 /* libBTstack.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C180041108B95B000824BE7 /* libBTstack.dylib */; };
9C6BB62E1027911E00A0BCB0 /* wiimote_texture.png in Resources */ = {isa = PBXBuildFile; fileRef = 9C6BB62D1027911E00A0BCB0 /* wiimote_texture.png */; };
9CB96E9810278945002663D0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CB96E9710278945002663D0 /* CoreGraphics.framework */; };
@ -35,6 +37,10 @@
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* WiiMoteOpenGLDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WiiMoteOpenGLDemo_Prefix.pch; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9C0D06351091035200FC3BBA /* BTDevice.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = BTDevice.h; path = ../../CocoaTouch/include/BTstack/BTDevice.h; sourceTree = SOURCE_ROOT; };
9C0D06361091035200FC3BBA /* BTDevice.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; name = BTDevice.m; path = ../../CocoaTouch/src/BTDevice.m; sourceTree = SOURCE_ROOT; };
9C0D06371091035200FC3BBA /* BTInquiryViewController.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = BTInquiryViewController.h; path = ../../CocoaTouch/include/BTstack/BTInquiryViewController.h; sourceTree = SOURCE_ROOT; };
9C0D06381091035200FC3BBA /* BTInquiryViewController.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; name = BTInquiryViewController.m; path = ../../CocoaTouch/src/BTInquiryViewController.m; sourceTree = SOURCE_ROOT; };
9C18001B108B94FB00824BE7 /* btstack.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = btstack.h; sourceTree = "<group>"; };
9C18001C108B94FB00824BE7 /* hci_cmds.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = hci_cmds.h; sourceTree = "<group>"; };
9C18001D108B94FB00824BE7 /* linked_list.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = linked_list.h; sourceTree = "<group>"; };
@ -145,6 +151,10 @@
9CCE6DC71025E0A600FCE9F4 /* BTstack */ = {
isa = PBXGroup;
children = (
9C0D06351091035200FC3BBA /* BTDevice.h */,
9C0D06361091035200FC3BBA /* BTDevice.m */,
9C0D06371091035200FC3BBA /* BTInquiryViewController.h */,
9C0D06381091035200FC3BBA /* BTInquiryViewController.m */,
9CCE6DD91025E18700FCE9F4 /* BTWiiMote.c */,
9CCE6DDB1025E19600FCE9F4 /* BTWiiMote.h */,
);
@ -209,6 +219,8 @@
1D3623260D0F684500981E51 /* WiiMoteOpenGLDemoAppDelegate.m in Sources */,
9CCE6DDA1025E18700FCE9F4 /* BTWiiMote.c in Sources */,
9CB96EEF10278D8D002663D0 /* EAGLView.m in Sources */,
9C0D06391091035200FC3BBA /* BTDevice.m in Sources */,
9C0D063A1091035200FC3BBA /* BTInquiryViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};