From 19b25e5f757eb9e2f8749d57de3ba083fee0c464 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Sat, 9 Jan 2010 10:19:43 +0000 Subject: [PATCH] added script to create version.h --- CocoaTouch/src/BTInquiryViewController.m | 4 + TODO.txt | 33 ++-- example/rfcomm.c | 170 +++++++++++++++- project.xcodeproj/project.pbxproj | 242 +++-------------------- src/Makefile.in | 1 + src/get_version.sh | 13 ++ 6 files changed, 218 insertions(+), 245 deletions(-) create mode 100755 src/get_version.sh diff --git a/CocoaTouch/src/BTInquiryViewController.m b/CocoaTouch/src/BTInquiryViewController.m index cc89cd002..310b228d2 100644 --- a/CocoaTouch/src/BTInquiryViewController.m +++ b/CocoaTouch/src/BTInquiryViewController.m @@ -215,6 +215,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe remoteNameIndex++; [self getNextRemoteName]; break; + case HCI_EVENT_LINK_KEY_NOTIFICATION: if (deviceInfo) { bt_flip_addr(event_addr, &packet[2]); @@ -549,6 +550,9 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe case 0x80: imageName = @"mouse.png"; break; + case 0xc0: + imageName = @"keyboard.png"; + break; default: imageName = @"HID.png"; break; diff --git a/TODO.txt b/TODO.txt index d98c2d785..a2d4deb98 100644 --- a/TODO.txt +++ b/TODO.txt @@ -6,31 +6,29 @@ NEXT: - 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) +- get BD address on init, so it is in the dump +- create - implement rest of L2CAP state machine - incoming connections - list of supported PSM - commands and events- -- figure out how to receive iPhone System Power IONotifications (in BTdaemon) to detect, when phone gets locked - - some trick - - use Cocoa run loop for background app? - - see iPhone imsomnia project at http://code.google.com/p/iphone-insomnia/ - - can we get willGoToSleep event, should we turn off Bluetooth? - - would be nice, if we could get woken up by Bluetooth data -- create -- add timeouts to cocoa run loop -- CocoaTouch User Interface Components - - Provide BTstack class - - Warning and shutdown of Apple's stack +- SpringBoard +- BUG: bt_close crashes when used in CocoaTouch app +- BUG: BTdaemon crashes on iPhone when CocoaTouch app is closed (sometimes) - BUG (non-reproducible): hci_state gets confused. - BlueTool used although hci state should be on (right after quitting example/test) - BlueTool not used although stack not working - more log messages -- non-reproducible bug: debug BlueTool's "I'm not a Bluetooth stack" error message + - BlueTool's "I'm not a Bluetooth stack" error message -== Release 0.2 - Incoming L2CAP supported + UI Support - +== Release 0.2 - Incoming L2CAP supported + improved Inq Dialog +- CocoaTouch User Interface Components + - Provide BTstack class + - Warning and shutdown of Apple's stack +- add timeouts to cocoa run loop +- figure out how to receive iPhone System Power IONotifications (in BTdaemon) to detect, when phone gets locked + - some trick + - use Cocoa run loop for background app? - extend SpringBoard feedback - show alerts/messages using SpringBoardAcccess, e.g. Bluetooth disconnected by remote device - add code to notify about remote disconnets @@ -62,5 +60,4 @@ NEXT: - Bluetooth low-power modes useful == USB Support == -- Store array of data sources to be able to remove them on usb_close -- \ No newline at end of file +- Store array of data sources to be able to remove them on usb_close \ No newline at end of file diff --git a/example/rfcomm.c b/example/rfcomm.c index 8ed761a78..43e12dad2 100644 --- a/example/rfcomm.c +++ b/example/rfcomm.c @@ -82,6 +82,16 @@ #define BT_RFCOMM_CRC_CHECK_LEN 3 #define BT_RFCOMM_UIHCRC_CHECK_LEN 2 + +struct celluon_state { + int len; /* Expected length of current packet */ + int count; /* Number of bytes received */ + int action; + int key; +}; +static void celluon_decode( struct celluon_state *s, uint8_t c); + + bd_addr_t addr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; int RFCOMM_CHANNEL_ID = 1; char PIN[] = "0000"; @@ -95,6 +105,9 @@ int fifo_fd; // used to assemble rfcomm packets uint8_t rfcomm_out_buffer[1000]; + +struct celluon_state cellState; + /** * @param credits - only used for RFCOMM flow control in UIH wiht P/F = 1 */ @@ -236,8 +249,10 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint printf("RX: address %02x, control %02x: ", packet[0], packet[1]); hexdump( (uint8_t*) &packet[3], size-4); } - int written = 0; int length = size-4; + +#if 0 + int written = 0; int start_of_data = 3; //write data to fifo while (length) { @@ -247,6 +262,13 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint length -= written; } } +#else + int i = 0; + for(i=0;i= '0' && c <= '9') + return c; + + if (c >= 'A' && c <= 'Z') + return c; + +/* + switch (c) { + case 0x08: + return KEY_BACKSPACE; + case 0x09: + return KEY_TAB; + case 0x0d: + return KEY_ENTER; + case 0x11: + return KEY_LEFTCTRL; + case 0x14: + return KEY_CAPSLOCK; + case 0x20: + return KEY_SPACE; + case 0x25: + return KEY_LEFT; + case 0x26: + return KEY_UP; + case 0x27: + return KEY_RIGHT; + case 0x28: + return KEY_DOWN; + case 0x2e: + return KEY_DELETE; + case 0x5b: + return KEY_MENU; + case 0xa1: + return KEY_RIGHTSHIFT; + case 0xa0: + return KEY_LEFTSHIFT; + case 0xba: + return KEY_SEMICOLON; + case 0xbd: + return KEY_MINUS; + case 0xbc: + return KEY_COMMA; + case 0xbb: + return KEY_EQUAL; + case 0xbe: + return KEY_DOT; + case 0xbf: + return KEY_SLASH; + case 0xc0: + return KEY_GRAVE; + case 0xdb: + return KEY_LEFTBRACE; + case 0xdc: + return KEY_BACKSLASH; + case 0xdd: + return KEY_RIGHTBRACE; + case 0xde: + return KEY_APOSTROPHE; + case 0xff03: + return KEY_HOMEPAGE; + case 0xff04: + return KEY_TIME; + case 0xff06: + return KEY_OPEN; + case 0xff07: + return KEY_LIST; + case 0xff08: + return KEY_MAIL; + case 0xff30: + return KEY_CALC; + case 0xff1a: // Map FN to ALT + return KEY_LEFTALT; + case 0xff2f: + return KEY_INFO; + default: + printf("Unknown key %x\n", c); + return c; + } + */ + return c; +} + +static void celluon_decode( struct celluon_state *s, uint8_t c) +{ + if (s->count < 2 && c != 0xa5) { + /* Lost Sync */ + s->count = 0; + return; + } + //printf("data %x, state %u\n", c, s->count); + switch (s->count) { + case 0: + /* New packet - Reset state */ + s->len = 30; + s->key = 0; + break; + case 1: + break; + case 6: + s->action = c; + break; + case 28: + s->key = c; + if (c == 0xff) + s->len = 31; + break; + case 29: + case 30: + if (s->count == s->len - 1) { + /* TODO: Verify checksum */ + if (s->action) { + printf("key %c (%u)\n", s->key, s->action); + } + s->count = -1; + } else { + s->key = (s->key << 8) | c; + } + break; + } + + s->count++; + + return; +} + + void usage(const char *name){ fprintf(stderr, "Usage : %s [-a|--address aa:bb:cc:dd:ee:ff] [-c|--channel n] [-p|--pin nnnn]\n", name); } @@ -416,12 +566,14 @@ int main (int argc, const char * argv[]){ } arg++; } + + printf("Waiting for client to open %s...\n", FIFO_NAME); - int err = mknod(FIFO_NAME, S_IFIFO | 0666, 0); - if(err >= 0 || errno == EEXIST){ - fifo_fd = open(FIFO_NAME, O_WRONLY); +// int err = mknod(FIFO_NAME, S_IFIFO | 0666, 0); +// if(err >= 0 || errno == EEXIST){ +// fifo_fd = open(FIFO_NAME, O_WRONLY); run_loop_init(RUN_LOOP_POSIX); - err = bt_open(); + int err = bt_open(); if (err) { fprintf(stderr,"Failed to open connection to BTdaemon, err %d\n",err); return 1; @@ -433,10 +585,10 @@ int main (int argc, const char * argv[]){ bt_send_cmd(&btstack_set_power_mode, HCI_POWER_ON ); run_loop_execute(); bt_close(); - } else { - fprintf(stderr, "Failed mknod %s, errno %d\n", FIFO_NAME, errno); - return 1; - } +// } else { +// fprintf(stderr, "Failed mknod %s, errno %d\n", FIFO_NAME, errno); +// return 1; +// } return 0; } diff --git a/project.xcodeproj/project.pbxproj b/project.xcodeproj/project.pbxproj index 21ad9446c..ca5f8c02e 100644 --- a/project.xcodeproj/project.pbxproj +++ b/project.xcodeproj/project.pbxproj @@ -17,6 +17,9 @@ 9C04B876107D2B7C002A63D0 /* run_loop_cocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CEB4DAA10753B4B00DD5720 /* run_loop_cocoa.m */; }; 9C04B87A107D2BA7002A63D0 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C04B879107D2BA7002A63D0 /* CoreFoundation.framework */; }; 9C05FC971020D3F300255261 /* socket_connection.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C00F7301017ACC3008DAB17 /* socket_connection.c */; }; + 9C13C9F710ECECE900B04243 /* mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C13C9F610ECECE900B04243 /* mouse.c */; }; + 9C13C9FF10ECED6300B04243 /* BTDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C13C9FC10ECED6300B04243 /* BTDevice.m */; }; + 9C13CA0010ECED6300B04243 /* BTInquiryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C13C9FE10ECED6300B04243 /* BTInquiryViewController.m */; }; 9C18015C108BAA7200824BE7 /* libusb-1.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C18015B108BAA7200824BE7 /* libusb-1.0.dylib */; }; 9C2071F310014D3200A07EA4 /* hci_transport_usb.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C2071F210014D3200A07EA4 /* hci_transport_usb.c */; }; 9C46FC3A0FA906F700ABEF05 /* hci_transport_h4.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C46FC360FA906F700ABEF05 /* hci_transport_h4.c */; }; @@ -34,16 +37,6 @@ 9CEB4F17107AAAEF00DD5720 /* run_loop_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CEB4DAC10753BE600DD5720 /* run_loop_posix.c */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 9C88A1F310C7DE320003DF36 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9C88A18D10C7DE310003DF36 /* BTstackCocoa.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 1D6058910D05DD3D006BFB54; - remoteInfo = BTstackCocoa; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 8DD76FAF0486AB0100D96B5E /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -66,6 +59,11 @@ 9C00F87210191130008DAB17 /* l2cap_signaling.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = l2cap_signaling.c; path = src/l2cap_signaling.c; sourceTree = ""; }; 9C04B825107D1CED002A63D0 /* run_loop.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = run_loop.c; path = src/run_loop.c; sourceTree = ""; }; 9C04B879107D2BA7002A63D0 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; + 9C13C9F610ECECE900B04243 /* mouse.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = mouse.c; path = example/mouse.c; sourceTree = ""; }; + 9C13C9FB10ECED6300B04243 /* BTDevice.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = BTDevice.h; path = CocoaTouch/include/BTstack/BTDevice.h; sourceTree = ""; }; + 9C13C9FC10ECED6300B04243 /* BTDevice.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; name = BTDevice.m; path = CocoaTouch/src/BTDevice.m; sourceTree = ""; }; + 9C13C9FD10ECED6300B04243 /* BTInquiryViewController.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = BTInquiryViewController.h; path = CocoaTouch/include/BTstack/BTInquiryViewController.h; sourceTree = ""; }; + 9C13C9FE10ECED6300B04243 /* BTInquiryViewController.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; name = BTInquiryViewController.m; path = CocoaTouch/src/BTInquiryViewController.m; sourceTree = ""; }; 9C18015B108BAA7200824BE7 /* libusb-1.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libusb-1.0.dylib"; path = "/usr/local/lib/libusb-1.0.dylib"; sourceTree = ""; }; 9C1813F71042FCCA00C68F09 /* mitm.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = mitm.c; path = example/mitm.c; sourceTree = ""; }; 9C2071F210014D3200A07EA4 /* hci_transport_usb.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = hci_transport_usb.c; path = src/hci_transport_usb.c; sourceTree = ""; }; @@ -101,22 +99,6 @@ 9C7ECBB40FCC95DD0085DAC5 /* hci_dump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hci_dump.c; path = src/hci_dump.c; sourceTree = ""; }; 9C88500C0FBF6702004980E4 /* l2cap.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = l2cap.c; path = src/l2cap.c; sourceTree = ""; }; 9C88500D0FBF6702004980E4 /* l2cap.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = l2cap.h; path = src/l2cap.h; sourceTree = ""; }; - 9C88A18C10C7DE310003DF36 /* BTstackCocoa-Info.plist */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.plist.xml; path = "BTstackCocoa-Info.plist"; sourceTree = ""; }; - 9C88A18D10C7DE310003DF36 /* BTstackCocoa.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = BTstackCocoa.xcodeproj; sourceTree = ""; }; - 9C88A19010C7DE310003DF36 /* BTstackCocoa_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTstackCocoa_Prefix.pch; sourceTree = ""; }; - 9C88A19D10C7DE310003DF36 /* control */ = {isa = PBXFileReference; lastKnownFileType = file; path = control; sourceTree = ""; }; - 9C88A1D010C7DE310003DF36 /* bluetooth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bluetooth.png; sourceTree = ""; }; - 9C88A1D110C7DE310003DF36 /* computer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = computer.png; sourceTree = ""; }; - 9C88A1D210C7DE310003DF36 /* keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard.png; sourceTree = ""; }; - 9C88A1D310C7DE310003DF36 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; - 9C88A1D410C7DE310003DF36 /* smartphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = smartphone.png; sourceTree = ""; }; - 9C88A1D810C7DE310003DF36 /* BTDevice.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTDevice.h; sourceTree = ""; }; - 9C88A1D910C7DE310003DF36 /* BTInquiryViewController.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTInquiryViewController.h; sourceTree = ""; }; - 9C88A1DB10C7DE310003DF36 /* BTDevice.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = BTDevice.m; sourceTree = ""; }; - 9C88A1DC10C7DE310003DF36 /* BTInquiryViewController.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = BTInquiryViewController.m; sourceTree = ""; }; - 9C88A1DD10C7DE310003DF36 /* BTstackCocoaAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTstackCocoaAppDelegate.h; sourceTree = ""; }; - 9C88A1DE10C7DE310003DF36 /* BTstackCocoaAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = BTstackCocoaAppDelegate.m; sourceTree = ""; }; - 9C88A1DF10C7DE310003DF36 /* main.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 9C994B8E106BEEB700C70311 /* rfcomm.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = rfcomm.c; path = example/rfcomm.c; sourceTree = ""; }; 9CA3C0900FB8B3C4005F48DE /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = TODO.txt; sourceTree = ""; }; 9CAA573610A5D87400D0E1A9 /* inquiry.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = inquiry.c; path = example/inquiry.c; sourceTree = ""; }; @@ -162,8 +144,8 @@ 9CEB4B7510715DC200DD5720 /* include */, 9C77E4AD10634E3100F39DCF /* 3rdparty */, 9C78A049103C671D003B2950 /* Resources */, + 9C13C9FA10ECED6300B04243 /* CocoaTouch */, 9C7B5B81100D04520065D87E /* Example */, - 9C88A18B10C7DE300003DF36 /* CocoaTouch */, 08FB7795FE84155DC02AAC07 /* Source */, 9C77E2751060322300F39DCF /* SpringBoardAccess */, C6A0FF2B0290797F04C91782 /* Documentation */, @@ -221,6 +203,17 @@ name = Products; sourceTree = ""; }; + 9C13C9FA10ECED6300B04243 /* CocoaTouch */ = { + isa = PBXGroup; + children = ( + 9C13C9FB10ECED6300B04243 /* BTDevice.h */, + 9C13C9FC10ECED6300B04243 /* BTDevice.m */, + 9C13C9FD10ECED6300B04243 /* BTInquiryViewController.h */, + 9C13C9FE10ECED6300B04243 /* BTInquiryViewController.m */, + ); + name = CocoaTouch; + sourceTree = ""; + }; 9C77E2751060322300F39DCF /* SpringBoardAccess */ = { isa = PBXGroup; children = ( @@ -262,6 +255,7 @@ isa = PBXGroup; children = ( 9CAA573610A5D87400D0E1A9 /* inquiry.c */, + 9C13C9F610ECECE900B04243 /* mouse.c */, 9C994B8E106BEEB700C70311 /* rfcomm.c */, 9C1813F71042FCCA00C68F09 /* mitm.c */, 9C7B5B7E100D04450065D87E /* test.c */, @@ -269,181 +263,6 @@ name = Example; sourceTree = ""; }; - 9C88A18B10C7DE300003DF36 /* CocoaTouch */ = { - isa = PBXGroup; - children = ( - 9C88A18C10C7DE310003DF36 /* BTstackCocoa-Info.plist */, - 9C88A18D10C7DE310003DF36 /* BTstackCocoa.xcodeproj */, - 9C88A19010C7DE310003DF36 /* BTstackCocoa_Prefix.pch */, - 9C88A19110C7DE310003DF36 /* build */, - 9C88A1CF10C7DE310003DF36 /* icons */, - 9C88A1D610C7DE310003DF36 /* include */, - 9C88A1DA10C7DE310003DF36 /* src */, - ); - path = CocoaTouch; - sourceTree = ""; - }; - 9C88A18E10C7DE310003DF36 /* Products */ = { - isa = PBXGroup; - children = ( - 9C88A1F410C7DE320003DF36 /* BTstackCocoa.app */, - ); - name = Products; - sourceTree = ""; - }; - 9C88A19110C7DE310003DF36 /* build */ = { - isa = PBXGroup; - children = ( - 9C88A19210C7DE310003DF36 /* BTstackCocoa.build */, - 9C88A1C910C7DE310003DF36 /* Debug-iphoneos */, - 9C88A1CC10C7DE310003DF36 /* Debug-iphonesimulator */, - ); - path = build; - sourceTree = ""; - }; - 9C88A19210C7DE310003DF36 /* BTstackCocoa.build */ = { - isa = PBXGroup; - children = ( - 9C88A19310C7DE310003DF36 /* BTstackCocoa.pbxindex */, - 9C88A1A110C7DE310003DF36 /* Debug-iphoneos */, - 9C88A1B210C7DE310003DF36 /* Debug-iphonesimulator */, - ); - path = BTstackCocoa.build; - sourceTree = ""; - }; - 9C88A19310C7DE310003DF36 /* BTstackCocoa.pbxindex */ = { - isa = PBXGroup; - children = ( - 9C88A19C10C7DE310003DF36 /* strings.pbxstrings */, - ); - path = BTstackCocoa.pbxindex; - sourceTree = ""; - }; - 9C88A19C10C7DE310003DF36 /* strings.pbxstrings */ = { - isa = PBXGroup; - children = ( - 9C88A19D10C7DE310003DF36 /* control */, - ); - path = strings.pbxstrings; - sourceTree = ""; - }; - 9C88A1A110C7DE310003DF36 /* Debug-iphoneos */ = { - isa = PBXGroup; - children = ( - 9C88A1A210C7DE310003DF36 /* BTstackCocoa.build */, - ); - path = "Debug-iphoneos"; - sourceTree = ""; - }; - 9C88A1A210C7DE310003DF36 /* BTstackCocoa.build */ = { - isa = PBXGroup; - children = ( - 9C88A1AC10C7DE310003DF36 /* Objects-normal */, - ); - path = BTstackCocoa.build; - sourceTree = ""; - }; - 9C88A1AC10C7DE310003DF36 /* Objects-normal */ = { - isa = PBXGroup; - children = ( - 9C88A1AD10C7DE310003DF36 /* armv6 */, - ); - path = "Objects-normal"; - sourceTree = ""; - }; - 9C88A1AD10C7DE310003DF36 /* armv6 */ = { - isa = PBXGroup; - children = ( - ); - path = armv6; - sourceTree = ""; - }; - 9C88A1B210C7DE310003DF36 /* Debug-iphonesimulator */ = { - isa = PBXGroup; - children = ( - 9C88A1B310C7DE310003DF36 /* BTstackCocoa.build */, - ); - path = "Debug-iphonesimulator"; - sourceTree = ""; - }; - 9C88A1B310C7DE310003DF36 /* BTstackCocoa.build */ = { - isa = PBXGroup; - children = ( - 9C88A1BD10C7DE310003DF36 /* Objects-normal */, - ); - path = BTstackCocoa.build; - sourceTree = ""; - }; - 9C88A1BD10C7DE310003DF36 /* Objects-normal */ = { - isa = PBXGroup; - children = ( - 9C88A1BE10C7DE310003DF36 /* i386 */, - ); - path = "Objects-normal"; - sourceTree = ""; - }; - 9C88A1BE10C7DE310003DF36 /* i386 */ = { - isa = PBXGroup; - children = ( - ); - path = i386; - sourceTree = ""; - }; - 9C88A1C910C7DE310003DF36 /* Debug-iphoneos */ = { - isa = PBXGroup; - children = ( - ); - path = "Debug-iphoneos"; - sourceTree = ""; - }; - 9C88A1CC10C7DE310003DF36 /* Debug-iphonesimulator */ = { - isa = PBXGroup; - children = ( - ); - path = "Debug-iphonesimulator"; - sourceTree = ""; - }; - 9C88A1CF10C7DE310003DF36 /* icons */ = { - isa = PBXGroup; - children = ( - 9C88A1D010C7DE310003DF36 /* bluetooth.png */, - 9C88A1D110C7DE310003DF36 /* computer.png */, - 9C88A1D210C7DE310003DF36 /* keyboard.png */, - 9C88A1D310C7DE310003DF36 /* LICENSE.txt */, - 9C88A1D410C7DE310003DF36 /* smartphone.png */, - ); - path = icons; - sourceTree = ""; - }; - 9C88A1D610C7DE310003DF36 /* include */ = { - isa = PBXGroup; - children = ( - 9C88A1D710C7DE310003DF36 /* BTstack */, - ); - path = include; - sourceTree = ""; - }; - 9C88A1D710C7DE310003DF36 /* BTstack */ = { - isa = PBXGroup; - children = ( - 9C88A1D810C7DE310003DF36 /* BTDevice.h */, - 9C88A1D910C7DE310003DF36 /* BTInquiryViewController.h */, - ); - path = BTstack; - sourceTree = ""; - }; - 9C88A1DA10C7DE310003DF36 /* src */ = { - isa = PBXGroup; - children = ( - 9C88A1DB10C7DE310003DF36 /* BTDevice.m */, - 9C88A1DC10C7DE310003DF36 /* BTInquiryViewController.m */, - 9C88A1DD10C7DE310003DF36 /* BTstackCocoaAppDelegate.h */, - 9C88A1DE10C7DE310003DF36 /* BTstackCocoaAppDelegate.m */, - 9C88A1DF10C7DE310003DF36 /* main.m */, - ); - path = src; - sourceTree = ""; - }; 9CEB4B7510715DC200DD5720 /* include */ = { isa = PBXGroup; children = ( @@ -510,12 +329,6 @@ hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* project */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 9C88A18E10C7DE310003DF36 /* Products */; - ProjectRef = 9C88A18D10C7DE310003DF36 /* BTstackCocoa.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 8DD76FA90486AB0100D96B5E /* BTdaemon */, @@ -524,16 +337,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 9C88A1F410C7DE320003DF36 /* BTstackCocoa.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = BTstackCocoa.app; - remoteRef = 9C88A1F310C7DE320003DF36 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXSourcesBuildPhase section */ 8DD76FAB0486AB0100D96B5E /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -556,6 +359,9 @@ 9CEB4F17107AAAEF00DD5720 /* run_loop_posix.c in Sources */, 9C04B826107D1CED002A63D0 /* run_loop.c in Sources */, 9C04B876107D2B7C002A63D0 /* run_loop_cocoa.m in Sources */, + 9C13C9F710ECECE900B04243 /* mouse.c in Sources */, + 9C13C9FF10ECED6300B04243 /* BTDevice.m in Sources */, + 9C13CA0010ECED6300B04243 /* BTInquiryViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/Makefile.in b/src/Makefile.in index 448f03842..0a7aacf0c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -27,6 +27,7 @@ BTdaemon_SOURCES = $(libBTstack_SOURCES) \ all: libBTstack.$(BTSTACK_LIB_EXTENSION) libBTstack.a BTdaemon libBTstack.$(BTSTACK_LIB_EXTENSION): $(libBTstack_SOURCES) + ./get_version.sh $(CC) $(CPPFLAGS) $(BTSTACK_LIB_LDFLAGS) -o $@ $(libBTstack_SOURCES) $(LDFLAGS) @USE_LDID@ export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate ; ldid -S $@ diff --git a/src/get_version.sh b/src/get_version.sh new file mode 100755 index 000000000..c7b1ea2a6 --- /dev/null +++ b/src/get_version.sh @@ -0,0 +1,13 @@ +#!/bin/sh +FILE=../include/btstack/version.h +REVISION=`svnversion | sed "s/\([0-9]*\).*/\1/"` +MAJOR=0 +MINOR=1 +DATE=`date "+%Y-%m-%d_%H:%M:%S"` +printf "// BTstack - version.h\n" > $FILE +printf "// - generated by %s\n" $0>> $FILE +printf "// - at %s\n" $DATE >> $FILE +printf "#define BTSTACK_MAJOR %u\n" $MAJOR >> $FILE +printf "#define BTSTACK_MINOR %u\n" $MINOR >> $FILE +printf "#define BTSTACK_REVISION %u\n" $REVISION >> $FILE +printf "#define BTSTACK_VERSION \"%u.%u-%u\"\n" $MAJOR $MINOR $REVISION >> $FILE