In the buff in [], but the buff in [] without the data, how be to return a responsibility??????? Pray god help!
Void recDataVer2 ()
{
The FILE * fp.
//the staging data read
Unsigned char buff [8]={0};
Int CNT=0;
Time_t current_time, start_time;
//open the serial port
If ((fp=fopen (" com1 ", "r"))==NULL)
{
Puts (" ReadDev donnot work! \n");
}
The else
{
Puts (" ReadDev way work! \n");
While (1)
{
//read data
CNT=fread (buff, 1, 8, fp);
If (CNT)
{
//print out the data
Printf (" data: \ t \ n ", buff2);
}
Time (& amp; Start_time);
Do
{
Time (& amp; Current_time);
}
While ((current_time - start_time) & lt; 1);
}
}
}
CodePudding user response:
Should be in the readCodePudding user response:
Printf (" data: \ t \ n ", buff2);You see that you write is what?