Sets the timeout to 5 after connection,
[goodfet] / client / GoodFET.py
index 98c2494..12fad0b 100755 (executable)
@@ -150,6 +150,7 @@ class GoodFET:
                     break;
         if self.verbose: print "Connected after %02i attempts." % attempts;
         self.mon_connected();
+        self.serialport.setTimeout(5);
     def telosSetSCL(self, level):
         self.serialport.setRTS(not level)
     def telosSetSDA(self, level):
@@ -478,6 +479,30 @@ class GoodFET:
             if self.verbose: print "Comm error recognized by monitorecho().";
             return 0;
         return 1;
+
+    def monitor_info(self):
+        print "GoodFET with %s MCU" % self.infostring();
+        print "Clocked at %s" % self.monitorclocking();
+        return 1;
+
+    def monitor_list_apps(self, full=False): 
+        self.monitor_info()
+        old_value = self.besilent
+        self.besilent = True    # turn off automatic call to readcmd
+        self.writecmd(self.MONITORAPP, 0x82, 1, [int(full)]);
+        self.besilent = old_value
+        
+        # read the build date string 
+        self.readcmd()
+        print "Build Date: %s" % self.data
+        print "Firmware apps:"
+        while True:
+            self.readcmd()
+            if self.count == 0:
+                break
+            print self.data
+        return 1;
+
     def monitorclocking(self):
         """Return the 16-bit clocking value."""
         return "0x%04x" % self.monitorgetclock();