Skip to content

Commit 25e82e9

Browse files
committed
When getting device info, look at all strings in the received data buffer, not just the one that write may have chosen to return
Fix espruino/BangleApps#3771
1 parent 3ec8e28 commit 25e82e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

js/comms.js

+6
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ const Comms = {
252252
cmd = `\x10${device}.print("[");require("Storage").list(/\\.info$/).forEach(f=>{var j=require("Storage").readJSON(f,1)||{};${device}.print(JSON.stringify({id:f.slice(0,-5),version:j.version,files:j.files,data:j.data,type:j.type})+",")});${device}.println(${finalJS})\n`;
253253
Puck.write(cmd, (appListStr,err) => {
254254
Progress.hide({sticky:true});
255+
if (!appListStr) appListStr="";
256+
var connection = Puck.getConnection();
257+
if (connection) {
258+
appListStr = appListStr+"\n"+connection.received; // add *any* information we have received so far, including what was returned
259+
connection.received = ""; // clear received data just in case
260+
}
255261
// we may have received more than one line - we're looking for an array (starting with '[')
256262
var lines = appListStr ? appListStr.split("\n").map(l=>l.trim()) : [];
257263
var appListJSON = lines.find(l => l[0]=="[");

0 commit comments

Comments
 (0)