P
philbo30
Newbie question here...
I need to send control data (rewind by 3 lines) to a kiosk printer via
a 115200 tty and then print out information associated with a
transaction. The problem is that my control command is executed via a
bash shell system() call which is apparently much slower than my c
data processing. The end result is a printer trying to back up and
move forward at the same time. Unpretty.
Here' s the code for the system call:
char backup[32]="echo -ne \033K7 > /dev/ttyS0 \n"
int rewindsome(void)
{
system(backup);
system(backup);
system(backup);
return 0;
}
I need to make sure that the function above fully completes before the
rest of my app executes. Ideas?
I need to send control data (rewind by 3 lines) to a kiosk printer via
a 115200 tty and then print out information associated with a
transaction. The problem is that my control command is executed via a
bash shell system() call which is apparently much slower than my c
data processing. The end result is a printer trying to back up and
move forward at the same time. Unpretty.
Here' s the code for the system call:
char backup[32]="echo -ne \033K7 > /dev/ttyS0 \n"
int rewindsome(void)
{
system(backup);
system(backup);
system(backup);
return 0;
}
I need to make sure that the function above fully completes before the
rest of my app executes. Ideas?