DataBitsSize.swift 304 B

123456789101112131415161718192021
  1. import Foundation
  2. public enum DataBitsSize {
  3. case bits5
  4. case bits6
  5. case bits7
  6. case bits8
  7. var flagValue: tcflag_t {
  8. switch self {
  9. case .bits5:
  10. return tcflag_t(CS5)
  11. case .bits6:
  12. return tcflag_t(CS6)
  13. case .bits7:
  14. return tcflag_t(CS7)
  15. case .bits8:
  16. return tcflag_t(CS8)
  17. }
  18. }
  19. }