Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Commit 807b731

Browse files
committed
first commit
0 parents  commit 807b731

36 files changed

+1737
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tmp
2+
bin
3+
build
4+
*.zip

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>TiMultipeer</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.appcelerator.titanium.core.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.aptana.ide.core.unifiedBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>com.appcelerator.titanium.mobile.module.nature</nature>
21+
<nature>com.aptana.projects.webnature</nature>
22+
</natures>
23+
</projectDescription>
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
selectUserAgents=com.appcelerator.titanium.mobile.module.nature\:iphone

CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Place your change log text here. This file will be incorporated with your app at package time.

Classes/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ComHoyostaTimultipeer.h
2+
ComHoyostaTimultipeer.m

Classes/ComHoyostaTimultipeerModule.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Your Copyright Here
3+
*
4+
* Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
5+
* and licensed under the Apache Public License (version 2)
6+
*/
7+
#import "TiModule.h"
8+
9+
@interface ComHoyostaTimultipeerModule : TiModule
10+
{
11+
}
12+
13+
@end

Classes/ComHoyostaTimultipeerModule.m

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/**
2+
* Your Copyright Here
3+
*
4+
* Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc.
5+
* and licensed under the Apache Public License (version 2)
6+
*/
7+
#import "ComHoyostaTimultipeerModule.h"
8+
#import "TiBase.h"
9+
#import "TiHost.h"
10+
#import "TiUtils.h"
11+
12+
@implementation ComHoyostaTimultipeerModule
13+
14+
#pragma mark Internal
15+
16+
// this is generated for your module, please do not change it
17+
-(id)moduleGUID
18+
{
19+
return @"fef5bd17-52bb-4d52-9dd6-cc05c1949596";
20+
}
21+
22+
// this is generated for your module, please do not change it
23+
-(NSString*)moduleId
24+
{
25+
return @"com.hoyosta.timultipeer";
26+
}
27+
28+
#pragma mark Lifecycle
29+
30+
-(void)startup
31+
{
32+
// this method is called when the module is first loaded
33+
// you *must* call the superclass
34+
[super startup];
35+
36+
NSLog(@"[INFO] %@ loaded",self);
37+
}
38+
39+
-(void)shutdown:(id)sender
40+
{
41+
// this method is called when the module is being unloaded
42+
// typically this is during shutdown. make sure you don't do too
43+
// much processing here or the app will be quit forceably
44+
45+
// you *must* call the superclass
46+
[super shutdown:sender];
47+
}
48+
49+
#pragma mark Cleanup
50+
51+
-(void)dealloc
52+
{
53+
// release any resources that have been retained by the module
54+
}
55+
56+
#pragma mark Internal Memory Management
57+
58+
-(void)didReceiveMemoryWarning:(NSNotification*)notification
59+
{
60+
// optionally release any resources that can be dynamically
61+
// reloaded once memory is available - such as caches
62+
[super didReceiveMemoryWarning:notification];
63+
}
64+
65+
#pragma mark Listener Notifications
66+
67+
-(void)_listenerAdded:(NSString *)type count:(int)count
68+
{
69+
if (count == 1 && [type isEqualToString:@"my_event"])
70+
{
71+
// the first (of potentially many) listener is being added
72+
// for event named 'my_event'
73+
}
74+
}
75+
76+
-(void)_listenerRemoved:(NSString *)type count:(int)count
77+
{
78+
if (count == 0 && [type isEqualToString:@"my_event"])
79+
{
80+
// the last listener called for event named 'my_event' has
81+
// been removed, we can optionally clean up any resources
82+
// since no body is listening at this point for that event
83+
}
84+
}
85+
86+
#pragma Public APIs
87+
88+
-(id)example:(id)args
89+
{
90+
// example method
91+
return @"hello world";
92+
}
93+
94+
-(id)exampleProp
95+
{
96+
// example property getter
97+
return @"hello world";
98+
}
99+
100+
-(void)setExampleProp:(id)value
101+
{
102+
// example property setter
103+
}
104+
105+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* This is a generated file. Do not edit or your changes will be lost
3+
*/
4+
5+
@interface ComHoyostaTimultipeerModuleAssets : NSObject
6+
{
7+
}
8+
- (NSData*) moduleAsset;
9+
- (NSData*) resolveModuleAsset:(NSString*)path;
10+
11+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* This is a generated file. Do not edit or your changes will be lost
3+
*/
4+
#import "ComHoyostaTimultipeerModuleAssets.h"
5+
6+
extern NSData* filterDataInRange(NSData* thedata, NSRange range);
7+
8+
@implementation ComHoyostaTimultipeerModuleAssets
9+
10+
- (NSData*) moduleAsset
11+
{
12+
//##TI_AUTOGEN_BEGIN asset
13+
//Compiler generates code for asset here
14+
return nil; // DEFAULT BEHAVIOR
15+
//##TI_AUTOGEN_END asset
16+
}
17+
18+
- (NSData*) resolveModuleAsset:(NSString*)path
19+
{
20+
//##TI_AUTOGEN_BEGIN resolve_asset
21+
//Compiler generates code for asset resolution here
22+
return nil; // DEFAULT BEHAVIOR
23+
//##TI_AUTOGEN_END resolve_asset
24+
}
25+
26+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Appcelerator Titanium Mobile
3+
* Copyright (c) 2009-2014年 by Appcelerator, Inc. All Rights Reserved.
4+
* Licensed under the terms of the Apache Public License
5+
* Please see the LICENSE included with this distribution for details.
6+
*/
7+
#import "TiProxy.h"
8+
#import <MultipeerConnectivity/MCNearbyServiceAdvertiser.h>
9+
#import <MultipeerConnectivity/MCNearbyServiceBrowser.h>
10+
#import <MultipeerConnectivity/MCPeerID.h>
11+
#import <MultipeerConnectivity/MCSession.h>
12+
13+
@interface ComHoyostaTimultipeerSessionProxy : TiProxy
14+
<MCNearbyServiceAdvertiserDelegate, MCNearbyServiceBrowserDelegate, MCSessionDelegate> {
15+
@private
16+
MCNearbyServiceAdvertiser *_advertiser;
17+
MCNearbyServiceBrowser *_browser;
18+
MCPeerID *_peer;
19+
MCSession *_session;
20+
NSMutableDictionary *_connectedPeers;
21+
}
22+
23+
-(id)advertize:(id)args;
24+
-(id)browse:(id)args;
25+
-(id)stop:(id)args;
26+
-(id)sendData:(id)args;
27+
28+
@property (nonatomic, readwrite, assign) NSString *peerName;
29+
@property (nonatomic, readwrite, assign) NSString *serviceType;
30+
31+
@end

0 commit comments

Comments
 (0)