Remove trailing whitespace
Signed-off-by: Stefan Wahren <info@lategoodbye.de>
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
// Copyright (C) 2010, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
@ -49,13 +49,13 @@ main(int argc, char *argv[])
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
len = fread(buf, 1, sizeof(buf), fp);
|
||||
|
||||
|
||||
if (ferror(fp) != 0)
|
||||
{
|
||||
fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
fclose(fp);
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
@ -63,9 +63,9 @@ main(int argc, char *argv[])
|
||||
mbus_parse(&reply, buf, len);
|
||||
mbus_frame_data_parse(&reply, &frame_data);
|
||||
mbus_frame_print(&reply);
|
||||
|
||||
|
||||
xml_result = normalized ? mbus_frame_data_xml_normalized(&frame_data) : mbus_frame_data_xml(&frame_data);
|
||||
|
||||
|
||||
if (xml_result == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
|
||||
@ -73,7 +73,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
printf("%s", xml_result);
|
||||
free(xml_result);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Copyright (C) 2010, Raditex AB
|
||||
// All rights reserved.
|
||||
//
|
||||
// rSCADA
|
||||
// rSCADA
|
||||
// http://www.rSCADA.se
|
||||
// info@rscada.se
|
||||
//
|
||||
@ -24,7 +24,7 @@ main(int argc, char *argv[])
|
||||
mbus_frame reply;
|
||||
mbus_frame_data frame_data;
|
||||
char *xml_result = NULL, *file = NULL;
|
||||
|
||||
|
||||
if (argc == 3 && strcmp(argv[1], "-n") == 0)
|
||||
{
|
||||
file = argv[2];
|
||||
@ -46,25 +46,25 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "%s: failed to open '%s'\n", argv[0], file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
memset(raw_buff, 0, sizeof(raw_buff));
|
||||
len = fread(raw_buff, 1, sizeof(raw_buff), fp);
|
||||
|
||||
|
||||
if (ferror(fp) != 0)
|
||||
{
|
||||
fprintf(stderr, "%s: failed to read '%s'\n", argv[0], file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
fclose(fp);
|
||||
|
||||
|
||||
buff_len = mbus_hex2bin(buff,sizeof(buff),raw_buff,sizeof(raw_buff));
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
memset(&frame_data, 0, sizeof(frame_data));
|
||||
|
||||
|
||||
//mbus_parse_set_debug(1);
|
||||
|
||||
|
||||
result = mbus_parse(&reply, buff, buff_len);
|
||||
|
||||
if (result < 0)
|
||||
@ -77,21 +77,21 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "mbus_parse: need %d more bytes\n", result);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
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());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//mbus_frame_print(&reply);
|
||||
//mbus_frame_data_print(&frame_data);
|
||||
|
||||
|
||||
xml_result = normalized ? mbus_frame_data_xml_normalized(&frame_data) : mbus_frame_data_xml(&frame_data);
|
||||
|
||||
|
||||
if (xml_result == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to generate XML representation of MBUS frame: %s\n", mbus_error_str());
|
||||
@ -100,7 +100,7 @@ main(int argc, char *argv[])
|
||||
printf("%s", xml_result);
|
||||
free(xml_result);
|
||||
mbus_data_record_free(frame_data.data_var.record);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user