APUE Learning Example Source Code
guowenxue
2019-06-26 157be0b0d4c7d4809cfcafc76235cc18388378c8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
 
# Test whether a client subscribed to a topic receives its own message sent to that topic.
# Does the Content Type property get sent through?
# MQTT v5
 
import prop_subpub_helper as helper
from mosq_test_helper import *
 
props_out = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "text")
props_out = props_out+mqtt5_props.gen_uint16_prop(mqtt5_props.PROP_TOPIC_ALIAS, 1)
 
props_in = mqtt5_props.gen_string_prop(mqtt5_props.PROP_CONTENT_TYPE, "text")
 
helper.prop_subpub_helper(props_out, props_in)