]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tools/tinyos/misc/tos-deluge
Add checks for the image format from tos_image.xml (problem reported by Jonathan...
[tinyos-2.x.git] / tools / tinyos / misc / tos-deluge
index aedea410150606b18c53b3918897ffab750d4859..f3fa97652afeebf8cc7ba80e0bd3d8c7b810c8f3 100755 (executable)
@@ -345,8 +345,9 @@ def op_inject(s, img_num, tos_image_xml):
     print "--------------------------------------------------"
     
     # Writes the new binary image
-    if op_erase(s, img_num):
-        if op_write(s, img_num, p.stdout.read()):
+    image = p.stdout.read()
+    if len(image) > 0 and op_erase(s, img_num):
+        if op_write(s, img_num, image):
             if op_sync(s, img_num):
                 print "--------------------------------------------------"
                 metadata = getMetaData(s, img_num)