Tuesday, February 3, 2004

Luckily I still had an eMate on-hand to replace my semi-broken MessagePad 2000. Turns out with the newest Keyspan drivers my serial connection was fine... it was just the failing serial connector on the Newton that was causing me grief. Now, back to the work of getting serial connections to understand Unicode. "Why?,' you ask, only semi-interested. Because non-ASCII characters are making syncs get wonky. But this input script, thus far, isn't working for serial:

{
   form:'bytes,
   
   termination: { endSequence:0x21 }, // ? = 0x3f
   
   InputScript: func(endpoint, s, term, opt)
   begin
      SetValue(status, 'text, "test2");
      local u;
      u := endpoint:getUnicodeStringFromData(s);
      
      if (StrPos(u, "ACK?", 0)) then
      begin
         // tell status if needed
         endpoint:doOutput("ACK");
         endpoint:doOutput(unicodeEOT);
         endpoint:ConnectOk();
         if (endpoint.mConnectionIsTCP = nil) then 
         begin
            endpoint:FlushOutput();
         end;
         endpoint:SetInputSpec(
               endpoint._parent.waitForFunction);
      end;
   end,
   
   discardAfter: 200
}

But I just get the dreaded "ACK?" communication log entries over and over. And the test message doesn't appear in the status. I do get a successful connection but no "ACK?" "ACK!" handshake.

Will scour the Internet and my Newton Developer Connection CDs for source examples of serial connections. But now, breakfast thoroughly eaten, it's time for me to venture off to work.
9:09:23 AM    comment []