Re: Port speed?



Peter Teichman <pat4@acpub.duke.edu> writes:

> Eskil mentioned to me that setting PILOTRATE from within gpilotd has
> been tried, but it didn't work.

It looks like it does to me.  I'll run more tests, but here's a diff
from a little hacking.  I reenabled the capplet menu, added 115200,
and put in a little code to set PILOTRATE.  From checking stty on the
port during sync, it does appear to be setting the rate... I'll run
some more tests on actually _installing_ things, but a brief sync
definately seems faster.  

BTW, is there a standard for things like which changelog to add to,
where brackets go, etc?  I saw a couple different Changelogs, and
gpilotd.c has both 

int fun() {

and 

int fun()
{

Just want to know how to program my Emacs....

cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-pilot/ChangeLog,v
retrieving revision 1.48
diff -c -r1.48 ChangeLog
*** ChangeLog	1999/10/22 00:23:05	1.48
--- ChangeLog	1999/10/22 20:25:48
***************
*** 1,3 ****
--- 1,8 ----
+ 1999-10-22  Alan Shutko  <ats@acm.org>
+ 
+ 	* capplet/pilot.c: Added 115200 to speedList, because PalmOS 3.3
+ 	supports the speed.
+ 
  1999-10-22  Eskil Olsen <deity@eskil.dk>
  
  	* configure.in: version = 0.1.38
cvs server: Diffing Documentation
cvs server: Diffing Documentation/conduit-SyncAbs-impl
cvs server: Diffing Documentation/conduits
cvs server: Diffing admin
cvs server: Diffing applet
cvs server: Diffing capplet
Index: capplet/gpilotd-control-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/capplet/gpilotd-control-applet.c,v
retrieving revision 1.32
diff -c -r1.32 gpilotd-control-applet.c
*** capplet/gpilotd-control-applet.c	1999/10/14 23:39:48	1.32
--- capplet/gpilotd-control-applet.c	1999/10/22 20:25:59
***************
*** 14,20 ****
  
  /* deity99: include the gpilotd interface */
  #include <gpilotd/gpilotd-app.h>
! #define NO_BAUD
  
  /* tell changes callbacks to ignore changes or not */
  static gboolean ignore_changes=FALSE;
--- 14,20 ----
  
  /* deity99: include the gpilotd interface */
  #include <gpilotd/gpilotd-app.h>
! #undef NO_BAUD
  
  /* tell changes callbacks to ignore changes or not */
  static gboolean ignore_changes=FALSE;
Index: capplet/pilot.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/capplet/pilot.c,v
retrieving revision 1.5
diff -c -r1.5 pilot.c
*** capplet/pilot.c	1999/07/18 13:30:48	1.5
--- capplet/pilot.c	1999/10/22 20:26:00
***************
*** 10,16 ****
  			    "/dev/ttyS1",
  			    "/dev/ttyS2",
  			    "/dev/ttyS3", NULL};
! const guint  speedList[] = {9600, 19200, 38400, 57600, 0};
  
  
  /* create new pilotstate structure, initialize to sane state */
--- 10,16 ----
  			    "/dev/ttyS1",
  			    "/dev/ttyS2",
  			    "/dev/ttyS3", NULL};
! const guint  speedList[] = {9600, 19200, 38400, 57600, 115200, 0};
  
  
  /* create new pilotstate structure, initialize to sane state */
cvs server: Diffing conduits
cvs server: Diffing conduits/address
cvs server: Diffing conduits/backup
cvs server: Diffing conduits/calendar
cvs server: Diffing conduits/email
cvs server: Diffing conduits/file
cvs server: Diffing conduits/memo
cvs server: Diffing conduits/memo_file
cvs server: Diffing drafts
cvs server: Diffing drafts/idl
cvs server: Diffing drafts/mvachhar
cvs server: Diffing gpilot-fileman
cvs server: Diffing gpilotd
Index: gpilotd/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-pilot/gpilotd/ChangeLog,v
retrieving revision 1.12
diff -c -r1.12 ChangeLog
*** gpilotd/ChangeLog	1999/10/22 00:23:08	1.12
--- gpilotd/ChangeLog	1999/10/22 20:26:03
***************
*** 1,3 ****
--- 1,9 ----
+ 1999-10-22  Alan Shutko  <ats@acm.org>
+ 
+ 	* gpilotd.c (pilot_connect): Set PILOTRATE env variable before
+ 	calling pi_bind.  Added new argument to specify the desired rate.
+ 	(sync_foreach): Pass device->speed to pilot_connect for above change.
+ 
  1999-10-22  Eskil Olsen <deity@eskil.dk>
  
  	* gpilotd-conduit-mgmt.h: revamped all call to take a pilotId
Index: gpilotd/gpilotd.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/gpilotd/gpilotd.c,v
retrieving revision 1.55
diff -c -r1.55 gpilotd.c
*** gpilotd/gpilotd.c	1999/10/19 00:43:33	1.55
--- gpilotd/gpilotd.c	1999/10/22 20:26:03
***************
*** 45,54 ****
  void monitor_channel(GPilotDevice *,GPilotContext *);
  static void remove_pid_file(void);
  
! static int pilot_connect(gchar *device) {
    struct pi_sockaddr addr;
    int sd;
    int ret;
    if (!(sd = pi_socket(PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP))) {
      g_warning("pi_socket: %s",strerror(errno));
      return -1;
--- 45,56 ----
  void monitor_channel(GPilotDevice *,GPilotContext *);
  static void remove_pid_file(void);
  
! static int pilot_connect(gchar *device, guint speed) {
    struct pi_sockaddr addr;
    int sd;
    int ret;
+   char rate_buf[20];
+   
    if (!(sd = pi_socket(PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP))) {
      g_warning("pi_socket: %s",strerror(errno));
      return -1;
***************
*** 57,62 ****
--- 59,67 ----
    addr.pi_family = PI_AF_SLP;
    strcpy(addr.pi_device,device);
  
+   sprintf(rate_buf, "PILOTRATE=%d", speed);
+   putenv(rate_buf);
+   
    ret = pi_bind(sd, (struct sockaddr*)&addr, sizeof(addr));
    if(ret != 0) {
      g_warning(_("Unable to bind to pilot"));
***************
*** 302,308 ****
  #endif
   
    /* signal(SIGHUP,SIG_DFL); */
!   pfd=pilot_connect(device->device_name);
  
    if(pfd == -1) {
      g_warning(_("An error occured while listening for sync button press!"));
--- 307,313 ----
  #endif
   
    /* signal(SIGHUP,SIG_DFL); */
!   pfd=pilot_connect(device->device_name, device->speed);
  
    if(pfd == -1) {
      g_warning(_("An error occured while listening for sync button press!"));
cvs server: Diffing idl
cvs server: Diffing macros
cvs server: Diffing po
cvs server: Diffing utils

-- 
Alan Shutko <ats@acm.org> - In a variety of flavors!
Inspiration without perspiration is usually sterile.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]