Hello Koorosh,
About characters being echoed, in cdc_serial.h there is a macro to enable/disable echo in serial terminal:
#define CDC_SERIAL_ECHO_BACK (1)
So you need to set it to 0 in order to disable echoing back.
For CDC example, progam is reading data from UART (serial terminal) and they are stored in a buffer that will be sent to USB later. This data is sent by using:
num_done = _io_cdc_serial_write(s_f_usb_info.f_usb, &usb_tx_buf[usb_tx_done], (send_cnt > CDC_MAX_PKT_SIZE? CDC_MAX_PKT_SIZE : send_cnt));
In this case, s_f_usb_info.f_usb is the FILE PTR to write to USB module, usb_tx_buf[] is the buffer where the data is stored and third parameter specifies how many data will be sent.
I hope this can help!
Regards,
Isaac