Add inWaiting Property
This commit is contained in:
@@ -165,6 +165,11 @@ public enum BaudRate {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(OSX)
|
||||
// Darwin doesn't provide this
|
||||
private let FIONREAD: UInt = 0x541B
|
||||
#endif
|
||||
|
||||
public enum DataBitsSize {
|
||||
case bits5
|
||||
case bits6
|
||||
@@ -384,6 +389,12 @@ public class SerialPort {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var inWaiting: Int? {
|
||||
get{
|
||||
return Int(ioctl(fileDescriptor!, FIONREAD))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Receiving
|
||||
|
||||
Reference in New Issue
Block a user