Beautify: replace tabs with spaces and remove trailing spaces
This commit is contained in:
@ -19,13 +19,13 @@ main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
size_t buff_len, len;
|
||||
int result, normalized = 0;
|
||||
unsigned char raw_buff[4096], buff[4096];
|
||||
mbus_frame reply;
|
||||
mbus_frame_data frame_data;
|
||||
char *xml_result = NULL, *file = NULL;
|
||||
int result, normalized = 0;
|
||||
unsigned char raw_buff[4096], buff[4096];
|
||||
mbus_frame reply;
|
||||
mbus_frame_data frame_data;
|
||||
char *xml_result = NULL, *file = NULL;
|
||||
|
||||
if (argc == 3 && strcmp(argv[1], "-n") == 0)
|
||||
if (argc == 3 && strcmp(argv[1], "-n") == 0)
|
||||
{
|
||||
file = argv[2];
|
||||
normalized = 1;
|
||||
@ -60,16 +60,16 @@ main(int argc, char *argv[])
|
||||
|
||||
buff_len = mbus_hex2bin(buff,sizeof(buff),raw_buff,sizeof(raw_buff));
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
memset(&frame_data, 0, sizeof(frame_data));
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
memset(&frame_data, 0, sizeof(frame_data));
|
||||
|
||||
//mbus_parse_set_debug(1);
|
||||
//mbus_parse_set_debug(1);
|
||||
|
||||
result = mbus_parse(&reply, buff, buff_len);
|
||||
result = mbus_parse(&reply, buff, buff_len);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
fprintf(stderr, "mbus_parse: %s\n", mbus_error_str());
|
||||
if (result < 0)
|
||||
{
|
||||
fprintf(stderr, "mbus_parse: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
else if (result > 0)
|
||||
@ -80,10 +80,10 @@ main(int argc, char *argv[])
|
||||
|
||||
result = mbus_frame_data_parse(&reply, &frame_data);
|
||||
|
||||
if (result != 0)
|
||||
{
|
||||
mbus_frame_print(&reply);
|
||||
fprintf(stderr, "mbus_frame_data_parse: %s\n", mbus_error_str());
|
||||
if (result != 0)
|
||||
{
|
||||
mbus_frame_print(&reply);
|
||||
fprintf(stderr, "mbus_frame_data_parse: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -97,11 +97,10 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
}
|
||||
printf("%s", xml_result);
|
||||
free(xml_result);
|
||||
mbus_data_record_free(frame_data.data_var.record);
|
||||
printf("%s", xml_result);
|
||||
free(xml_result);
|
||||
mbus_data_record_free(frame_data.data_var.record);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user