X-Git-Url: http://git.smho.de/gw/?p=owTools.git;a=blobdiff_plain;f=src%2Fmain.cpp;fp=src%2Fmain.cpp;h=51fd6c092595231f9b132401db92063751aba7ce;hp=c4e223dee6ec7780333cd5096a14be4280dcea11;hb=f7b7cd722492679725b953a41717a3109c81813d;hpb=8b3ce8126a8bbc16822e939bc46f513e1c52b3d3 diff --git a/src/main.cpp b/src/main.cpp index c4e223d..51fd6c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -129,6 +129,7 @@ printf(" [database]\n"); printf(" [prefix] -> a prefix of all tables \n\n"); printf(" -r Search every time for new Devices\n"); printf(" -t [text_file] append comma separadet to text-file\n"); +printf(" -j Use 0xCC 0x44 to send convert temperature to all DS18B20 and DS2438\n"); printf(" -f [hexfile] flash new\n"); printf(" -n [\"id as 64bit Hex\"] change id \n"); printf(" example: -n \"5D02160084D9A220\" \n"); @@ -318,11 +319,13 @@ void continuous(std::vector *devices,int intervall,int headline,int s for (owDevice* dev :*devices) { for(int k=0;kmaxrepeat;k++){ - //std::vector data; - //data.push_back(0xCC); - //data.push_back(0x44); - //owi->Reset(); - //owi->Communicate(&data, 2, 0); + if (owCC_44_Temp>0) { + std::vector data; + data.push_back(0xCC); + data.push_back(0x44); + owi->Reset(); + owi->Communicate(&data, 2, 0); + } dev->convertAll(); if (owi->log->last()log->clear(); @@ -610,6 +613,10 @@ int main(int argc, char *argv[]) { interactive(owi); } else if (getArg("c")=="1") { + if (getArg("j")=="1") { + printf("Use 1-Wire command 0xCC 0x44 to send convert temperature to all DS18B20 and DS2438\n"); + owCC_44_Temp=1; + } int reload=(getArg("r")=="1"); owi->Find(); printf("\n"); @@ -829,8 +836,12 @@ int main(int argc, char *argv[]) { } else { unsigned long long l=strtoull(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); + printf("This command change family-fode of Device 0x%02X->0x%02X\n",(int)(snum.num&0xFF),(int)(l&0xFF)); + int resetid=questionYesNo("Are you sure?"); + if (resetid==0) { + 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);