This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)pushBeaconInfo | |
{ | |
for (int i = 0; i < self.beaconsArray.count; i++) { | |
NSString *beaconMajorString = [((ESTBeacon *) self.beaconsArray[i]).major stringValue]; | |
NSString *beaconMinorString = [((ESTBeacon *) self.beaconsArray[i]).minor stringValue]; | |
NSNumber *beacondist = ((ESTBeacon *) self.beaconsArray[i]).distance; | |
// Beacon Major | |
((UILabel *) self.majorArray[i]).text = beaconMajorString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)beaconManager:(ESTBeaconManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region | |
{ | |
self.beaconsArray = beacons; | |
[self pushBeaconInfo]; | |
} | |
- (void)beaconManager:(ESTBeaconManager *)manager didDiscoverBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region | |
{ | |
self.beaconsArray = beacons; | |
[self pushBeaconInfo]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
self.beaconManager = [[ESTBeaconManager alloc] init]; | |
self.beaconManager.delegate = self; | |
self.region = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID identifier:@"EstimoteSampleRegion"]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ETViewController : UIViewController | |
@property (nonatomic, copy) void (^completion)(ESTBeacon *); | |
@property (nonatomic, assign) ESTScanType scanType; | |
@property (nonatomic, strong) ESTBeaconManager *beaconManager; | |
@property (nonatomic, strong) ESTBeaconRegion *region; | |
@property (strong, nonatomic) NSArray *beaconsArray; | |
@property (strong, nonatomic) IBOutlet UILabel *messageLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithScanType:(ESTScanType)scanType completion:(void (^)(ESTBeacon *))completion | |
{ | |
self = [super init]; | |
if (self) { | |
self.scanType = scanType; | |
self.completion = [completion copy]; | |
} | |
return self; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ETViewController.h" | |
@interface ETViewController () <ESTBeaconManagerDelegate> | |
@end | |
@implementation ETViewController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import <ESTBeaconManager.h> | |
#import <ESTBeacon.h> | |
typedef enum : int | |
{ | |
ESTScanTypeBlueTooth, | |
ESTScanTypeBeacon | |
} ESTScanType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment this line to define a global platform for your project | |
target "EstimoteTutorial" do | |
platform :ios, '7.0' | |
pod 'EstimoteSDK', '~> 1.3.0' | |
end | |
target "EstimoteTutorialTests" do | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> pod init | |
> vim Podfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.net.*; | |
public class MyEchoClient { | |
public static void main(String args[]) { | |
try { | |
Socket sock = new Socket("127.0.0.1" , 10007); | |
InputStream in = sock.getInputStream(); | |
OutputStream out = sock.getOutputStream(); | |
String str = "hello\n"; |