You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extensionFrameSubAck:InitialWithBytes{init?(packetFixedHeaderType:UInt8, bytes:[UInt8]){self.packetFixedHeaderType = packetFixedHeaderType
varprotocolVersion="";
if let storage =CocoaMQTTStorage(){
protocolVersion = storage.queryMQTTVersion()}
if (protocolVersion =="5.0"){// the bytes length must bigger than 3
guard bytes.count >=4else{returnnil}self.msgid =UInt16(bytes[0]) << 8+ UInt16(bytes[1])self.grantedQos =[]
for i in 3..< bytes.count {
guard let qos =CocoaMQTTQoS(rawValue:bytes[i])else{returnnil}self.grantedQos.append(qos)}self.reasonCodes =[CocoaMQTTSUBACKReasonCode]()
for i in 3..< bytes.count {
guard let qos =CocoaMQTTSUBACKReasonCode(rawValue:bytes[i])else{returnnil}self.reasonCodes! +=[qos]}self.subAckProperties =MqttDecodeSubAck()self.subAckProperties!.decodeSubAck(fixedHeader: packetFixedHeaderType, pubAckData: bytes)}else{// the bytes length must bigger than 3
guard bytes.count >=3else{returnnil}self.msgid =UInt16(bytes[0]) << 8+ UInt16(bytes[1])self.grantedQos =[]
for i in 2..< bytes.count {
guard let qos =CocoaMQTTQoS(rawValue:bytes[i])else{returnnil}self.grantedQos.append(qos)}}}}
if bytes is [0, 1, 0, 135], this function return nil。Because CocoaMQTTQoS(rawValue: bytes[i]) return nil
The text was updated successfully, but these errors were encountered:
if bytes is [0, 1, 0, 135], this function return nil。Because
CocoaMQTTQoS(rawValue: bytes[i])
return nilThe text was updated successfully, but these errors were encountered: