[kismac] [binaervarianz] r152 - in trunk: . AppleScript Samples Sources/Driver/USBIntersilJack Sources/WaveDrivers

  • From: svn@xxxxxxxxxxxxxxxx
  • To: kismac@xxxxxxxxxxxxx
  • Date: Fri, 26 May 2006 11:04:30 +0200

Author: robin
Date: 2006-05-26 11:04:29 +0200 (Fri, 26 May 2006)
New Revision: 152

Added:
   trunk/AppleScript Samples/KisTheEarth.app
   trunk/AppleScript Samples/KisTheEarth.kml
Modified:
   trunk/CHANGES
   trunk/Sources/Driver/USBIntersilJack/USBIntersil.h
   trunk/Sources/Driver/USBIntersilJack/USBIntersil.mm
   trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.h
   trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.mm
Log:
- Added near-real-time Google Earth output (in AppleScript samples folder)
- Corrected spelling error in function name
- Attempt to handle USB errors more gracefully (although still not perfect)



Added: trunk/AppleScript Samples/KisTheEarth.app
===================================================================
(Binary files differ)


Property changes on: trunk/AppleScript Samples/KisTheEarth.app
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: trunk/AppleScript Samples/KisTheEarth.kml
===================================================================
--- trunk/AppleScript Samples/KisTheEarth.kml   2006-05-25 14:42:44 UTC (rev 
151)
+++ trunk/AppleScript Samples/KisTheEarth.kml   2006-05-26 09:04:29 UTC (rev 
152)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kml xmlns="http://earth.google.com/kml/2.0";>
+<Document>
+  <name>KisMAC</name>
+  <visibility>0</visibility>
+  <open>1</open>
+<NetworkLink>
+  <name>KisTheEarth</name>
+  <visibility>0</visibility>
+  <open>1</open>
+  <flyToView>0</flyToView>
+  <Url>
+    <href>/tmp/kismac-export.kml</href>
+    <refreshMode>onInterval</refreshMode>
+    <refreshInterval>10</refreshInterval>
+  </Url>
+</NetworkLink>
+</Document>
+</kml>

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES       2006-05-25 14:42:44 UTC (rev 151)
+++ trunk/CHANGES       2006-05-26 09:04:29 UTC (rev 152)
@@ -1,5 +1,9 @@
-R151: - Fix path issure in KML export AppleScript
+R152: - Added near-real-time Google Earth output (in AppleScript samples 
folder)
+      - Corrected spelling error in function name
+      - Attempt to handle USB errors more gracefully (although still not 
perfect)
 
+R151: - Fix path issue in KML export AppleScript
+
 R150: - Fix compile on xCode 2.3
 
 R149: - added export KML to script library to support "Realtime" export of kml

Modified: trunk/Sources/Driver/USBIntersilJack/USBIntersil.h
===================================================================
--- trunk/Sources/Driver/USBIntersilJack/USBIntersil.h  2006-05-25 14:42:44 UTC 
(rev 151)
+++ trunk/Sources/Driver/USBIntersilJack/USBIntersil.h  2006-05-26 09:04:29 UTC 
(rev 152)
@@ -39,7 +39,7 @@
     bool    setChannel(UInt16 channel);
     bool    devicePresent();
     
-    WLFrame *recieveFrame();
+    WLFrame *receiveFrame();
     bool    sendFrame(UInt8* data);
     
     void    startMatching();

Modified: trunk/Sources/Driver/USBIntersilJack/USBIntersil.mm
===================================================================
--- trunk/Sources/Driver/USBIntersilJack/USBIntersil.mm 2006-05-25 14:42:44 UTC 
(rev 151)
+++ trunk/Sources/Driver/USBIntersilJack/USBIntersil.mm 2006-05-26 09:04:29 UTC 
(rev 152)
@@ -185,7 +185,7 @@
     return _devicePresent;
 }
 
-WLFrame *USBIntersilJack::recieveFrame() {
+WLFrame *USBIntersilJack::receiveFrame() {
     WLFrame* ret;
     
     if (!_devicePresent) return NULL;

Modified: trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.h
===================================================================
--- trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.h   2006-05-25 14:42:44 UTC 
(rev 151)
+++ trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.h   2006-05-26 09:04:29 UTC 
(rev 152)
@@ -33,6 +33,8 @@
     //stuff for timed sending
     float           _interval;
     bool            _transmitting;
+       
+       int                             _errors;
 }
 
 @end

Modified: trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.mm
===================================================================
--- trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.mm  2006-05-25 14:42:44 UTC 
(rev 151)
+++ trunk/Sources/WaveDrivers/WaveDriverUSBIntersil.mm  2006-05-26 09:04:29 UTC 
(rev 152)
@@ -36,6 +36,8 @@
     _driver = new USBIntersilJack;
     _driver->startMatching();
     
+       _errors = 0;
+       
     return self;
 }
 
@@ -137,12 +139,19 @@
 - (WLFrame*) nextFrame {
     WLFrame *f;
     
-    f = _driver->recieveFrame();
+    f = _driver->receiveFrame();
     if (f==NULL) {
-        if (_packets) {
-            delete _driver; 
-            _driver = new USBIntersilJack;
-            _driver->startMatching();
+               _errors++;
+        if (_packets && _driver) {
+                       if (_errors < 3) {
+                               NSLog(@"USB receiveFrame failed - attempting to 
reload driver");
+                               delete _driver;
+                               _driver = new USBIntersilJack;
+                               _driver->startMatching();
+                       } else {
+                               NSLog(@"Excessive errors received - terminating 
driver");
+                               delete _driver;
+                       }
         }
         NSRunCriticalAlertPanel(NSLocalizedString(@"USB Prism2 error", "Error 
box title"),
                 NSLocalizedString(@"USB Prism2 error description", "LONG Error 
description"),
@@ -150,8 +159,10 @@
                 //"be canceled. Errors may have be printed to console.log."
                 OK, Nil, Nil);
 
-    } else
+    } else {
         _packets++;
+               _errors=0;
+       }
     
     return f;
 }


Other related posts:

  • » [kismac] [binaervarianz] r152 - in trunk: . AppleScript Samples Sources/Driver/USBIntersilJack Sources/WaveDrivers