added reporting function
@@ -70,6 +70,25 @@ static struct timespec ts;
#endif
static int quit;
+
+/**
+* function to print the returned cbor as JSON
+*
+*/
+void
+print_rep(oc_rep_t* rep, bool pretty_print)
+{
+ char* json;
+ size_t json_size;
+ json_size = oc_rep_to_json(rep, NULL, 0, pretty_print);
+ json = (char*)malloc(json_size + 1);
+ oc_rep_to_json(rep, json, json_size + 1, pretty_print);
+ printf("%s\n", json);
+ free(json);
+}
+
+
+
static void
display_menu(void)
{
