Skip to content

Commit

Permalink
Public init for MqttPublishProperties.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Troup authored and leeway1208 committed Aug 31, 2022
1 parent fe2502c commit 15d0826
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Source/MqttPublishProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,27 @@ public class MqttPublishProperties: NSObject {
//3.3.2.3.9 Content Type
public var contentType: String?


public init(
propertyLength: Int? = nil,
payloadFormatIndicator: PayloadFormatIndicator? = nil,
messageExpiryInterval: UInt32? = nil,
topicAlias: UInt16? = nil,
responseTopic: String? = nil,
correlationData: [UInt8]? = nil,
userProperty: [String: String]? = nil,
subscriptionIdentifier: UInt32? = nil,
contentType: String? = nil
) {
self.propertyLength = propertyLength
self.payloadFormatIndicator = payloadFormatIndicator
self.messageExpiryInterval = messageExpiryInterval
self.topicAlias = topicAlias
self.responseTopic = responseTopic
self.correlationData = correlationData
self.userProperty = userProperty
self.subscriptionIdentifier = subscriptionIdentifier
self.contentType = contentType
}

public var properties: [UInt8] {
var properties = [UInt8]()
Expand Down

0 comments on commit 15d0826

Please sign in to comment.