Re: [Evolution] Palm Tungsten T - Sync



Frederic Crozat wrote:

--- gnome-pilot-0.1.71/gpilotd/gpilotd.c.orig	2003-04-02 11:58:10.000000000 +0200
+++ gnome-pilot-0.1.71/gpilotd/gpilotd.c	2003-04-02 12:02:10.000000000 +0200
@@ -845,6 +845,8 @@
	NULL
};

+#define TUNGSTEN_STRING "P:  Vendor=0830 ProdID=0060"
+
static gboolean product_net[] =
{
	FALSE,
@@ -884,17 +886,27 @@
	f = fopen ("/proc/bus/usb/devices", "r");
	
	while (fgets (line, 255, f) != NULL && !visor_exists) {
-		if (line[0] != 'S')
+		if (line[0] != 'S' && line[0] != 'P')
			continue;
-		
-		for (i = 0; product_names[i] != NULL; i++) {
- if (!strncmp (line + strlen ("S: Product="), - product_names[i], - strlen (product_names[i]))) {
+
+		if (line[0] == 'P') { /* workaround for Tungsten T */
+			if (!strncmp (line, TUNGSTEN_STRING, strlen(TUNGSTEN_STRING))) {
				visor_exists = TRUE;
-				visor_net = product_net[i];
+				visor_net = TRUE;
			}
		}
+		else {
+		
+			for (i = 0; product_names[i] != NULL; i++) {
+ if (!strncmp (line + strlen ("S: Product="), + product_names[i], + strlen (product_names[i]))) {
+					visor_exists = TRUE;
+					visor_net = product_net[i];
+				}
+			}
+		}
+
	}
	
	fclose (f);

I've sent a patch to the gnome-pilot list (March 22, "Re: Treo 300: pilot-link works, gnome-pilot doesn't") which does the same thing, but rather than kludging one particular device (e.g. Tungsten, or my Treo 300 which also doesn't have an "S:" line), it uses vendor/product IDs for all of them. In addition to more uniformly (and elegantly) handling a wider range of devices, this approach facilitates syncing with the list in drivers/usb/serial/visor.h in the kernel, e.g. for Samsung devices (on which we still haven't heard a test report...), etc.

And yes, it includes the Tungsten T.

Sorry my Subject didn't more clearly identify it as a general patch, wish I could have saved you this work.

A second patch was also required to make the Treo 300 work, which replaced pi_accept_to() with pi_accept() (gnome-pilot March 23, "Treo 300 Success!").

Zeen,
--

-Adam P.

GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Welcome to the best software in the world today cafe! <http://lyre.mit.edu/%7Epowell/The_Best_Stuff_In_The_World_Today_Cafe.ogg>





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