add option --json to pref show

This commit is contained in:
Philippe Teuwen committed 2024-10-14 21:49:40 +02:00
1 parent 4dea606468
commit 0961b01950
5 files changed
+31

No files matched your search

+11
View File
@@ -818,6 +818,17 @@ int saveFileJSONrootEx(const char *preferredName, const void *root, size_t flags
return PM3_EFILE;
}
char *sprintJSON(JSONFileType ftype, uint8_t *data, size_t datalen, bool verbose, void (*callback)(json_t *)) {
json_t *root = json_object();
if (prepareJSON(root, ftype, data, datalen, verbose, callback) != PM3_SUCCESS) {
return NULL;
}
char *s = json_dumps(root, JSON_INDENT(2));
json_decref(root);
return s;
}
// wave file of trace,
int saveFileWAVE(const char *preferredName, const int *data, size_t datalen) {