serial read with c linux

I write some communication rules on arduino,then writed c program to send instructions for communicate.
I used below some parts code in C.

char port = open("/dev/ttyUSB1",O_RDWR | O_NOCTTY|O_NDELAY);
char output[150],input[15];
scanf("%s",input);

write(port,input,1);//for sending data
usleep((8+25)*100);

read(port,&output,sizeof(output));
printf("out == %s\n",output);

Sending instructions to arduino is working now,but when i try to get ' Serial.print ' from arduino with read function ,it is not working properly , it reads partialy , just used Serial.println in arduino part,
How can ı get outputs properly?

write(port,input,1);

is the size (1) correct? shouldn't it be strlen(input)+1?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.