char Buffer_dat[50];
int index_ = 0;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  while(Serial.available() > 0) {
    // read the incoming byte:
    char incomingByte = Serial.read();
    if (incomingByte == 0x0A)
    {
      for(int i =0 ;i<index_;i++)
      {
        Serial.print(Buffer_dat[i]);
      }
      index_ = 0;
    }
    else
    {
      Buffer_dat[index_] = incomingByte;
      index_++;
    }
  }
}