set searchTimeOut 20 scan QR support

This commit is contained in:
hyx 2025-05-10 13:36:57 +08:00
parent 561f2e923f
commit ccf35b5539
2 changed files with 7 additions and 6 deletions

9
main.c
View File

@ -690,11 +690,11 @@ void writeNetworkInterface(char *filename,char *dest){
buffer_to_file(filename,"\n",strlen("\n"),"a");
buffer_to_file(filename,"iface eth0 inet dhcp",strlen("iface eth0 inet dhcp"),"a");
buffer_to_file(filename,"\n",strlen("\n"),"a");
buffer_to_file(filename,"# address 10.10.12.12",strlen("# address 10.10.12.12"),"a");
buffer_to_file(filename,"# address 192.168.1.100",strlen("# address 192.168.1.100"),"a");
buffer_to_file(filename,"\n",strlen("\n"),"a");
buffer_to_file(filename,"# netmask 255.255.255.0",strlen("# netmask 255.255.255.0"),"a");
buffer_to_file(filename,"\n",strlen("\n"),"a");
buffer_to_file(filename,"# gateway 10.10.12.1",strlen("# gateway 10.10.12.1"),"a");
buffer_to_file(filename,"# gateway 192.168.1.1",strlen("# gateway 192.168.1.1"),"a");
buffer_to_file(filename,"\n",strlen("\n"),"a");
buffer_to_file(filename,"hwaddress ether ",strlen("hwaddress ether "),"a");
buffer_to_file(filename,dest,strlen(dest),"a");
@ -785,7 +785,7 @@ void *actHandleQrcode(void *parm){
}
#endif
}else{
#if 0
#if 1
if(strstr(str,"TJ")!=NULL && strlen(str)==27){
LOG_I("ok\n");
char *result=NULL;
@ -801,6 +801,7 @@ void *actHandleQrcode(void *parm){
char* destmac = insert_colon(result, 2);
LOG_I("save mac:%s\n",destmac);
writeNetworkInterface("/etc/network/interfaces",destmac);
writeNetworkInterface("/etc/network/interfaces.default",destmac);
}
result=strtok_r(NULL,",",&p);
}
@ -1600,7 +1601,7 @@ void test_search(void){
isLightOnByRule=false;
isLabelUp=false;
isSearchLabel=true;
searchTimeOut=10;
searchTimeOut=20;
LOG_I("searchTimeOut:%d\n",searchTimeOut);
searchTimeOld=getCurrentTime();
LOG_I("searchTimeOld:%d\n",searchTimeOld);

View File

@ -1,6 +1,6 @@
. compile.sh
#rm -fr output
#mkdir output
rm -fr output
mkdir output
cd output
cmake ..
make