pthread_t reader_thread;
bool execCommand = (script_cmd != NULL);
bool stdinOnPipe = !isatty(STDIN_FILENO);
-
+
memset(&conn, 0, sizeof(receiver_arg));
if (usb_present) {
conn.run = true;
+ SetOffline(false);
pthread_create(&reader_thread, NULL, &uart_receiver, &conn);
// cache Version information now:
CmdVersion(NULL);
+ } else {
+ SetOffline(true);
}
// file with script
read_history(".history");
- while (1) {
+ while (1) {
// If there is a script file
if (script_file)
{
if(strcmp(argv[i],"-f") == 0 || strcmp(argv[i],"-flush") == 0){
printf("Output will be flushed after every print.\n");
- flushAfterWrite = 1;
+ SetFlushAfterWrite(true);
}
if(strcmp(argv[i],"-w") == 0 || strcmp(argv[i],"-wait") == 0){
if (sp == INVALID_SERIAL_PORT) {
printf("ERROR: invalid serial port\n");
usb_present = false;
- offline = 1;
} else if (sp == CLAIMED_SERIAL_PORT) {
printf("ERROR: serial port is claimed by another process\n");
usb_present = false;
- offline = 1;
} else {
usb_present = true;
- offline = 0;
}
#ifdef HAVE_GUI