Serial port communication on pixhawk 2.4.8

I have used the pixhawk board to do the serial port communication.The sender and the receiver are both 3DR radio telemetrys. In the sending end, I sent “hello world” by python.Also, I wrote an application to receive the sentences in the board as the receiver.I can receive the “hello world” if the sentence only be sent once.However, it can only be received 2 times after sending more times(Maybe six or seven times).What is the matter? Here is my code. It seems that there is a congestion in read() function. Any suggestions?

int px4_simple_app_main(int argc, char *argv)
{
//char data = ‘0’;
char buffer[100] = “”;
int uart_read = uart_init(“/dev/ttyS1”);//
if(false == uart_read)
return -1;
if(false == set_uart_baudrate(uart_read,57600)){
printf(“set_uart_baudrate is failed\n”);
return -1;
}
printf(“uart init is successful\n”);
int ret;
while(true)
{
//pthread_testcancel();
//ret=read(uart_read,&buffer,100);
//ret=nx_read(uart_read,&buffer,100);
ret=px4_read(uart_read,&buffer,100);
printf(“got\n”);
printf(“%d\n”,ret);
if (ret>=0)
{
for (int i=0;i<10;i++)
{
printf(“%c\n”,buffer[i]);
}
}
sleep(1);
}

return 0;

}