Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Commit

Permalink
Update examples to Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-nallick-wwt committed Sep 30, 2019
1 parent 005183c commit 29bbe85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Examples/SwiftSerialExample/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ do {
transmitRate: .baud9600,
minimumBytesToRead: 1)

print("Writing test string <\(testString)> of \(testString.characters.count) characters to serial port")
print("Writing test string <\(testString)> of \(testString.count) characters to serial port")

var bytesWritten = try serialPort.writeString(testString)
let bytesWritten = try serialPort.writeString(testString)

print("Successfully wrote \(bytesWritten) bytes")
print("Waiting to receive what was written...")
Expand All @@ -54,7 +54,7 @@ do {
var multiLineString: String = ""


for i in 1...numberOfMultiNewLineTest {
for _ in 1...numberOfMultiNewLineTest {
multiLineString += testString + "\n"
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/SwiftSerialIM/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ do {


while true {
var enteredKey = getKeyPress()
let enteredKey = getKeyPress()
printToScreenFrom(myself: true, characterToPrint: enteredKey)
var _ = try serialPort.writeChar(enteredKey)
}
Expand Down

0 comments on commit 29bbe85

Please sign in to comment.