Complete the code to subscribe to all topics under 'home/kitchen' using a single-level wildcard.
client.subscribe("home/kitchen/[1]")
The single-level wildcard '+' matches exactly one topic level. So 'home/kitchen/+' subscribes to all topics directly under 'home/kitchen'.
Complete the code to subscribe to all topics under 'home' recursively using a multi-level wildcard.
client.subscribe("home/[1]")
The multi-level wildcard '#' matches any number of topic levels, including zero. So 'home/#' subscribes to all topics under 'home' and its subtopics recursively.
Fix the error in the subscription to match all topics under 'office' and its subtopics.
client.subscribe("office/[1]")
The multi-level wildcard '#' must be at the end of the topic filter and matches all subtopics. 'office/#' correctly subscribes to all topics under 'office'.
Fill both blanks to subscribe to all sensors in any room under 'building1'.
client.subscribe("building1/[1]/[2]")
'building1/+/sensors' subscribes to the sensors topic in any room ('+') under 'building1'. Using '+' wildcard for room names and 'sensors' as the topic name is correct.
Fill all three blanks to subscribe to all temperature readings in any floor and any room under 'campus'.
client.subscribe("campus/[1]/[2]/[3]")
'campus/+/+/temperature' subscribes to temperature readings in any room ('+') on any floor ('+') under 'campus'.