TransmitterMessage.swift 527 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // TransmitterCommand.swift
  3. // xDrip5
  4. //
  5. // Created by Nathan Racklyeft on 11/22/15.
  6. // Copyright © 2015 Nathan Racklyeft. All rights reserved.
  7. //
  8. import Foundation
  9. /// A data sequence written to the transmitter
  10. protocol TransmitterTxMessage {
  11. /// The data to write
  12. var data: Data { get }
  13. }
  14. protocol RespondableMessage: TransmitterTxMessage {
  15. associatedtype Response: TransmitterRxMessage
  16. }
  17. /// A data sequence received by the transmitter
  18. protocol TransmitterRxMessage {
  19. init?(data: Data)
  20. }