pingresp.go 721 B

12345678910111213141516171819202122232425262728293031323334
  1. package packets
  2. import (
  3. "io"
  4. )
  5. // PingrespPacket is an internal representation of the fields of the
  6. // Pingresp MQTT packet
  7. type PingrespPacket struct {
  8. FixedHeader
  9. }
  10. func (pr *PingrespPacket) String() string {
  11. return pr.FixedHeader.String()
  12. }
  13. func (pr *PingrespPacket) Write(w io.Writer) error {
  14. packet := pr.FixedHeader.pack()
  15. _, err := packet.WriteTo(w)
  16. return err
  17. }
  18. // Unpack decodes the details of a ControlPacket after the fixed
  19. // header has been read
  20. func (pr *PingrespPacket) Unpack(b io.Reader) error {
  21. return nil
  22. }
  23. // Details returns a Details struct containing the Qos and
  24. // MessageID of this ControlPacket
  25. func (pr *PingrespPacket) Details() Details {
  26. return Details{Qos: 0, MessageID: 0}
  27. }