Permalink
Browse files

Updated the GeoLoqiSocket Client file to define the Reachability object.

  • Loading branch information...
1 parent 4347540 commit c2dd9ef0b226327ff369b893d76e1eb141907353 @deepabhan deepabhan committed Sep 16, 2011
Showing with 31 additions and 9 deletions.
  1. +2 −0 Classes/GeoloqiSocketClient.h
  2. +5 −7 Classes/GeoloqiSocketClient.m
  3. +24 −2 MapAttack.xcodeproj/project.pbxproj
@@ -10,6 +10,7 @@
#include "FTLocationSimulator.h"
//#import "Database.h"
#import "sqlite3.h" // Import SQLITE3 header file
+#import "Reachability.h"
@class AsyncUdpSocket;
// class GeoloqiSocketClient extends NSObject implements CLLocationManagerDelegate
@@ -30,6 +31,7 @@
NSTimeInterval trackingFrequency;
NSTimeInterval sendingFrequency;
NSData *uuid;
+ Reachability *reachability;
}
- (void)normalConnect;
@@ -9,7 +9,6 @@
#import "CJSONDeserializer.h"
#import "LQConfig.h"
#import "AsyncUdpSocket.h"
-#import "Reachability.h"
#import "Database.h"
#import "MapAttackAppDelegate.h"
@@ -149,7 +148,6 @@ - (void)locationManager:(CLLocationManager *)manager
// These checks are done against the last saved location (currentLocation)
if (YES || !oldLocation || // first update
([newLocation distanceFromLocation:currentLocation] > distanceFilterDistance && // check min. distance
-<<<<<<< HEAD
[newLocation.timestamp timeIntervalSinceDate:currentLocation.timestamp] > trackingFrequency))
{
// currentLocation is always the point that was last accepted into the queue.
@@ -208,8 +206,8 @@ - (void)locationManager:(CLLocationManager *)manager
NSLog(@"Retrieved location data: %@", raw);
NSLog(@"Sending location data now..");
// Send out data
- [asyncSocket sendData:raw toHost:LQ_SOCKET_HOST
- port:LQ_SOCKET_PORT withTimeout:10.0
+ [asyncSocket sendData:raw toHost:LQ_WRITE_SOCKET_HOST
+ port:LQ_WRITE_SOCKET_PORT withTimeout:10.0
tag:TAG_DEVICE_ID_SENT];
[asyncSocket receiveWithTimeout:30.0 tag:TAG_DEVICE_ID_SENT];
[raw release]; // release the allocated memory
@@ -256,8 +254,8 @@ - (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag
DLog(@"[Write] Accepted packet with timestamp: %u", time);
return YES;
} else {
- if(VERBOSE)
- DLog(@"[Write] packet invalid size: %d", data.length);
+ //if(VERBOSE)
+ // DLog(@"[Write] packet invalid size: %d", data.length);
return NO;
}
}
@@ -295,7 +293,7 @@ - (NSData *)dataFromLocation:(CLLocation *)location {
// DLog(@"Size of packet: %lu", sizeof(LQUpdatePacket));
// DLog(@"Offset of command: %lu", offsetof(LQUpdatePacket, f.command));
// DLog(@"Offset of date: %lu", offsetof(LQUpdatePacket, f.date));
- Dlog(@"The time stamp is %d\n", update.f.date);
+ //Dlog(@"The time stamp is %d\n", update.f.date);
// if(VERBOSE)
DLog(@"[Write] Sending location update %@", [NSData dataWithBytes:update.bytes length:sizeof(update.bytes)]);
@@ -81,6 +81,8 @@
2840D7CE1179279E00D7F93C /* MapView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2840D7CD1179279E00D7F93C /* MapView.xib */; };
288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765070DF74369002DB57D /* CoreGraphics.framework */; };
28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD73870D9D96C1002E5188 /* MainWindow.xib */; };
+ DA4C146D142409A300FFBFDE /* Database.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4C146C142409A300FFBFDE /* Database.m */; };
+ DA67E9CD1424059F00017C46 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DA67E9CC1424059F00017C46 /* libsqlite3.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -204,13 +206,19 @@
28AD73870D9D96C1002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* MapAttack-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapAttack-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+ DA4C146B142409A300FFBFDE /* Database.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Database.h; sourceTree = "<group>"; };
+ DA4C146C142409A300FFBFDE /* Database.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Database.m; sourceTree = "<group>"; };
+ DA67E9C7142403DA00017C46 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ DA67E9CC1424059F00017C46 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ DA67E9CD1424059F00017C46 /* libsqlite3.dylib in Frameworks */,
+ 0FFD5F7C140F3B95008BC18B /* SystemConfiguration.framework in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */,
@@ -220,7 +228,6 @@
0FFD5F39140F392C008BC18B /* MobileCoreServices.framework in Frameworks */,
0FFD5F41140F395F008BC18B /* libz.1.2.3.dylib in Frameworks */,
0FFD5F78140F3B77008BC18B /* libxml2.dylib in Frameworks */,
- 0FFD5F7C140F3B95008BC18B /* SystemConfiguration.framework in Frameworks */,
0F5760211419349800C79B48 /* QuartzCore.framework in Frameworks */,
0F6471B6141BF35400FE7ABE /* AudioToolbox.framework in Frameworks */,
);
@@ -232,6 +239,8 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
+ DA4C146B142409A300FFBFDE /* Database.h */,
+ DA4C146C142409A300FFBFDE /* Database.m */,
0F007B2913FEED6B00057C53 /* MapAttack.h */,
0FFD6028140FDAC2008BC18B /* LQConfig.h */,
0FFD5EC8140F218D008BC18B /* LQClient.h */,
@@ -455,6 +464,8 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ DA67E9CC1424059F00017C46 /* libsqlite3.dylib */,
+ DA67E9C7142403DA00017C46 /* SystemConfiguration.framework */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
288765070DF74369002DB57D /* CoreGraphics.framework */,
@@ -493,6 +504,9 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0410;
+ };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MapAttack" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
@@ -590,6 +604,7 @@
0FFD68581413F3F8008BC18B /* HowToPlay.m in Sources */,
0F78A72B141553E000029E9C /* DebugLog.m in Sources */,
0FDBA6321416F0C200F5C8A5 /* LQPushHandler.m in Sources */,
+ DA4C146D142409A300FFBFDE /* Database.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -600,21 +615,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ CODE_SIGN_IDENTITY = "iPhone Developer: Aaron Parecki (UR6C55S2E6)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MapAttack_Prefix.pch;
INFOPLIST_FILE = "MapAttack-Info.plist";
- OTHER_LDFLAGS = "-licucore";
+ OTHER_LDFLAGS = (
+ "-licucore",
+ "-lxml2",
+ );
PRODUCT_NAME = MapAttack;
+ PROVISIONING_PROFILE = "C00E2949-5BFA-43B4-8B4B-A4A880578555";
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MapAttack_Prefix.pch;

0 comments on commit c2dd9ef

Please sign in to comment.