Rihards Balass / 4DGL-mbed-32PTU
Revision:
23:dd2c28fa4dfd
Parent:
22:cea582ea74c1
Child:
26:c6a803706a42
--- a/Picaso_4DGL-32PTU_Response.cpp	Tue Sep 27 08:48:08 2016 +0000
+++ b/Picaso_4DGL-32PTU_Response.cpp	Tue Sep 27 10:45:38 2016 +0000
@@ -276,3 +276,22 @@
     return error;
 }
 
+//**************************************************************************
+short PICASO_4DGL :: getFilenameResponse(char *out) {
+    
+    int i, j = 3;
+#if DEBUGMODE
+    pc.printf("\n\r DEBUG: Wait for filename answer");
+#endif
+    while (index < 3) wait_ms(100); // wait for screen answer
+    short len = rxBuf[1] << 8 | rxBuf[2];
+    //char *filename;
+    //filename = (char *)malloc(sizeof(char) * len);
+    //for(i = 0; i < size; i++) filename[i] = 0;
+    while (index < 3 + len) wait_ms(100); // wait for whole answer
+    for (i = 0; i < len; i++)
+        out[i] = rxBuf[j++]; // build filename string
+    
+    return len;
+}
+