MqttMonitor/MqttReasonCodes.py

branch
eric7
changeset 102
70b8858199f5
parent 99
420cb8adbf7e
child 114
8c0e9e602124
equal deleted inserted replaced
101:0eae5f616154 102:70b8858199f5
202 162: { 202 162: {
203 QCoreApplication.translate( 203 QCoreApplication.translate(
204 "MqttReasonCodeNames", "Wildcard subscription not supported" 204 "MqttReasonCodeNames", "Wildcard subscription not supported"
205 ): [PacketTypes.SUBACK, PacketTypes.DISCONNECT]}, 205 ): [PacketTypes.SUBACK, PacketTypes.DISCONNECT]},
206 } 206 }
207
207 208
208 def mqttReasonCode(rc, packetType): 209 def mqttReasonCode(rc, packetType):
209 """ 210 """
210 Function to get the readable reason code string given the result code and 211 Function to get the readable reason code string given the result code and
211 the packet type. 212 the packet type.
212 213
213 @param rc result code 214 @param rc result code
214 @type int 215 @type int
215 @param packetType packet type 216 @param packetType packet type
216 @type PacketTypes (= int) 217 @type PacketTypes (= int)
218 @return message associated with the reason code and packet type
219 @rtype str
217 """ 220 """
218 if rc not in MqttReasonCodeNames: 221 if rc not in MqttReasonCodeNames:
219 return QCoreApplication.translate( 222 return QCoreApplication.translate(
220 "MqttReasonCodeNames", "Unknown result code ({0})").format(rc) 223 "MqttReasonCodeNames", "Unknown result code ({0})").format(rc)
221 224

eric ide

mercurial