diff -r -u -x bin -x tools -x 'Makefile*' -x '*.m4' -x 'config*' -x '*~' -x '*.log' -x '*.Po' -x '*.status' -x Makefile -x '*.o' -x '*.moc.cpp' usbb2k-api-mod-2.1/ChangeLog newusbb2k-api-mod-2.1/ChangeLog
--- usbb2k-api-mod-2.1/ChangeLog	2007-02-20 22:02:07.000000000 +0900
+++ newusbb2k-api-mod-2.1/ChangeLog	2007-05-22 19:53:37.000000000 +0900
@@ -2,4 +2,25 @@
 	Import savannah
 20-02-2007
 	changed name to reflect the new use in the kb2kskype project
-	updated and modified for RPM/deb-packaging
\ No newline at end of file
+	updated and modified for RPM/deb-packaging
+22-05-2007
+        Set up to Ignore handset -110 errors, to prevent endless stream
+	of messages from being delivered to the socket
+	
+	Set usbb2k_check_handset to fail over to err (the return value
+	after checking registers) rather than ERR (the -1 error
+	flag), so that the error type can be handled after
+	execution
+	
+	Set usbb2k_get_key to return ERR on failure instead of err,
+	since that's what the existing code checks for
+	
+	Amended the README to reflect some odd behaviour in the
+	hardware
+	
+	Added a few syslog messages for debugging, and commented
+	these and some of the existing ones out
+
+        Made a few spelling and grammar corrections in the comments
+	
+	
\ No newline at end of file
Only in newusbb2k-api-mod-2.1: mkinstalldirs
diff -r -u -x bin -x tools -x 'Makefile*' -x '*.m4' -x 'config*' -x '*~' -x '*.log' -x '*.Po' -x '*.status' -x Makefile -x '*.o' -x '*.moc.cpp' usbb2k-api-mod-2.1/README newusbb2k-api-mod-2.1/README
--- usbb2k-api-mod-2.1/README	2007-02-20 23:28:22.000000000 +0900
+++ newusbb2k-api-mod-2.1/README	2007-05-22 19:54:14.000000000 +0900
@@ -13,7 +13,7 @@
 2. in a other Consol:
 tools/api_connect /tmp/usbb2k.sock
 
-#Commande for api_connect:
+#Command for api_connect:
 SWITCH USB/PSTN
 RING 0 (stop ringing)
 RING 1 (ring mode 1)
@@ -22,3 +22,15 @@
 #Msg from api_connect:
 HANDSET ON/OFF (pickup/off handset)
 KEY 01..09 (keyphone pressed)
+
+Note
+====
+When the telbox is in PSTN mode and SWITCH USB is sent to 
+it, two keypress events will be reported to the socket.
+It is not clear whether this is a bug in the hardware,
+a design feature, or caused by some discrepancy in the
+codes uses to query the registers.  It is also not clear
+whether it is dependent on the RING and DIALTONE states.
+But when usbb2k_api is driven by kb2kskype, it exhibits
+this behaviour consistently on one piece of hardware,
+at least.
Only in newusbb2k-api-mod-2.1/src: .deps
Only in newusbb2k-api-mod-2.1/src: usbb2k_api
diff -r -u -x bin -x tools -x 'Makefile*' -x '*.m4' -x 'config*' -x '*~' -x '*.log' -x '*.Po' -x '*.status' -x Makefile -x '*.o' -x '*.moc.cpp' usbb2k-api-mod-2.1/src/usbb2k-main.c newusbb2k-api-mod-2.1/src/usbb2k-main.c
--- usbb2k-api-mod-2.1/src/usbb2k-main.c	2007-05-22 19:27:59.000000000 +0900
+++ newusbb2k-api-mod-2.1/src/usbb2k-main.c	2007-05-22 19:41:05.000000000 +0900
@@ -43,7 +43,7 @@
       syslog(LOG_INFO,"SIGHUP receive");
       break;
     case 15:/* SIGTERM */
-      syslog(LOG_INFO,"SIGTERM receice");
+      syslog(LOG_INFO,"SIGTERM receive");
       if (usb_loop==OFF) 
       {
         closelog();
@@ -109,8 +109,7 @@
       return OFF;
     }
   }
-  syslog(LOG_ERR,"error: %d",err);
-  return ERR;
+  return err;
 }
 
 int 
@@ -151,7 +150,7 @@
     //if (data[0]!=URB_CMD[URB_KEYCODE][0]) return -2;
     return data[4];
   }
-  return err;
+  return ERR;
 }
 
 struct usb_device* 
@@ -365,7 +364,7 @@
     if (msgl>1) {
       //traite CMD
       msg[msgl-1]=0;
-      syslog(LOG_INFO,"RECV CMD:[%s]",msg);
+      //syslog(LOG_INFO,"RECV CMD:[%s]",msg);
       switch(decode_cmd(msg,arg_cmd))
       {
         case CMD_SWITCH_USB:
@@ -413,7 +412,7 @@
 
 	case CMD_NA:
 	default:
-	  syslog(LOG_INFO,"commande not def");
+	  syslog(LOG_INFO,"undefined command");
       }
     }
   }while(msgl>0);
@@ -462,7 +461,16 @@
 
     /* Handset check */
     handset_state=usbb2k_check_handset(dev_h);
-    if (handset_state==ERR) syslog(LOG_ERR,"handset Error");
+    if (handset_state < 0)
+    {
+       if (handset_state == -110){
+         //syslog(LOG_ERR,"error: %d (probably just confirming a switch to PSTN mode)",err);
+       }else{
+           syslog(LOG_ERR,"handset error");
+       }
+       usleep(50);
+       continue;
+    }
     if (handset_state_flag!=handset_state) 
     {
       handset_state_flag=handset_state;
@@ -490,6 +498,7 @@
 	}
       }
       msgl=write(client,msg,strlen(msg));
+      //syslog(LOG_ERR,msg);
       if (msgl<strlen(msg)) 
       {
         msgl=-2;
@@ -507,6 +516,7 @@
 	 {
            sprintf(msg,"KEY  %.2x\n",key_code);
            msgl=write(client,msg,strlen(msg));		
+           //syslog(LOG_ERR,msg);
 	 }
 	 else syslog(LOG_ERR,"Key ERROR %d : %d ",key_code,keypress_state);
          if (tone_flag==ON) 
Only in newusbb2k-api-mod-2.1: stamp-h
Only in newusbb2k-api-mod-2.1: stamp-h1
Only in newusbb2k-api-mod-2.1: stamp-h.in
