write to file
This commit is contained in:
parent
9326e6e09a
commit
6bf29bf316
@ -65,6 +65,9 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
signal(SIGINT, handle_sigint);
|
signal(SIGINT, handle_sigint);
|
||||||
|
|
||||||
|
FILE *output_file;
|
||||||
|
output_file = fopen("./abc.txt", "w");
|
||||||
|
|
||||||
/* Reading lines from serial port. */
|
/* Reading lines from serial port. */
|
||||||
bool reading = true;
|
bool reading = true;
|
||||||
while (reading && !INTERRUPT) {
|
while (reading && !INTERRUPT) {
|
||||||
@ -94,8 +97,10 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
puts(buffer);
|
puts(buffer);
|
||||||
|
fputs(buffer, output_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fclose(output_file);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user