printf(" [prefix] -> a prefix of all tables \n\n");
printf(" -r Search every time for new Devices\n");
printf(" -f [hexfile] flash new\n");
-printf(" -n change id \n");
+printf(" -n [\"id as 64bit Hex\"] change id \n");
+printf(" example: -n \"5D02160084D9A220\" \n");
+printf(" no argument increments id by 256 (keep family code) \n");
printf(" -g get from server\n");
printf(" -w [1|2] show Warnings (1) or all information (2)\n");
printf(" -m memory functions\n");
if(adapter.find("COM")!=std::string::npos) {
owi=new owCOMInterface();
int port=atoi(adapter.substr(adapter.find("COM")+3).c_str());
- printf("Open /dev/ttyS%i\n",port);
+ printf("Open /dev/ttyUSB%i\n",port);
owi->InitAdapter(port);
} else
if(adapter.find("USB")!=std::string::npos) {
sel-=1;
snum_t snum=owi->devices[sel]->getNum();
+
if ((getArg("g"))=="1") {
printf("get ID from Server\n");
char s[255];
snum.num=isnum.num;
} else (printf("ERROR %i\n",err));
} else {
- snum.num+=256;
+ if (s=="1") {
+ snum.num+=256;
+ } else {
+ unsigned long long l=strtol(s.c_str(),NULL,16);
+ if ((snum.num&0xFF)!=(l&0xFF)) {
+ printf("ERROR: Family of Device 0x%02X->0x%02X can not be changed\n",(int)(snum.num&0xFF),(int)(l&0xFF));
+ exit(1);
+ }
+ snum.num=l;
+ //printf("->%016llX\n",(unsigned long long)l);
+ }
+
}
FD_SET(fd,&filedescr);
// set timeout to 10ms
tval.tv_sec = 0;
- tval.tv_usec = 10000;
+ tval.tv_usec = 20000;
// if byte available read or return bytes read
if (select(fd+1,&filedescr,NULL,NULL,&tval) != 0)
}
}
else {
- log->set(OWLOG_ERROR,"Read Error on Serial (select)");
+ log->set(OWLOG_ERROR,"Read Error on Serial (select) (new time)");
return cnt;
}
}
close(fd);
}
}
-
+
//---------------------------------------------------------------------------
// Attempt to resyc and detect a DS2480B