diff --git a/Classes/.gitignore b/Classes/.gitignore new file mode 100644 index 0000000..9b5610f --- /dev/null +++ b/Classes/.gitignore @@ -0,0 +1,2 @@ +ComSmontgomerieBluetooth.h +ComSmontgomerieBluetooth.m diff --git a/Classes/ComSmontgomerieBluetoothModule.h b/Classes/ComSmontgomerieBluetoothModule.h new file mode 100644 index 0000000..0797ae1 --- /dev/null +++ b/Classes/ComSmontgomerieBluetoothModule.h @@ -0,0 +1,39 @@ +/** + * Your Copyright Here + * + * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc. + * and licensed under the Apache Public License (version 2) + */ +#import "TiModule.h" +#import + +@interface ComSmontgomerieBluetoothModule : TiModule +{ + NSInteger gameState; + NSInteger peerStatus; + + // networking + GKSession *gameSession; + int gameUniqueID; + int gamePacketNumber; + NSString *gamePeerId; + NSDate *lastHeartbeatDate; + + UIAlertView *connectionAlert; +} + +@property(nonatomic) NSInteger gameState; +@property(nonatomic) NSInteger peerStatus; + +@property(nonatomic, retain) GKSession *gameSession; +@property(nonatomic, copy) NSString *gamePeerId; +@property(nonatomic, retain) NSDate *lastHeartbeatDate; +@property(nonatomic, retain) UIAlertView *connectionAlert; + +- (void)invalidateSession:(GKSession *)session; + +- (void)sendNetworkPacket:(GKSession *)session packetID:(int)packetID withData:(void *)data ofLength:(int)length reliable:(BOOL)howtosend; +- (void)startPicker; +- (id)startPicker: (id) args; + +@end diff --git a/Classes/ComSmontgomerieBluetoothModule.m b/Classes/ComSmontgomerieBluetoothModule.m new file mode 100644 index 0000000..cbada12 --- /dev/null +++ b/Classes/ComSmontgomerieBluetoothModule.m @@ -0,0 +1,343 @@ +/** + * Your Copyright Here + * + * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc. + * and licensed under the Apache Public License (version 2) + */ +#import "ComSmontgomerieBluetoothModule.h" +#import "TiBase.h" +#import "TiHost.h" +#import "TiUtils.h" + + +// GameKit Session ID for app +#define kTankSessionID @"gktank" + +#define kMaxTankPacketSize 1024 + +typedef enum { + NETWORK_ACK, // no packet + NETWORK_COINTOSS, // decide who is going to be the server + NETWORK_MOVE_EVENT, // send position + NETWORK_FIRE_EVENT, // send fire + NETWORK_HEARTBEAT // send of entire state at regular intervals +} packetCodes; + +// +// various states the game can get into +// +typedef enum { + kStateStartGame, + kStatePicker, + kStateMultiplayer, + kStateMultiplayerCointoss, + kStateMultiplayerReconnect +} gameStates; + + +@implementation ComSmontgomerieBluetoothModule + +@synthesize peerStatus, gameState; +@synthesize gameSession, gamePeerId, lastHeartbeatDate, connectionAlert; + +#pragma mark Internal + +// this is generated for your module, please do not change it +-(id)moduleGUID +{ + return @"98126e9f-5aed-4d9f-96c0-b1faf3ab7960"; +} + +// this is generated for your module, please do not change it +-(NSString*)moduleId +{ + return @"com.smontgomerie.bluetooth"; +} + +#pragma mark Lifecycle + +-(void)startup +{ + // this method is called when the module is first loaded + // you *must* call the superclass + [super startup]; + + NSLog(@"[INFO] %@ loaded",self); +} + +-(void)shutdown:(id)sender +{ + // this method is called when the module is being unloaded + // typically this is during shutdown. make sure you don't do too + // much processing here or the app will be quit forceably + + // you *must* call the superclass + [super shutdown:sender]; +} + +#pragma mark Cleanup + +-(void)dealloc +{ + self.lastHeartbeatDate = nil; + if(self.connectionAlert.visible) { + [self.connectionAlert dismissWithClickedButtonIndex:-1 animated:NO]; + } + self.connectionAlert = nil; + + // cleanup the session + [self invalidateSession:self.gameSession]; + self.gameSession = nil; + self.gamePeerId = nil; + + // release any resources that have been retained by the module + [super dealloc]; +} + +#pragma mark Internal Memory Management + +-(void)didReceiveMemoryWarning:(NSNotification*)notification +{ + // optionally release any resources that can be dynamically + // reloaded once memory is available - such as caches + [super didReceiveMemoryWarning:notification]; +} + +#pragma mark Listener Notifications + +-(void)_listenerAdded:(NSString *)type count:(int)count +{ + if (count == 1 && [type isEqualToString:@"my_event"]) + { + // the first (of potentially many) listener is being added + // for event named 'my_event' + } +} + +-(void)_listenerRemoved:(NSString *)type count:(int)count +{ + if (count == 0 && [type isEqualToString:@"my_event"]) + { + // the last listener called for event named 'my_event' has + // been removed, we can optionally clean up any resources + // since no body is listening at this point for that event + } +} + +#pragma Public APIs + +-(id)example:(id)args +{ + // example method + return @"hello world"; +} + +-(id)exampleProp +{ + // example property getter + return @"hello world 2"; +} + +-(void)exampleProp:(id)value +{ + // example property setter +} + +#pragma mark - +#pragma mark Peer Picker Related Methods + +-(void)startPicker +{ + [self startPicker: nil]; +} + +-(id)startPicker: (id) args { + NSLog(@"Showing picker.."); + + GKPeerPickerController* picker; + + self.gameState = kStatePicker; // we're going to do Multiplayer! + + picker = [[GKPeerPickerController alloc] init]; // note: picker is released in various picker delegate methods when picker use is done. + picker.delegate = self; + [picker show]; // show the Peer Picker + + return nil; +} + +#pragma mark GKPeerPickerControllerDelegate Methods + +- (void)peerPickerControllerDidCancel:(GKPeerPickerController *)picker { + // Peer Picker automatically dismisses on user cancel. No need to programmatically dismiss. + + // autorelease the picker. + picker.delegate = nil; + [picker autorelease]; + + // invalidate and release game session if one is around. + if(self.gameSession != nil) { + [self invalidateSession:self.gameSession]; + self.gameSession = nil; + } + + // go back to start mode + self.gameState = kStateStartGame; +} + +/* + * Note: No need to implement -peerPickerController:didSelectConnectionType: delegate method since this app does not support multiple connection types. + * - see reference documentation for this delegate method and the GKPeerPickerController's connectionTypesMask property. + */ + +// +// Provide a custom session that has a custom session ID. This is also an opportunity to provide a session with a custom display name. +// +- (GKSession *)peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type { + GKSession *session = [[GKSession alloc] initWithSessionID:kTankSessionID displayName:nil sessionMode:GKSessionModePeer]; + return [session autorelease]; // peer picker retains a reference, so autorelease ours so we don't leak. +} + +- (void)peerPickerController:(GKPeerPickerController *)picker didConnectPeer:(NSString *)peerID toSession:(GKSession *)session { + // Remember the current peer. + self.gamePeerId = peerID; // copy + + // Make sure we have a reference to the game session and it is set up + self.gameSession = session; // retain + self.gameSession.delegate = self; + [self.gameSession setDataReceiveHandler:self withContext:NULL]; + + // Done with the Peer Picker so dismiss it. + [picker dismiss]; + picker.delegate = nil; + [picker autorelease]; + + // Start Multiplayer game by entering a cointoss state to determine who is server/client. + self.gameState = kStateMultiplayerCointoss; +} + +#pragma mark - +#pragma mark Session Related Methods + +// +// invalidate session +// +- (void)invalidateSession:(GKSession *)session { + if(session != nil) { + [session disconnectFromAllPeers]; + session.available = NO; + [session setDataReceiveHandler: nil withContext: NULL]; + session.delegate = nil; + } +} + +#pragma mark Data Send/Receive Methods + +/* + * Getting a data packet. This is the data receive handler method expected by the GKSession. + * We set ourselves as the receive data handler in the -peerPickerController:didConnectPeer:toSession: method. + */ +- (void)receiveData:(NSData *)data fromPeer:(NSString *)peer inSession:(GKSession *)session context:(void *)context { + static int lastPacketTime = -1; + unsigned char *incomingPacket = (unsigned char *)[data bytes]; + int *pIntData = (int *)&incomingPacket[0]; + // + // developer check the network time and make sure packers are in order + // + int packetTime = pIntData[0]; + int packetID = pIntData[1]; + if(packetTime < lastPacketTime && packetID != NETWORK_COINTOSS) { + return; + } + + lastPacketTime = packetTime; + switch( packetID ) { + case NETWORK_COINTOSS: + { + // coin toss to determine roles of the two players +// int coinToss = pIntData[2]; + + + // after 1 second fire method to hide the label + [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(hideGameLabel:) userInfo:nil repeats:NO]; + } + break; + case NETWORK_MOVE_EVENT: + { + + } + break; + case NETWORK_FIRE_EVENT: + { + } + break; + case NETWORK_HEARTBEAT: + { + // update heartbeat timestamp + self.lastHeartbeatDate = [NSDate date]; + + // if we were trying to reconnect, set the state back to multiplayer as the peer is back + if(self.gameState == kStateMultiplayerReconnect) { + if(self.connectionAlert && self.connectionAlert.visible) { + [self.connectionAlert dismissWithClickedButtonIndex:-1 animated:YES]; + } + self.gameState = kStateMultiplayer; + } + } + break; + default: + // error + break; + } +} + +- (void)sendNetworkPacket:(GKSession *)session packetID:(int)packetID withData:(void *)data ofLength:(int)length reliable:(BOOL)howtosend { + // the packet we'll send is resued + static unsigned char networkPacket[kMaxTankPacketSize]; + const unsigned int packetHeaderSize = 2 * sizeof(int); // we have two "ints" for our header + + if(length < (kMaxTankPacketSize - packetHeaderSize)) { // our networkPacket buffer size minus the size of the header info + int *pIntData = (int *)&networkPacket[0]; + // header info + pIntData[0] = gamePacketNumber++; + pIntData[1] = packetID; + // copy data in after the header + memcpy( &networkPacket[packetHeaderSize], data, length ); + + NSData *packet = [NSData dataWithBytes: networkPacket length: (length+8)]; + if(howtosend == YES) { + [session sendData:packet toPeers:[NSArray arrayWithObject:gamePeerId] withDataMode:GKSendDataReliable error:nil]; + } else { + [session sendData:packet toPeers:[NSArray arrayWithObject:gamePeerId] withDataMode:GKSendDataUnreliable error:nil]; + } + } +} + +#pragma mark GKSessionDelegate Methods + +// we've gotten a state change in the session +- (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState:(GKPeerConnectionState)state { + if(self.gameState == kStatePicker) { + return; // only do stuff if we're in multiplayer, otherwise it is probably for Picker + } + + if(state == GKPeerStateDisconnected) { + // We've been disconnected from the other peer. + + // Update user alert or throw alert if it isn't already up + NSString *message = [NSString stringWithFormat:@"Could not reconnect with %@.", [session displayNameForPeer:peerID]]; + if((self.gameState == kStateMultiplayerReconnect) && self.connectionAlert && self.connectionAlert.visible) { + self.connectionAlert.message = message; + } + else { + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Lost Connection" message:message delegate:self cancelButtonTitle:@"End Game" otherButtonTitles:nil]; + self.connectionAlert = alert; + [alert show]; + [alert release]; + } + + // go back to start mode + self.gameState = kStateStartGame; + } +} + +@end diff --git a/Classes/ComSmontgomerieBluetoothModuleAssets.h b/Classes/ComSmontgomerieBluetoothModuleAssets.h new file mode 100644 index 0000000..30e10e3 --- /dev/null +++ b/Classes/ComSmontgomerieBluetoothModuleAssets.h @@ -0,0 +1,9 @@ +/** + * This is a generated file. Do not edit or your changes will be lost + */ + +@interface ComSmontgomerieBluetoothModuleAssets : NSObject +{ +} +- (NSData*) moduleAsset; +@end diff --git a/Classes/ComSmontgomerieBluetoothModuleAssets.m b/Classes/ComSmontgomerieBluetoothModuleAssets.m new file mode 100644 index 0000000..6ed4b8a --- /dev/null +++ b/Classes/ComSmontgomerieBluetoothModuleAssets.m @@ -0,0 +1,15 @@ +/** + * This is a generated file. Do not edit or your changes will be lost + */ +#import "ComSmontgomerieBluetoothModuleAssets.h" + +extern NSData * dataWithHexString (NSString * hexString); + +@implementation ComSmontgomerieBluetoothModuleAssets + +- (NSData*) moduleAsset +{ + return nil; +} + +@end diff --git a/bluetoothmodule.xcodeproj/montgomerie.mode1v3 b/bluetoothmodule.xcodeproj/montgomerie.mode1v3 new file mode 100644 index 0000000..06477db --- /dev/null +++ b/bluetoothmodule.xcodeproj/montgomerie.mode1v3 @@ -0,0 +1,1406 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 2FC39E981263CBCC002B57B1 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + + Content + + PBXProjectModuleGUID + 2FA98DE8127CDB940004B5DF + PBXProjectModuleLabel + titanium.xcconfig + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 2FA98DE9127CDB940004B5DF + PBXProjectModuleLabel + titanium.xcconfig + _historyCapacity + 0 + bookmark + 2FA98EAD127CFE240004B5DF + history + + 2FA98DE7127CDB870004B5DF + + + SplitCount + 1 + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {1015, 595}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 15 137 1015 636 0 0 1280 778 + + + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 610}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 628}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 1 107 1280 669 0 0 1280 778 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + ComSmontgomerieBluetoothModule.m + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + ComSmontgomerieBluetoothModule.m + _historyCapacity + 0 + bookmark + 2FA98EAC127CFE240004B5DF + history + + 2FA98E98127CFD660004B5DF + 2FA98E99127CFD660004B5DF + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1072, 322}} + RubberWindowFrame + 1 107 1280 669 0 0 1280 778 + + Module + PBXNavigatorGroup + Proportion + 322pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 327}, {1072, 301}} + RubberWindowFrame + 1 107 1280 669 0 0 1280 778 + + Module + XCDetailModule + Proportion + 301pt + + + Proportion + 1072pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 2FA98DE2127CDB580004B5DF + 1CE0B1FE06471DED0097A5F4 + 2FA98DE3127CDB580004B5DF + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 1C78EAAD065D492600B07095 + 2FC39E901263CB96002B57B1 + 2FA98DE8127CDB940004B5DF + /Users/montgomerie/iPhoneDev/BluetoothModule/BluetoothModule.xcodeproj + + WindowString + 1 107 1280 669 0 0 1280 778 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + ComSmontgomerieBluetoothModule.m + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {800, 203}} + RubberWindowFrame + 309 182 800 485 0 0 1280 778 + + Module + PBXNavigatorGroup + Proportion + 203pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 208}, {800, 236}} + RubberWindowFrame + 309 182 800 485 0 0 1280 778 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 444pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 2FC39E901263CB96002B57B1 + 2FA98DE4127CDB580004B5DF + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 309 182 800 485 0 0 1280 778 + WindowToolGUID + 2FC39E901263CB96002B57B1 + WindowToolIsVisible + + + + Identifier + windowTool.debugger + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {317, 164}} + {{317, 0}, {377, 164}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 164}} + {{0, 164}, {694, 216}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleDrawerSize + {100, 120} + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 380}} + RubberWindowFrame + 321 238 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 100% + + + Proportion + 100% + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CD10A99069EF8BA00B06720 + 1C0AD2AB069F1E9B00FABCE6 + 1C162984064C10D400B95A72 + 1C0AD2AC069F1E9B00FABCE6 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 321 238 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + 0 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.find + IsVertical + + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {781, 212}} + RubberWindowFrame + 36 280 781 470 0 0 1280 778 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 212pt + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{0, 217}, {781, 212}} + RubberWindowFrame + 36 280 781 470 0 0 1280 778 + + Module + PBXProjectFindModule + Proportion + 212pt + + + Proportion + 429pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + + TableOfContents + + 1C530D57069F1CE1000CFCEE + 2FAEC3A912641C7900175EBB + 2FAEC3AA12641C7900175EBB + 1CDD528C0622207200134675 + 1CD0528E0623707200166675 + + WindowString + 36 280 781 470 0 0 1280 778 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + + + + Identifier + MENUSEPARATOR + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debuggerConsole + IsVertical + + Layout + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 209}} + RubberWindowFrame + 21 505 650 250 0 0 1280 778 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + + TableOfContents + + 1C78EAAD065D492600B07095 + 2FA98E18127CE0F70004B5DF + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 21 505 650 250 0 0 1280 778 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/bluetoothmodule.xcodeproj/montgomerie.pbxuser b/bluetoothmodule.xcodeproj/montgomerie.pbxuser new file mode 100644 index 0000000..bef88c5 --- /dev/null +++ b/bluetoothmodule.xcodeproj/montgomerie.pbxuser @@ -0,0 +1,296 @@ +// !$*UTF8*$! +{ + 0867D690FE84028FC02AAC07 /* Project object */ = { + activeBuildConfigurationName = Debug; + activeTarget = D2AAC07D0554694100DB518D /* bluetoothmodule */; + codeSenseManager = 2FA98DE6127CDB580004B5DF /* Code sense */; + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 22, + 300, + 721, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXExecutablesDataSource_ActiveFlagID, + PBXExecutablesDataSource_NameID, + PBXExecutablesDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 833, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 793, + 60, + 20, + 48.16259765625, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 310172489; + PBXWorkspaceStateSaveDate = 310172489; + }; + perUserProjectItems = { + 2FA98DE7127CDB870004B5DF /* PBXBookmark */ = 2FA98DE7127CDB870004B5DF /* PBXBookmark */; + 2FA98DEA127CDB940004B5DF /* PBXTextBookmark */ = 2FA98DEA127CDB940004B5DF /* PBXTextBookmark */; + 2FA98DED127CDD4E0004B5DF /* PBXTextBookmark */ = 2FA98DED127CDD4E0004B5DF /* PBXTextBookmark */; + 2FA98DEE127CDD4E0004B5DF /* PBXTextBookmark */ = 2FA98DEE127CDD4E0004B5DF /* PBXTextBookmark */; + 2FA98DEF127CDD4E0004B5DF /* PBXTextBookmark */ = 2FA98DEF127CDD4E0004B5DF /* PBXTextBookmark */; + 2FA98E86127CFCB20004B5DF /* XCBuildMessageTextBookmark */ = 2FA98E86127CFCB20004B5DF /* XCBuildMessageTextBookmark */; + 2FA98E87127CFCB20004B5DF /* PBXTextBookmark */ = 2FA98E87127CFCB20004B5DF /* PBXTextBookmark */; + 2FA98E8A127CFCDE0004B5DF /* PBXTextBookmark */ = 2FA98E8A127CFCDE0004B5DF /* PBXTextBookmark */; + 2FA98E8B127CFCDE0004B5DF /* PBXTextBookmark */ = 2FA98E8B127CFCDE0004B5DF /* PBXTextBookmark */; + 2FA98E8C127CFCDE0004B5DF /* PBXTextBookmark */ = 2FA98E8C127CFCDE0004B5DF /* PBXTextBookmark */; + 2FA98E8D127CFCDE0004B5DF /* PBXTextBookmark */ = 2FA98E8D127CFCDE0004B5DF /* PBXTextBookmark */; + 2FA98E98127CFD660004B5DF /* PBXTextBookmark */ = 2FA98E98127CFD660004B5DF /* PBXTextBookmark */; + 2FA98E99127CFD660004B5DF /* PBXTextBookmark */ = 2FA98E99127CFD660004B5DF /* PBXTextBookmark */; + 2FA98E9A127CFD660004B5DF /* PBXTextBookmark */ = 2FA98E9A127CFD660004B5DF /* PBXTextBookmark */; + 2FA98E9B127CFD660004B5DF /* PBXTextBookmark */ = 2FA98E9B127CFD660004B5DF /* PBXTextBookmark */; + 2FA98EAC127CFE240004B5DF /* PBXTextBookmark */ = 2FA98EAC127CFE240004B5DF /* PBXTextBookmark */; + 2FA98EAD127CFE240004B5DF /* PBXTextBookmark */ = 2FA98EAD127CFE240004B5DF /* PBXTextBookmark */; + }; + sourceControlManager = 2FA98DE5127CDB580004B5DF /* Source Control */; + userBuildSettings = { + }; + }; + 24416B8111C4CA220047AFDD /* Build & Test */ = { + activeExec = 0; + }; + 24DD6CF71134B3F500162E58 /* ComSmontgomerieBluetoothModule.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1011, 520}}"; + sepNavSelRange = "{1100, 0}"; + sepNavVisRange = "{409, 718}"; + }; + }; + 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1011, 4628}}"; + sepNavSelRange = "{3696, 0}"; + sepNavVisRange = "{3207, 546}"; + }; + }; + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {956, 564}}"; + sepNavSelRange = "{228, 0}"; + sepNavVisRange = "{0, 485}"; + }; + }; + 2FA98DE5127CDB580004B5DF /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 2FA98DE6127CDB580004B5DF /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 2FA98DE7127CDB870004B5DF /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + }; + 2FA98DEA127CDB940004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + name = "titanium.xcconfig: 13"; + rLen = 0; + rLoc = 228; + rType = 0; + vrLen = 485; + vrLoc = 0; + }; + 2FA98DED127CDD4E0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 317; + vrLoc = 0; + }; + 2FA98DEE127CDD4E0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 17"; + rLen = 0; + rLoc = 1080; + rType = 0; + vrLen = 235; + vrLoc = 2022; + }; + 2FA98DEF127CDD4E0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + name = "titanium.xcconfig: 13"; + rLen = 0; + rLoc = 228; + rType = 0; + vrLen = 485; + vrLoc = 0; + }; + 2FA98E86127CFCB20004B5DF /* XCBuildMessageTextBookmark */ = { + isa = PBXTextBookmark; + comments = "Unused variable 'coinToss'"; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + fallbackIsa = XCBuildMessageTextBookmark; + rLen = 1; + rLoc = 256; + rType = 1; + }; + 2FA98E87127CFCB20004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 242"; + rLen = 0; + rLoc = 6730; + rType = 0; + vrLen = 427; + vrLoc = 6552; + }; + 2FA98E8A127CFCDE0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF71134B3F500162E58 /* ComSmontgomerieBluetoothModule.h */; + name = "ComSmontgomerieBluetoothModule.h: 37"; + rLen = 0; + rLoc = 1124; + rType = 0; + vrLen = 719; + vrLoc = 409; + }; + 2FA98E8B127CFCDE0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 149"; + rLen = 29; + rLoc = 3314; + rType = 0; + vrLen = 330; + vrLoc = 2998; + }; + 2FA98E8C127CFCDE0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 151"; + rLen = 0; + rLoc = 3310; + rType = 0; + vrLen = 512; + vrLoc = 3142; + }; + 2FA98E8D127CFCDE0004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + name = "titanium.xcconfig: 13"; + rLen = 0; + rLoc = 228; + rType = 0; + vrLen = 485; + vrLoc = 0; + }; + 2FA98E98127CFD660004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF71134B3F500162E58 /* ComSmontgomerieBluetoothModule.h */; + name = "ComSmontgomerieBluetoothModule.h: 37"; + rLen = 0; + rLoc = 1100; + rType = 0; + vrLen = 718; + vrLoc = 409; + }; + 2FA98E99127CFD660004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 154"; + rLen = 0; + rLoc = 3318; + rType = 0; + vrLen = 364; + vrLoc = 3086; + }; + 2FA98E9A127CFD660004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 167"; + rLen = 0; + rLoc = 3829; + rType = 0; + vrLen = 669; + vrLoc = 3206; + }; + 2FA98E9B127CFD660004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + name = "titanium.xcconfig: 13"; + rLen = 0; + rLoc = 228; + rType = 0; + vrLen = 485; + vrLoc = 0; + }; + 2FA98EAC127CFE240004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; + name = "ComSmontgomerieBluetoothModule.m: 165"; + rLen = 0; + rLoc = 3696; + rType = 0; + vrLen = 546; + vrLoc = 3207; + }; + 2FA98EAD127CFE240004B5DF /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + name = "titanium.xcconfig: 13"; + rLen = 0; + rLoc = 228; + rType = 0; + vrLen = 485; + vrLoc = 0; + }; + D2AAC07D0554694100DB518D /* bluetoothmodule */ = { + activeExec = 0; + }; +} diff --git a/bluetoothmodule.xcodeproj/project.pbxproj b/bluetoothmodule.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b342648 --- /dev/null +++ b/bluetoothmodule.xcodeproj/project.pbxproj @@ -0,0 +1,328 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXAggregateTarget section */ + 24416B8111C4CA220047AFDD /* Build & Test */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */; + buildPhases = ( + 24416B8011C4CA220047AFDD /* ShellScript */, + ); + dependencies = ( + 24416B8511C4CA280047AFDD /* PBXTargetDependency */, + ); + name = "Build & Test"; + productName = "Build & test"; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 24DD6CF91134B3F500162E58 /* ComSmontgomerieBluetoothModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DD6CF71134B3F500162E58 /* ComSmontgomerieBluetoothModule.h */; }; + 24DD6CFA1134B3F500162E58 /* ComSmontgomerieBluetoothModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */; }; + 24DE9E1111C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DE9E0F11C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.h */; }; + 24DE9E1211C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DE9E1011C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.m */; }; + AA747D9F0F9514B9006C5449 /* ComSmontgomerieBluetooth_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* ComSmontgomerieBluetooth_Prefix.pch */; }; + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = bluetoothmodule; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 24DD6CF71134B3F500162E58 /* ComSmontgomerieBluetoothModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ComSmontgomerieBluetoothModule.h; path = Classes/ComSmontgomerieBluetoothModule.h; sourceTree = ""; }; + 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ComSmontgomerieBluetoothModule.m; path = Classes/ComSmontgomerieBluetoothModule.m; sourceTree = ""; }; + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = titanium.xcconfig; sourceTree = ""; }; + 24DE9E0F11C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ComSmontgomerieBluetoothModuleAssets.h; path = Classes/ComSmontgomerieBluetoothModuleAssets.h; sourceTree = ""; }; + 24DE9E1011C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ComSmontgomerieBluetoothModuleAssets.m; path = Classes/ComSmontgomerieBluetoothModuleAssets.m; sourceTree = ""; }; + AA747D9E0F9514B9006C5449 /* ComSmontgomerieBluetooth_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComSmontgomerieBluetooth_Prefix.pch; sourceTree = SOURCE_ROOT; }; + AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + D2AAC07E0554694100DB518D /* libComSmontgomerieBluetooth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libComSmontgomerieBluetooth.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D2AAC07C0554694100DB518D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DFFF38A50411DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC07E0554694100DB518D /* libComSmontgomerieBluetooth.a */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* bluetoothmodule */ = { + isa = PBXGroup; + children = ( + 08FB77AEFE84172EC02AAC07 /* Classes */, + 32C88DFF0371C24200C91783 /* Other Sources */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, + 034768DFFF38A50411DB9C8B /* Products */, + ); + name = bluetoothmodule; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + AACBBE490F95108600F1A2B1 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 08FB77AEFE84172EC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + 24DE9E0F11C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.h */, + 24DE9E1011C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.m */, + 24DD6CF71134B3F500162E58 /* ComSmontgomerieBluetoothModule.h */, + 24DD6CF81134B3F500162E58 /* ComSmontgomerieBluetoothModule.m */, + ); + name = Classes; + sourceTree = ""; + }; + 32C88DFF0371C24200C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + AA747D9E0F9514B9006C5449 /* ComSmontgomerieBluetooth_Prefix.pch */, + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */, + ); + name = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC07A0554694100DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + AA747D9F0F9514B9006C5449 /* ComSmontgomerieBluetooth_Prefix.pch in Headers */, + 24DD6CF91134B3F500162E58 /* ComSmontgomerieBluetoothModule.h in Headers */, + 24DE9E1111C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC07D0554694100DB518D /* bluetoothmodule */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "bluetoothmodule" */; + buildPhases = ( + D2AAC07A0554694100DB518D /* Headers */, + D2AAC07B0554694100DB518D /* Sources */, + D2AAC07C0554694100DB518D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = bluetoothmodule; + productName = bluetoothmodule; + productReference = D2AAC07E0554694100DB518D /* libComSmontgomerieBluetooth.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "BluetoothModule" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 0867D691FE84028FC02AAC07 /* bluetoothmodule */; + productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D2AAC07D0554694100DB518D /* bluetoothmodule */, + 24416B8111C4CA220047AFDD /* Build & Test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 24416B8011C4CA220047AFDD /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# shell script goes here\n\npython \"${TITANIUM_SDK}/titanium.py\" run --dir=\"${PROJECT_DIR}\"\nexit $?\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC07B0554694100DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 24DD6CFA1134B3F500162E58 /* ComSmontgomerieBluetoothModule.m in Sources */, + 24DE9E1211C5FE74003F90F6 /* ComSmontgomerieBluetoothModuleAssets.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 24416B8511C4CA280047AFDD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2AAC07D0554694100DB518D /* bluetoothmodule */; + targetProxy = 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB921F08733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + DSTROOT = /tmp/ComSmontgomerieBluetooth.dst; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ComSmontgomerieBluetooth_Prefix.pch; + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = ComSmontgomerieBluetooth; + }; + name = Debug; + }; + 1DEB922008733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + DSTROOT = /tmp/ComSmontgomerieBluetooth.dst; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ComSmontgomerieBluetooth_Prefix.pch; + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = ComSmontgomerieBluetooth; + }; + name = Release; + }; + 1DEB922308733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_LDFLAGS = ""; + PREBINDING = NO; + SDKROOT = iphoneos4.1; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_LDFLAGS = ""; + PREBINDING = NO; + SDKROOT = iphoneos4.0; + }; + name = Release; + }; + 24416B8211C4CA220047AFDD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = "Build & test"; + }; + name = Debug; + }; + 24416B8311C4CA220047AFDD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + PRODUCT_NAME = "Build & test"; + ZERO_LINK = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "bluetoothmodule" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB921F08733DC00010E9CD /* Debug */, + 1DEB922008733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "BluetoothModule" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB922308733DC00010E9CD /* Debug */, + 1DEB922408733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24416B8211C4CA220047AFDD /* Debug */, + 24416B8311C4CA220047AFDD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff --git a/build.py b/build.py new file mode 100755 index 0000000..78fc343 --- /dev/null +++ b/build.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python +# +# Appcelerator Titanium Module Packager +# +# +import os, sys, glob +import zipfile + +cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) +required_module_keys = ['name','version','moduleid','description','copyright','license','copyright','platform','minsdk'] +module_defaults = { + 'description':'My module', + 'author': 'Your Name', + 'license' : 'Specify your license', + 'copyright' : 'Copyright (c) 2010 by Your Company', +} +module_license_default = "TODO: place your license here and we'll include it in the module distribution" + +def replace_vars(config,token): + idx = token.find('$(') + while idx != -1: + idx2 = token.find(')',idx+2) + if idx2 == -1: break + key = token[idx+2:idx2] + if not config.has_key(key): break + token = token.replace('$(%s)' % key, config[key]) + idx = token.find('$(') + return token + + +def read_ti_xcconfig(): + contents = open(os.path.join(cwd,'titanium.xcconfig')).read() + config = {} + for line in contents.splitlines(False): + line = line.strip() + if line[0:2]=='//': continue + idx = line.find('=') + if idx > 0: + key = line[0:idx].strip() + value = line[idx+1:].strip() + config[key] = replace_vars(config,value) + return config + +def generate_doc(config): + docfile = os.path.join(cwd,'documentation','index.md') + if not os.path.exists(docfile): + print "Couldn't find documentation file at: %s" % docfile + return None + sdk = config['TITANIUM_SDK'] + support_dir = os.path.join(sdk,'module','support') + sys.path.append(support_dir) + import markdown2 + html_md = open(docfile).read() + return markdown2.markdown(html_md) + +def compile_js(manifest,config): + js_file = os.path.join(cwd,'assets','com.smontgomerie.bluetooth.js') + if not os.path.exists(js_file): return + + sdk = config['TITANIUM_SDK'] + iphone_dir = os.path.join(sdk,'iphone') + sys.path.insert(0,iphone_dir) + from compiler import Compiler + + path = os.path.basename(js_file) + metadata = Compiler.make_function_from_file(path,js_file) + method = metadata['method'] + eq = path.replace('.','_') + method = ' return %s;' % method + + f = os.path.join(cwd,'Classes','ComSmontgomerieBluetoothModuleAssets.m') + c = open(f).read() + idx = c.find('return ') + before = c[0:idx] + after = """ +} + +@end + """ + newc = before + method + after + + if newc!=c: + x = open(f,'w') + x.write(newc) + x.close() + +def die(msg): + print msg + sys.exit(1) + +def warn(msg): + print "[WARN] %s" % msg + +def validate_license(): + c = open('LICENSE').read() + if c.find(module_license_default)!=1: + warn('please update the LICENSE file with your license text before distributing') + +def validate_manifest(): + path = os.path.join(cwd,'manifest') + f = open(path) + if not os.path.exists(path): die("missing %s" % path) + manifest = {} + for line in f.readlines(): + line = line.strip() + if line[0:1]=='#': continue + if line.find(':') < 0: continue + key,value = line.split(':') + manifest[key.strip()]=value.strip() + for key in required_module_keys: + if not manifest.has_key(key): die("missing required manifest key '%s'" % key) + if module_defaults.has_key(key): + defvalue = module_defaults[key] + curvalue = manifest[key] + if curvalue==defvalue: warn("please update the manifest key: '%s' to a non-default value" % key) + return manifest,path + +ignoreFiles = ['.DS_Store','.gitignore','libTitanium.a','titanium.jar','README','com.smontgomerie.bluetooth.js'] +ignoreDirs = ['.DS_Store','.svn','.git','CVSROOT'] + +def zip_dir(zf,dir,basepath,ignore=[]): + for root, dirs, files in os.walk(dir): + for name in ignoreDirs: + if name in dirs: + dirs.remove(name) # don't visit ignored directories + for file in files: + if file in ignoreFiles: continue + e = os.path.splitext(file) + if len(e)==2 and e[1]=='.pyc':continue + from_ = os.path.join(root, file) + to_ = from_.replace(dir, basepath, 1) + zf.write(from_, to_) + +def glob_libfiles(): + files = [] + for libfile in glob.glob('build/**/*.a'): + if libfile.find('Release-')!=-1: + files.append(libfile) + return files + +def build_module(manifest,config): + rc = os.system("xcodebuild -sdk iphoneos -configuration Release") + if rc != 0: + die("xcodebuild failed") + rc = os.system("xcodebuild -sdk iphonesimulator -configuration Release") + if rc != 0: + die("xcodebuild failed") + # build the merged library using lipo + moduleid = manifest['moduleid'] + libpaths = '' + for libfile in glob_libfiles(): + libpaths+='%s ' % libfile + + os.system("lipo %s -create -output build/lib%s.a" %(libpaths,moduleid)) + +def package_module(manifest,mf,config): + name = manifest['name'].lower() + moduleid = manifest['moduleid'].lower() + version = manifest['version'] + modulezip = '%s-iphone-%s.zip' % (moduleid,version) + if os.path.exists(modulezip): os.remove(modulezip) + zf = zipfile.ZipFile(modulezip, 'w', zipfile.ZIP_DEFLATED) + modulepath = 'modules/iphone/%s/%s' % (moduleid,version) + zf.write(mf,'%s/manifest' % modulepath) + libname = 'lib%s.a' % moduleid + zf.write('build/%s' % libname, '%s/%s' % (modulepath,libname)) + html = generate_doc(config) + if html!=None: + zf.writestr('%s/documentation/index.html'%modulepath,html) + for dn in ('assets','example'): + if os.path.exists(dn): + zip_dir(zf,dn,'%s/%s' % (modulepath,dn),['README']) + zf.write('LICENSE','%s/LICENSE' % modulepath) + zf.write('module.xcconfig','%s/module.xcconfig' % modulepath) + zf.close() + + +if __name__ == '__main__': + manifest,mf = validate_manifest() + validate_license() + config = read_ti_xcconfig() + compile_js(manifest,config) + build_module(manifest,config) + package_module(manifest,mf,config) + sys.exit(0) + diff --git a/documentation/index.md b/documentation/index.md new file mode 100644 index 0000000..9ec091e --- /dev/null +++ b/documentation/index.md @@ -0,0 +1,39 @@ +# bluetoothmodule Module + +## Description + +TODO: Enter your module description here + +## Accessing the bluetoothmodule Module + +To access this module from JavaScript, you would do the following: + + var bluetoothmodule = require("com.smontgomerie.bluetooth"); + +The bluetoothmodule variable is a reference to the Module object. + +## Reference + +TODO: If your module has an API, you should document +the reference here. + +### ___PROJECTNAMEASIDENTIFIER__.function + +TODO: This is an example of a module function. + +### ___PROJECTNAMEASIDENTIFIER__.property + +TODO: This is an example of a module property. + +## Usage + +TODO: Enter your usage example here + +## Author + +TODO: Enter your author name, email and other contact +details you want to share here. + +## License + +TODO: Enter your license/legal information here. diff --git a/example/app.js b/example/app.js new file mode 100644 index 0000000..dcaa087 --- /dev/null +++ b/example/app.js @@ -0,0 +1,16 @@ +// This is a test harness for your module +// You should do something interesting in this harness +// to test out the module and to provide instructions +// to users on how to use it by example. + + +// open a single window +var window = Ti.UI.createWindow({ + backgroundColor:'white' +}); +window.open(); + +// TODO: write your module tests here +var bluetoothmodule = require('com.smontgomerie.bluetooth'); +Ti.API.info("module is => "+bluetoothmodule); + diff --git a/hooks/README b/hooks/README new file mode 100644 index 0000000..66b10a8 --- /dev/null +++ b/hooks/README @@ -0,0 +1 @@ +These files are not yet supported as of 1.4.0 but will be in a near future release. diff --git a/hooks/add.py b/hooks/add.py new file mode 100644 index 0000000..04e1c1d --- /dev/null +++ b/hooks/add.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# +# This is the module project add hook that will be +# called when your module is added to a project +# +import os, sys + +def dequote(s): + if s[0:1] == '"': + return s[1:-1] + return s + +def main(args,argc): + # You will get the following command line arguments + # in the following order: + # + # project_dir = the full path to the project root directory + # project_type = the type of project (desktop, mobile, ipad) + # project_name = the name of the project + # + project_dir = dequote(os.path.expanduser(args[1])) + project_type = dequote(args[2]) + project_name = dequote(args[3]) + + # TODO: write your add hook here (optional) + + + # exit + sys.exit(0) + + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/hooks/install.py b/hooks/install.py new file mode 100644 index 0000000..b423fe9 --- /dev/null +++ b/hooks/install.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# +# This is the module install hook that will be +# called when your module is first installed +# +import os, sys + +def main(args,argc): + + # TODO: write your install hook here (optional) + + # exit + sys.exit(0) + + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/hooks/remove.py b/hooks/remove.py new file mode 100644 index 0000000..f92a234 --- /dev/null +++ b/hooks/remove.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# +# This is the module project remove hook that will be +# called when your module is remove from a project +# +import os, sys + +def dequote(s): + if s[0:1] == '"': + return s[1:-1] + return s + +def main(args,argc): + # You will get the following command line arguments + # in the following order: + # + # project_dir = the full path to the project root directory + # project_type = the type of project (desktop, mobile, ipad) + # project_name = the name of the project + # + project_dir = dequote(os.path.expanduser(args[1])) + project_type = dequote(args[2]) + project_name = dequote(args[3]) + + # TODO: write your remove hook here (optional) + + # exit + sys.exit(0) + + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/hooks/uninstall.py b/hooks/uninstall.py new file mode 100644 index 0000000..a7ffd91 --- /dev/null +++ b/hooks/uninstall.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# +# This is the module uninstall hook that will be +# called when your module is uninstalled +# +import os, sys + +def main(args,argc): + + # TODO: write your uninstall hook here (optional) + + # exit + sys.exit(0) + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/manifest b/manifest new file mode 100644 index 0000000..72ba58e --- /dev/null +++ b/manifest @@ -0,0 +1,17 @@ +# +# this is your module manifest and used by Titanium +# during compilation, packaging, distribution, etc. +# +version: 0.1 +description: My module +author: Your Name +license: Specify your license +copyright: Copyright (c) 2010 by Your Company + + +# these should not be edited +name: bluetoothmodule +moduleid: com.smontgomerie.bluetooth +guid: 98126e9f-5aed-4d9f-96c0-b1faf3ab7960 +platform: iphone +minsdk: 1.4.0 diff --git a/module.xcconfig b/module.xcconfig new file mode 100644 index 0000000..80ca884 --- /dev/null +++ b/module.xcconfig @@ -0,0 +1,27 @@ +// +// PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE +// PICKED UP DURING THE APP BUILD FOR YOUR MODULE +// +// see the following webpage for instructions on the settings +// for this file: +// http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html +// + +// +// How to add a Framework (example) +// +// OTHER_LDFLAGS=$(inherited) -framework Foo +// +// Adding a framework for a specific version(s) of iPhone: +// +// OTHER_LDFLAGS[sdk=iphoneos4*]=$(inherited) -framework Foo +// OTHER_LDFLAGS[sdk=iphonesimulator4*]=$(inherited) -framework Foo +// +// +// How to add a compiler define: +// +// OTHER_CFLAGS=$(inherited) -DFOO=1 +// +// +// IMPORTANT NOTE: always use $(inherited) in your overrides +// diff --git a/titanium.xcconfig b/titanium.xcconfig new file mode 100644 index 0000000..cb28031 --- /dev/null +++ b/titanium.xcconfig @@ -0,0 +1,19 @@ +// +// +// CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT) +// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR +// +// +TITANIUM_SDK_VERSION = 1.4.0 + + +// +// THESE SHOULD BE OK GENERALLY AS-IS +// +TITANIUM_SDK = ${HOME}/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) +TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" +TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" +HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2) + + +