mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-15 14:27:13 +02:00
Merge branch 'moench' of https://github.com/slsdetectorgroup/slsDetectorPackage into moench
This commit is contained in:
@ -4110,10 +4110,13 @@ int slsDetector::configureMAC() {
|
|||||||
//converting IPaddress to hex
|
//converting IPaddress to hex
|
||||||
stringstream ss(arg[0]);
|
stringstream ss(arg[0]);
|
||||||
char cword[50]="";
|
char cword[50]="";
|
||||||
bzero(cword, 50);
|
memset(cword, 0, sizeof(cword));
|
||||||
string s;
|
string s;
|
||||||
while (getline(ss, s, '.')) {
|
while (getline(ss, s, '.')) {
|
||||||
sprintf(cword,"%s%02x",cword,atoi(s.c_str()));
|
char temp[20]="";
|
||||||
|
memset(temp, 0, sizeof(temp));
|
||||||
|
sprintf(temp,"%02x",atoi(s.c_str()));
|
||||||
|
strcat(cword, temp);
|
||||||
}
|
}
|
||||||
bzero(arg[0], 50);
|
bzero(arg[0], 50);
|
||||||
strcpy(arg[0],cword);
|
strcpy(arg[0],cword);
|
||||||
@ -4126,12 +4129,12 @@ int slsDetector::configureMAC() {
|
|||||||
//converting MACaddress to hex
|
//converting MACaddress to hex
|
||||||
stringstream ss(arg[1]);
|
stringstream ss(arg[1]);
|
||||||
char cword[50]="";
|
char cword[50]="";
|
||||||
bzero(cword, 50);
|
memset(cword, 0, sizeof(cword));
|
||||||
string s;
|
string s;
|
||||||
while (getline(ss, s, ':')) {
|
while (getline(ss, s, ':')) {
|
||||||
sprintf(cword,"%s%s",cword,s.c_str());
|
strcat(cword, s.c_str());
|
||||||
}
|
}
|
||||||
bzero(arg[1], 50);
|
memset(arg[1], 0, sizeof(arg[1]));
|
||||||
strcpy(arg[1],cword);
|
strcpy(arg[1],cword);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<<"receiver mac:"<<arg[1]<<"."<<std::endl;
|
std::cout<<"receiver mac:"<<arg[1]<<"."<<std::endl;
|
||||||
@ -4145,12 +4148,12 @@ int slsDetector::configureMAC() {
|
|||||||
{
|
{
|
||||||
stringstream ss(arg[3]);
|
stringstream ss(arg[3]);
|
||||||
char cword[50]="";
|
char cword[50]="";
|
||||||
bzero(cword, 50);
|
memset(cword, 0, sizeof(cword));
|
||||||
string s;
|
string s;
|
||||||
while (getline(ss, s, ':')) {
|
while (getline(ss, s, ':')) {
|
||||||
sprintf(cword,"%s%s",cword,s.c_str());
|
strcat(cword, s.c_str());
|
||||||
}
|
}
|
||||||
bzero(arg[3], 50);
|
memset(arg[3], 0, sizeof(arg[3]));
|
||||||
strcpy(arg[3],cword);
|
strcpy(arg[3],cword);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<<"detecotor mac:"<<arg[3]<<"."<<std::endl;
|
std::cout<<"detecotor mac:"<<arg[3]<<"."<<std::endl;
|
||||||
@ -4161,12 +4164,15 @@ int slsDetector::configureMAC() {
|
|||||||
//converting IPaddress to hex
|
//converting IPaddress to hex
|
||||||
stringstream ss(arg[4]);
|
stringstream ss(arg[4]);
|
||||||
char cword[50]="";
|
char cword[50]="";
|
||||||
bzero(cword, 50);
|
memset(cword, 0, sizeof(cword));
|
||||||
string s;
|
string s;
|
||||||
while (getline(ss, s, '.')) {
|
while (getline(ss, s, '.')) {
|
||||||
sprintf(cword,"%s%02x",cword,atoi(s.c_str()));
|
char temp[20]="";
|
||||||
|
memset(temp, 0, sizeof(temp));
|
||||||
|
sprintf(temp,"%02x",atoi(s.c_str()));
|
||||||
|
strcat(cword, temp);
|
||||||
}
|
}
|
||||||
bzero(arg[4], 50);
|
memset(arg[4], 0, sizeof(arg[4]));
|
||||||
strcpy(arg[4],cword);
|
strcpy(arg[4],cword);
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<<"detector ip:"<<arg[4]<<"."<<std::endl;
|
std::cout<<"detector ip:"<<arg[4]<<"."<<std::endl;
|
||||||
|
Reference in New Issue
Block a user