user51895: I just started working with Arduino and in my project I am trying to achieve the COMM between two Arduino using HC-05 in master and slave mode respectively, I configured it all successfully.
Now I want to send three HCSR-04 distance sensors data from master Arduino to slave Arduino via HC-05. I am sending each sensor data separated by " | ". following is the example format., which I got in serial monitor by connecting the master Arduino directly to PC via USB.
168|200|76
167|200|68
166|200|76
168|200|77
Now the problem is I am not able to read and parse this on the slave side. I tried with serail.readbytesuntill but I could not succeed. Please help me out that how I can read it and parse it.
Thanks in advance.

user37523: As you can see from the comments Birender Brar, we need more information to be able to help you. 
One way to accomplish your goal would be to:
Use Serial.readBytesUntil('\n', buffer, length) on the slave device to "read" the data in to a char array. The serial monitor can be set to automatically send a \n character for testing purposes, but your code on the master will have to do this. Send the data 168|200|76 with a \n appended to the end of the data: 168|200|76\n
Parse the data. Here is a example sketch that parses the data in to a integer array.
// Use Serial.readBytesUntil('\n', buffer, length)
// to fill the char array / string.
char str[] = "168|200|76\n";

// Set array size to maximum number of integers you will receive.
uint16_t myArray[3];

void setup(){

  Serial.begin(9600);

  int counter = 0;
  char* pch = strtok(str, "|");

  while(pch != NULL){
    myArray[counter] = atoi(pch);
    pch = strtok(NULL, "|");
    counter += 1;
  }

  // Print out the contents of the integer array.
  for(int i = 0; i < counter; i++){
    Serial.println(myArray[i]);
  }
}

void loop(){}


51895: <p>I just started working with Arduino and in my project I am trying to achieve the COMM between two Arduino using HC-05 in master and slave mode respectively, I configured it all successfully.</p>

<p>Now I want to send three HCSR-04 distance sensors data from master Arduino to slave Arduino via HC-05. I am sending each sensor data separated by " | ". following is the example format., which I got in serial monitor by connecting the master Arduino directly to PC via USB.</p>

<p>168|200|76</p>

<p>167|200|68</p>

<p>166|200|76</p>

<p>168|200|77</p>

<p>Now the problem is I am not able to read and parse this on the slave side. I tried with serail.readbytesuntill but I could not succeed. Please help me out that how I can read it and parse it.</p>

<p>Thanks in advance.</p>
 37523: <p>As you can see from the comments Birender Brar, we need more information to be able to help you. </p>

<p>One way to accomplish your goal would be to:</p>

<p>Use <code>Serial.readBytesUntil('\n', buffer, length)</code> on the slave device to "read" the data in to a <code>char</code> array. The serial monitor can be set to automatically send a <code>\n</code> character for testing purposes, but your code on the master will have to do this. Send the data <strong>168|200|76</strong> with a <strong>\n</strong> appended to the end of the data: <strong>168|200|76\n</strong></p>

<p>Parse the data. Here is a example sketch that parses the data in to a <code>integer</code> array.</p>

<pre><code>// Use Serial.readBytesUntil('\n', buffer, length)
// to fill the char array / string.
char str[] = "168|200|76\n";

// Set array size to maximum number of integers you will receive.
uint16_t myArray[3];

void setup(){

  Serial.begin(9600);

  int counter = 0;
  char* pch = strtok(str, "|");

  while(pch != NULL){
    myArray[counter] = atoi(pch);
    pch = strtok(NULL, "|");
    counter += 1;
  }

  // Print out the contents of the integer array.
  for(int i = 0; i &lt; counter; i++){
    Serial.println(myArray[i]);
  }
}

void loop(){}
</code></pre>
