[Thread Prev][Thread Next][Thread Index]

[PilotMgr] Patches to pi-port



Hi,

here are the promised patches to pi-port.c to make it work for me under
solaris.

The first part ist to accept baud rate changes and came from Rik Harris
on pilot-unix in April 98. 
The change of the timeout value for serial_read() from 1 to 500 MICROseconds
was neccessary un my Ultra under Solaris. Linux could live without.

If you start "pi-port /dev/ttya " on your machine, it waits on port 4386
for connections. These are established by using ":<ip-addr>" as a port
specification for pilot-link or PilotManager.

Be sure to kill pi-port after syncing, because it eats up CPU time by
polling the serial line :-(

Regards

Andreas

-- 
-- 
#  Andreas Jakobs, Infineon MP CAD, 		Andreas.Jakobs@xxxxxxxxxxxx
#  Phone.(Fax) +49 89/636-25690 (-28983)
#
#  Windows: Indianisch fuer "Weisser Mann, der auf Sanduhr wartet".
*** pilot-link.0.9.3/pi-port.c.dist	Fri May  8 03:29:34 1998
--- pilot-link.0.9.3/pi-port.c.new	Wed Sep  1 11:01:52 1999
***************
*** 37,49 ****
      struct pi_skb * nskb;
      nskb = (struct pi_skb *)malloc(sizeof(struct pi_skb));
  
!     nskb->source = buffer[0];
!     nskb->dest = buffer[1];
!     nskb->type = buffer[2];
!     len=get_short(buffer+3);
!     nskb->id = buffer[5];
      
!     memcpy(&nskb->data[10], buffer+7, len);
      slp_tx(ps, nskb, len);
  
    } else if (type == 1 ) {
--- 37,49 ----
      struct pi_skb * nskb;
      nskb = (struct pi_skb *)malloc(sizeof(struct pi_skb));
  
!     nskb->source = buffer[3];
!     nskb->dest = buffer[4];
!     nskb->type = buffer[5];
!     len=get_short(buffer+6);
!     nskb->id = buffer[8];
      
!     memcpy(&nskb->data[10], buffer+10, len);
      slp_tx(ps, nskb, len);
  
    } else if (type == 1 ) {
***************
*** 163,171 ****
            int blen;
            while(l >= 4 && (l >= (blen = get_short(buffer+2))+4 )) {
              fprintf(stderr, "l = %d, blen = %d\n", l, blen);
!             do_read(ps, get_short(buffer),buffer+7,blen);
              l = l-blen-4;
!             if (l>blen) {
                memmove(buffer,buffer+4+blen,l);
              }
              fprintf(stderr, "Buffer now is:\n");
--- 163,171 ----
            int blen;
            while(l >= 4 && (l >= (blen = get_short(buffer+2))+4 )) {
              fprintf(stderr, "l = %d, blen = %d\n", l, blen);
!             do_read(ps, get_short(buffer),buffer+4,blen);
              l = l-blen-4;
!             if (l>0) {
                memmove(buffer,buffer+4+blen,l);
              }
              fprintf(stderr, "Buffer now is:\n");
***************
*** 176,182 ****
          ;
        }
        if (FD_ISSET(sd, &rset)) {
!         ps->serial_read(ps, 1);
          if (ps->rxq) {
            fprintf(stderr, "A %d byte packet has been received from the serial port\n", ps->rxq->len);
          }
--- 176,182 ----
          ;
        }
        if (FD_ISSET(sd, &rset)) {
!         ps->serial_read(ps, 500);
          if (ps->rxq) {
            fprintf(stderr, "A %d byte packet has been received from the serial port\n", ps->rxq->len);
          }

SourceForge.net Logo