Skip to main content
Knowledgebase
Home
Renesas Electronics Europe - Knowledgebase

How do I check to see if a terminal is connected to the USB port when using the USB Comms module?

Last Updated:10/30/2017

Question:

How do I check for a terminal connection when using the USB comms module?

Answer:

You can check to see if a USB connection is active before you try and send data to the terminal. You can do this checking the DTR bit. Here is a code snippet.
while (UX_FALSE == p_cdc_slave->p_cdc->ux_slave_class_cdc_acm_data_dtr_state) {  tx_thread_sleep(5); }
USB Comms Module