]> git.earman.xyz Git - sensor-watch.git/commitdiff
add ability to delete via IrDA
authorJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 May 2025 22:07:59 +0000 (18:07 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 May 2025 22:08:30 +0000 (18:08 -0400)
watch-faces/io/irda_upload_face.c

index 89fc328268ecfe9acb18326e0c43ec7608135e56..4f6c9ef54ac6376853efeb71b71929c34a0fe1fc 100644 (file)
@@ -90,6 +90,13 @@ bool irda_upload_face_loop(movement_event_t event, void *context) {
                 // so that now buf[2] points to our null-terminated filename.
                 char *filename = data + 2;
 
+                if (expected_size == 0) {
+                    filesystem_rm(filename);
+                    watch_display_text_with_fallback(WATCH_POSITION_TOP, "FILE ", "FI");
+                    watch_display_text_with_fallback(WATCH_POSITION_TOP, "dELETE", " delet");
+                    break;
+                }
+
                 // now let's check the data.
                 checksum = 0;
                 memcpy(&expected_checksum, data + 16 + expected_size, 2);