solved conflicts from merge of version being used to binary

This commit is contained in:
Dhanya Maliakal
2017-12-06 19:07:06 +01:00
47 changed files with 292 additions and 356 deletions

View File

@ -12,7 +12,7 @@
#include <getopt.h>
#include "slsReceiver.h"
//#include "UDPInterface.h"
#include "gitInfoReceiver.h"
using namespace std;
@ -23,34 +23,37 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success):
udp_interface (NULL)
{
success=OK;
// options
map<string, string> configuration_map;
int tcpip_port_no = 1954;
string fname = "";
int64_t tempval = 0;
//parse command line for config
static struct option long_options[] = {
// These options set a flag.
//{"verbose", no_argument, &verbose_flag, 1},
// These options dont set a flag. We distinguish them by their indices.
{"config", required_argument, 0, 'f'},
{"rx_tcpport", required_argument, 0, 't'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
// These options set a flag.
//{"verbose", no_argument, &verbose_flag, 1},
// These options dont set a flag. We distinguish them by their indices.
{"config", required_argument, 0, 'f'},
{"rx_tcpport", required_argument, 0, 't'},
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
// getopt_long stores the option index here.
int option_index = 0;
int c=0;
optind = 1;
int c = 0;
while ( c != -1 ){
c = getopt_long (argc, argv, "hf:t:", long_options, &option_index);
c = getopt_long (argc, argv, "hvf:t:", long_options, &option_index);
// Detect the end of the options.
if (c == -1)
break;
switch(c){
case 'f':
@ -63,17 +66,28 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success):
case 't':
sscanf(optarg, "%d", &tcpip_port_no);
break;
case 'v':
tempval = GITREV;
tempval = (tempval <<32) | GITDATE;
cout << "SLS Receiver " << GITBRANCH << " (0x" << hex << tempval << ")" << endl;
success = FAIL; // to exit
break;
case 'h':
string help_message = "\nSLS Receiver Server\n\n";
help_message += "Usage: slsReceiver [arguments]\nPossible arguments are:\n";
help_message += "\t-f, --config: Configuration filename\n";
help_message += "\t-t, --rx_tcpport: TCP Port with the client. Default: 1954.\n"
"\t Required for multiple receivers\n\n";
default:
string help_message = "\n"
+ string(argv[0]) + "\n"
+ "Usage: " + string(argv[0]) + " [arguments]\n"
+ "Possible arguments are:\n"
+ "\t-f, --config <fname> : Loads config from file\n"
+ "\t-t, --rx_tcpport <port> : TCP Communication Port with client. \n"
+ "\t Default: 1954. Required for multiple \n"
+ "\t receivers\n\n";
FILE_LOG(logINFO) << help_message << endl;
break;
}
}
@ -85,7 +99,7 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success):
}
catch(...){
FILE_LOG(logERROR) << "Coult not open configuration file " << fname ;
success = FAIL;
success = FAIL;
}
}

View File

@ -152,8 +152,8 @@ void slsReceiverTCPIPInterface::stop(){
int64_t slsReceiverTCPIPInterface::getReceiverVersion(){
int64_t retval = SVNREV;
retval= (retval <<32) | SVNDATE;
int64_t retval = GITREV;
retval= (retval <<32) | GITDATE;
return retval;
}