AnsweredAssumed Answered

Getting string on virtual com port.

Question asked by erenburg.evgeny.002 on Feb 26, 2018
Latest reply on Feb 27, 2018 by Andrew Neil

I'm getting a string from a terminal.

 

 int main(void)
{
  Set_System();
  Set_USBClock();
  USB_Interrupts_Config();
  USB_Init();
 
  while (1)
  {
    if (bDeviceState == CONFIGURED)
    {
      CDC_Receive_DATA();
      /*Check to see if we have data yet */
      if (Receive_length  != 0)
      {
        if (packet_sent == 1)
          CDC_Send_DATA ((unsigned char*)Receive_Buffer,Receive_length);
        Receive_length = 0;
      }
    }
  }

 

And I see in Receive_Buffer my string. But I want to evaluate every char and to format a string as I need. For example I want to trim all '\n' and '\r' on reception level.

I didn't find a function I get chars from terminal. Where should it be?

Outcomes