mirror of
http://180.163.74.83:13000/zhangzhenghao/AP05.git
synced 2025-12-12 15:04:29 +00:00
fix T->t modify getLocalip upto v1.1.8
This commit is contained in:
parent
103d478ba7
commit
b2805dfefe
2
cp.sh
2
cp.sh
@ -1,4 +1,4 @@
|
||||
sshpass -p "PddloTSecPwdOnly!" scp ./output/bin/tx_server root@10.10.10.225:/home/linaro/
|
||||
sshpass -p "PddloTSecPwdOnly!" scp ./output/bin/tx_server root@192.168.0.148:/home/linaro/
|
||||
#sshpass -p "PddloTSecPwdOnly!" scp ./output/bin/tx_server root@10.10.10.132:/root/
|
||||
#sshpass -p "PddloTSecPwdOnly!" scp ./start.sh root@10.10.10.225:/root/
|
||||
#sshpass -p "PddloTSecPwdOnly!" scp ./start.sh root@10.10.10.132:/root/
|
||||
|
||||
21
main.c
21
main.c
@ -36,7 +36,7 @@ int fd;
|
||||
int UPCASE=0;
|
||||
int count_value=0;
|
||||
int getPayloadTime=120*1000;//usecond
|
||||
char softwareVersion[16]="1.1.7";
|
||||
char softwareVersion[16]="1.1.8";
|
||||
char stationsn[16]="TJ251372224247";//TJ250995217957
|
||||
char productid[8]="10045";
|
||||
char appKey[32]="fdhQmhqhvbL1cf1K9mUqt";
|
||||
@ -334,7 +334,7 @@ int readQrcode()
|
||||
if(UPCASE==1){
|
||||
input_value[count_value]='T';
|
||||
}else{
|
||||
input_value[count_value]='t';
|
||||
input_value[count_value]='T';
|
||||
}
|
||||
UPCASE=0;
|
||||
count_value++;
|
||||
@ -1447,9 +1447,13 @@ void hmacsha1(char *key,char* data,char *signbase64,int signbase64_len){
|
||||
|
||||
void getLocalIp(char *local_ip){
|
||||
char hostname[32]={0};
|
||||
gethostname(hostname,32);
|
||||
LOG_I("hostname:%s\n",hostname);
|
||||
get_ip_by_domain(hostname, local_ip, 32);
|
||||
FILE *fp;
|
||||
char buffer[64]={0};
|
||||
//get_ip_by_domain(hostname, local_ip, 32);
|
||||
fp=popen("ifconfig eth0 | grep 'inet' | awk '{print $2}' | cut -d':' -f2","r");
|
||||
fgets(buffer,sizeof(buffer),fp);
|
||||
LOG_I("buffer:%s\n",buffer);
|
||||
memcpy(local_ip,buffer,strlen(buffer)-1);
|
||||
}
|
||||
|
||||
void saveStartUpTime(){
|
||||
@ -1602,7 +1606,12 @@ int main(int argc, char *argv[])
|
||||
readresult=NULL;
|
||||
LOG_I("saved mqttRawPassword:%s\n",mqttRawPassword);
|
||||
}else{
|
||||
getDevRawPassword(stationsn);
|
||||
if((ping("8.8.8.8") == 0)||(ping("8.8.4.4") == 0)){
|
||||
getDevRawPassword(stationsn);
|
||||
}else{
|
||||
LOG_I("getDevRawPassword net not ready\n");
|
||||
sleep(3);
|
||||
}
|
||||
}
|
||||
|
||||
readresult=file_to_buffer("LightEnable",&len);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
. compile.sh
|
||||
rm -fr output
|
||||
mkdir output
|
||||
#rm -fr output
|
||||
#mkdir output
|
||||
cd output
|
||||
cmake ..
|
||||
make
|
||||
|
||||
Loading…
Reference in New Issue
Block a user