Ognian / sdmon

get SD card health data
https://www.ogi-it.com/portfolio/sdmon/
GNU General Public License v2.0
100 stars 18 forks source link

Json can be invalid due to missing commas #7

Open EternityForest opened 2 years ago

EternityForest commented 2 years ago

In some cases, like when using a normal SD card that doesn't support the instructions, you get output like this, where commas are missing.

{
"version": "v0.4.0 (6778785) armv7",
"date": "2022-07-26T10:22:21.000Z",
"device":"/dev/mmcblk0",
"read_via_cmd56_arg_1":"not implemented: Operation timed out"
"idata.response[]":"0x900 0x00 0x00 0x00",
"error2":"2nd CMD56 CALL FAILED: Operation timed out"
}
Ognian commented 2 years ago

Thanks for reporting. This particular one should already be fixed in v0.4.1 and above. Actually I should implement some helper function to generate the proper JSON output from an array, then errors like this one would be gone...