anchor.diff:  end;
   
   { --------------------------------------------------------------------------
  +  Perform a loopback test
     -------------------------------------------------------------------------- }
   procedure CommandLoopBackTest(comhandle: thandle);
   begin
  +  writeln('Starting an endless loopback test.');
  +  writeln('The current date and time will be sent, and the program will wait for a response and display it.');
  +  writeln('Press ctrl+c to stop.');
  +  writeln('------------------------------------');
  +  repeat
  +    WriteLine(comhandle, datetimetostr(now));
  +    writeln('Received: ' + GetLine(comhandle));
  +    sleep(1000);
  +  until false;
   end;
   
   { --------------------------------------------------------------------------
  
positive.code:   end;
  
    devicefilename := paramstr(1);
    if not fileexists(devicefilename) then begin
      writeln('Error: The device ' + devicefilename + ' does not exist.');
      exit;
  
negative.code:   { We want raw comms }
    cfmakeraw(comsettings);
  
    { Yes, this code is awful! Junk. TODO: Make it sensible }
    { Set baudrate }
    if cmd <> 'loopbacktest' then begin
      cfsetospeed(comsettings, B38400);
      cfsetispeed(comsettings, B38400);
    end else begin
      if paramstr(3) = '9600' then begin
        cfsetospeed(comsettings, B9600);
        cfsetispeed(comsettings, B9600);
      end else if paramstr(3) = '38400' then begin
        cfsetospeed(comsettings, B38400);
        cfsetispeed(comsettings, B38400);
      end else if paramstr(3) = '115200' then begin
        cfsetospeed(comsettings, B115200);
        cfsetispeed(comsettings, B115200);
      end else begin
        writeln('Error: Bad baud rate');
        exit;
      end;
    end;
  
    { Ignore modem controls }
    comsettings.c_cflag := comsettings.c_cflag or (CLOCAL or CREAD);
  