Skip to content

Commit c2f7a63

Browse files
committed
Fixing upgrade conflicts.
1 parent 174d4d2 commit c2f7a63

File tree

11 files changed

+114
-46
lines changed

11 files changed

+114
-46
lines changed

BLEMingleiOS.xcodeproj/project.pbxproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 48;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -151,7 +151,7 @@
151151
};
152152
};
153153
buildConfigurationList = C6B537C117B77E7B70CDEF0C /* Build configuration list for PBXProject "BLEMingleiOS" */;
154-
compatibilityVersion = "Xcode 3.2";
154+
compatibilityVersion = "Xcode 8.0";
155155
developmentRegion = English;
156156
hasScannedForEncodings = 0;
157157
knownRegions = (
@@ -290,15 +290,18 @@
290290
isa = XCBuildConfiguration;
291291
buildSettings = {
292292
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
293+
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
293294
CODE_SIGN_IDENTITY = "iPhone Developer";
294295
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
295296
DEVELOPMENT_TEAM = J26D86F62R;
296297
INFOPLIST_FILE = BLEMingleiOS/Info.plist;
298+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
297299
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
298-
PRODUCT_BUNDLE_IDENTIFIER = iOS.BLEChatiOS;
300+
PRODUCT_BUNDLE_IDENTIFIER = BLEMingle;
299301
PRODUCT_NAME = "$(TARGET_NAME)";
300302
PROVISIONING_PROFILE = "";
301303
SWIFT_VERSION = 3.0;
304+
TARGETED_DEVICE_FAMILY = 1;
302305
};
303306
name = Release;
304307
};
@@ -346,15 +349,18 @@
346349
isa = XCBuildConfiguration;
347350
buildSettings = {
348351
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
352+
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
349353
CODE_SIGN_IDENTITY = "iPhone Developer";
350354
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
351355
DEVELOPMENT_TEAM = J26D86F62R;
352356
INFOPLIST_FILE = BLEMingleiOS/Info.plist;
357+
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
353358
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
354-
PRODUCT_BUNDLE_IDENTIFIER = iOS.BLEChatiOS;
359+
PRODUCT_BUNDLE_IDENTIFIER = BLEMingle;
355360
PRODUCT_NAME = "$(TARGET_NAME)";
356361
PROVISIONING_PROFILE = "";
357362
SWIFT_VERSION = 3.0;
363+
TARGETED_DEVICE_FAMILY = 1;
358364
};
359365
name = Debug;
360366
};

BLEMingleiOS/BLEMingle.swift

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -258,47 +258,38 @@ class BLEMingle: NSObject, CBPeripheralManagerDelegate, CBCentralManagerDelegate
258258
startAdvertisingToPeripheral()
259259
}
260260

