diff --git a/Sources/SwiftRPLidar/LidarSerial.swift b/Sources/SwiftRPLidar/LidarSerial.swift index e1b1c38..80f9811 100644 --- a/Sources/SwiftRPLidar/LidarSerial.swift +++ b/Sources/SwiftRPLidar/LidarSerial.swift @@ -1,8 +1,10 @@ +import Foundation + protocol LidarSerial { var dtr: Bool {get set}; var inWaiting: Int {get}; func closePort() -> Void; func openPort() -> Void; - readData(ofLength: Int) throws -> Void; - writeData(_ data: Data) throws -> Void; + func readData(ofLength: Int) throws -> Data; + func writeData(_ data: Data) throws -> Void; } diff --git a/Sources/SwiftRPLidar/SwiftRPLidar.swift b/Sources/SwiftRPLidar/SwiftRPLidar.swift index 4b858a0..d476c9d 100644 --- a/Sources/SwiftRPLidar/SwiftRPLidar.swift +++ b/Sources/SwiftRPLidar/SwiftRPLidar.swift @@ -1,5 +1,4 @@ import Foundation -import LidarSerial struct Constants{ static let SYNC: UInt8 = 0xA5