MqttMsgSubscribeEventArgs.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. Copyright (c) 2013, 2014 Paolo Patierno
  3. All rights reserved. This program and the accompanying materials
  4. are made available under the terms of the Eclipse Public License v1.0
  5. and Eclipse Distribution License v1.0 which accompany this distribution.
  6. The Eclipse Public License is available at
  7. http://www.eclipse.org/legal/epl-v10.html
  8. and the Eclipse Distribution License is available at
  9. http://www.eclipse.org/org/documents/edl-v10.php.
  10. Contributors:
  11. Paolo Patierno - initial API and implementation and/or initial documentation
  12. */
  13. #if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3)
  14. using System;
  15. #else
  16. using Microsoft.SPOT;
  17. #endif
  18. namespace uPLibrary.Networking.M2Mqtt.Messages
  19. {
  20. /// <summary>
  21. /// Event Args class for subscribe request on topics
  22. /// </summary>
  23. public class MqttMsgSubscribeEventArgs : EventArgs
  24. {
  25. #region Properties...
  26. /// <summary>
  27. /// Message identifier
  28. /// </summary>
  29. public ushort MessageId
  30. {
  31. get { return this.messageId; }
  32. internal set { this.messageId = value; }
  33. }
  34. /// <summary>
  35. /// Topics requested to subscribe
  36. /// </summary>
  37. public string[] Topics
  38. {
  39. get { return this.topics; }
  40. internal set { this.topics = value; }
  41. }
  42. /// <summary>
  43. /// List of QOS Levels requested
  44. /// </summary>
  45. public byte[] QoSLevels
  46. {
  47. get { return this.qosLevels; }
  48. internal set { this.qosLevels = value; }
  49. }
  50. #endregion
  51. // message identifier
  52. ushort messageId;
  53. // topics requested to subscribe
  54. string[] topics;
  55. // QoS levels requested
  56. byte[] qosLevels;
  57. /// <summary>
  58. /// Constructor
  59. /// </summary>
  60. /// <param name="messageId">Message identifier for subscribe topics request</param>
  61. /// <param name="topics">Topics requested to subscribe</param>
  62. /// <param name="qosLevels">List of QOS Levels requested</param>
  63. public MqttMsgSubscribeEventArgs(ushort messageId, string[] topics, byte[] qosLevels)
  64. {
  65. this.messageId = messageId;
  66. this.topics = topics;
  67. this.qosLevels = qosLevels;
  68. }
  69. }
  70. }