261-
func sendPart() {
262-
var piece:String = datastring
263-
peripheralManager.stopAdvertising()
264-
let bingo = piece.characters.count
265-
let part:String = bingo > 14 ? piece[0..<14] + "-" : piece[0..<bingo-1] + " "
266-
if (piece.characters.count > 15)
267-
{
268-
piece = piece[15..<piece.characters.count-1]
269-
}
270-
let messageUUID = StringToUUID(hex: part)
271-
peripheralManager.startAdvertising([CBAdvertisementDataServiceUUIDsKey: [CBUUID(string: messageUUID)]])
272-
datastring = piece
273-
}
274-
275261
func startAdvertisingToPeripheral() {
276-
var allTime:DispatchTime = DispatchTime.now();
277262
if (dataToSend != nil)
278263
{
279264
datastring = NSString(data:dataToSend as Data, encoding:String.Encoding.utf8.rawValue) as! String
280265
datastring = "iPhone: " + datastring
281-
if (datastring.characters.count > 15)
282-
{
283-
for j in 0 ..< datastring.characters.count/15 {
284-
let i = Double(j)
285-
let delay = i/10.000 * Double(NSEC_PER_SEC)
286-
287-
let when = DispatchTime.now() + delay
288-
allTime = when
289-
DispatchQueue.main.asyncAfter(deadline: when){
290-
() -> Void in self.sendPart();
291-
}
292-
}
293-
}
294-
else
295-
{
296-
let messageUUID = StringToUUID(hex: datastring)
297-
if !peripheralManager.isAdvertising {
298-
peripheralManager.startAdvertising([CBAdvertisementDataServiceUUIDsKey: [CBUUID(string: messageUUID)]])
299-
}
266+
267+
sendMessage(message: datastring)
268+
}
269+
}
270+
271+
func sendMessage(message: String)
272+
{
273+
let count = message.characters.count;
274+
var part:String
275+
276+
if (count > 15)
277+
{
278+
let delay = 10.000 * Double(NSEC_PER_SEC)
279+
let when = DispatchTime.now() + delay
280+
part = message[0..<14] + "-"
281+
282+
DispatchQueue.main.asyncAfter(deadline: when){
283+
() -> Void in self.sendMessage(message: message[15..<count-1]);
300284
}
301285
}
286+
else
287+
{
288+
part = message
289+
}
290+
291+
let messageUUID = StringToUUID(hex: part)
292+
peripheralManager.startAdvertising([CBAdvertisementDataServiceUUIDsKey: [CBUUID(string: messageUUID)]])
302293
}
303294

304295
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) {
23.1 KB
Loading
23.1 KB
Loading
42.4 KB
Loading
9.27 KB
Loading
13.4 KB
Loading
15 KB
Loading

BLEMingleiOS/Images.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,60 @@
22
"images" : [
33
{
44
"idiom" : "iphone",
5-
"size" : "29x29",
5+
"size" : "20x20",
66
"scale" : "2x"
77
},
88
{
99
"idiom" : "iphone",
10-
"size" : "29x29",
10+
"size" : "20x20",
1111
"scale" : "3x"
1212
},
1313
{
14+
"size" : "29x29",
1415
"idiom" : "iphone",
15-
"size" : "40x40",
16+
"filename" : "58.png",
1617
"scale" : "2x"
1718
},
1819
{
20+
"size" : "29x29",
1921
"idiom" : "iphone",
20-
"size" : "40x40",
22+
"filename" : "87.png",
2123
"scale" : "3x"
2224
},
2325
{
26+
"size" : "40x40",
2427
"idiom" : "iphone",
25-
"size" : "60x60",
28+
"filename" : "80.png",
2629
"scale" : "2x"
2730
},
2831
{
32+
"size" : "40x40",
2933
"idiom" : "iphone",
34+
"filename" : "120.png",
35+
"scale" : "3x"
36+
},
37+
{
38+
"size" : "60x60",
39+
"idiom" : "iphone",
40+
"filename" : "120-1.png",
41+
"scale" : "2x"
42+
},
43+
{
3044
"size" : "60x60",
45+
"idiom" : "iphone",
46+
"filename" : "180.png",
3147
"scale" : "3x"
3248
},
49+
{
50+
"idiom" : "ipad",
51+
"size" : "20x20",
52+
"scale" : "1x"
53+
},
54+
{
55+
"idiom" : "ipad",
56+
"size" : "20x20",
57+
"scale" : "2x"
58+
},
3359
{
3460
"idiom" : "ipad",
3561
"size" : "29x29",
@@ -59,6 +85,11 @@
5985
"idiom" : "ipad",
6086
"size" : "76x76",
6187
"scale" : "2x"
88+
},
89+
{
90+
"idiom" : "ipad",
91+
"size" : "83.5x83.5",
92+
"scale" : "2x"
6293
}
6394
],
6495
"info" : {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"images" : [
3+
{
4+
"orientation" : "portrait",
5+
"idiom" : "ipad",
6+
"extent" : "full-screen",
7+
"minimum-system-version" : "7.0",
8+
"scale" : "1x"
9+
},
10+
{
11+
"orientation" : "landscape",
12+
"idiom" : "ipad",
13+
"extent" : "full-screen",
14+
"minimum-system-version" : "7.0",
15+
"scale" : "1x"
16+
},
17+
{
18+
"orientation" : "portrait",
19+
"idiom" : "ipad",
20+
"extent" : "full-screen",
21+
"minimum-system-version" : "7.0",
22+
"scale" : "2x"
23+
},
24+
{
25+
"orientation" : "landscape",
26+
"idiom" : "ipad",
27+
"extent" : "full-screen",
28+
"minimum-system-version" : "7.0",
29+
"scale" : "2x"
30+
}
31+
],
32+
"info" : {
33+
"version" : 1,
34+
"author" : "xcode"
35+
}
36+
}

0 commit comments

Comments
 (0)