client = osrf_system_get_transport_client();
+ osrf_message_set_json_parse(1);
/* main process loop */
char* request;
- //signal(SIGINT,sig_int_handler);
while((request=readline(prompt))) {
if( !strcmp(request, "exit") || !strcmp(request,"quit"))
osrf_message_free(last_result);
last_result = omsg;
- if( pretty_print ) {
- char* content = json_printer( omsg->result_content );
- buffer_add( resp_buffer, "\nReceived Data: " );
- buffer_add( resp_buffer, content );
- buffer_add( resp_buffer, "\n" );
- free(content);
- } else {
- char* content = json_object_get_string(omsg->result_content);
- buffer_add( resp_buffer, "\nReceived Data: " );
- buffer_add( resp_buffer, content );
- buffer_add( resp_buffer, "\n" );
- }
+ char* content;
+
+ if( pretty_print )
+ content = json_printer( omsg->result_content );
+ else
+ content = json_object_get_string(omsg->result_content);
+
+ buffer_add( resp_buffer, "\nReceived Data: " );
+ buffer_add( resp_buffer, content );
+ buffer_add( resp_buffer, "\n" );
+ free(content);
} else {
}
-
double end = get_timestamp_millis();
fprintf( less, resp_buffer->buf );