IOT Questions and Answers – Publishing Messages with Commands

This set of IOT Multiple Choice Questions & Answers (MCQs) focuses on “Publishing Messages with Commands”.

1. What is the java extension file in IoT?
a) .jar
b) .c
c) .exe
d) .py
View Answer

Answer: a
Explanation: Java IDE to run the example in any computer or build .jar file with all the dependencies included and launch it any computer or devices that you want to use as the MQTT client with a command similar to the following line.

2. Do we run our program in the same computer where we have written?
a) True
b) False
c) May or may not
d) Cannot be determined
View Answer

Answer: c
Explanation: In case you don’t run the example in the same computer in which you are running the MQTT server, remember to change the value for the mqttServerHost string in the main method of the Main class.

3. Publish command message is sent from _________
a) Only publisher to broker
b) Only broker to publisher
c) Publisher to broker and broker to publisher
d) Server to client
View Answer

Answer: c
Explanation: The public command message is sent from a publisher to a broker or from a broker to publisher, to publish information on a specified topic or topics.
advertisement
advertisement

4. The message is sent to the input queue of a message flow that contains a _________
a) Subscriber
b) Server
c) Publication node
d) Client
View Answer

Answer: c
Explanation: Message is sent to the input queue of a message flow that contains a publishing node. Authority to put a message into the queue and to publish on the specified topic.

5. Does user has authority for all topics.
a) True
b) False
View Answer

Answer: b
Explanation: If the user has no authority on a topic then a warning response will come which indicates that that topic is not published, if not then that topic is published.

6. ROSTOPIC uses _________ at the command line for representing the content of the message.
a) YAML_syntax
b) rostopic bw
c) rostopic delay
d) rostopic echo
View Answer

Answer: a
Explanation: ROSTOPIC uses YAML_syntax at the command line for representing the content of the message. For information on how to use this YAML syntax for commands like rostopic pub.

7. Which command displays the band width?
a) rostopic hz
b) rostopic delay
c) rostopic echo
d) rostopic bw
View Answer

Answer: d
Explanation: Rostopic bw command is used to display the bandwidth. The bandwidth reported is the received bandwidth.
advertisement

8. rostopic delay will provide delay for ___________
a) Topics which has header
b) Topics which has tail
c) Topics which has tail and head
d) To all topics
View Answer

Answer: a
Explanation: Rostopic delay display the delay for topic which has header. Rostopic is implemented in python.

9. Which command displays messages published to a topic?
a) rostopic bw
b) rostopic delay
c) rostopic echo
d) rostopic hz
View Answer

Answer: c
Explanation: Rostopic echo displays messages published to a topic. Rostopic is implemented in python.
advertisement

10. Which command finds out the topic?
a) rostopic bw
b) rostopic delay
c) rostopic echo
d) rostopic find
View Answer

Answer: d
Explanation: Rostopic find command is used to find the topics by type. Rostopic is implemented in python. ROSTOPIC uses YAML_syntax at the command line.

Sanfoundry Global Education & Learning Series – IOT.

To practice all areas of IOT, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.