ReadPumpStatusMessageBody.swift 668 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // ReadPumpStatusMessageBody.swift
  3. // RileyLink
  4. //
  5. // Created by Pete Schwamb on 7/31/16.
  6. // Copyright © 2016 Pete Schwamb. All rights reserved.
  7. //
  8. import Foundation
  9. public class ReadPumpStatusMessageBody: CarelinkLongMessageBody {
  10. public let bolusing: Bool
  11. public let suspended: Bool
  12. public required init?(rxData: Data) {
  13. guard rxData.count == type(of: self).length else {
  14. return nil
  15. }
  16. bolusing = rxData[2] > 0
  17. suspended = rxData[3] > 0
  18. super.init(rxData: rxData)
  19. }
  20. public required init?(rxData: NSData) {
  21. fatalError("init(rxData:) has not been implemented")
  22. }
  23. }