设备文档更新
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
|
@ -0,0 +1,88 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <stdio.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SVR "192.168.168.1"
|
||||
#define PORT "8899"
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
int sockfd;
|
||||
int len;
|
||||
struct sockaddr_in address;
|
||||
int result;
|
||||
int i,byte;
|
||||
char char_send[512] = { 0 };
|
||||
char file_name[100] = {0};
|
||||
FILE * file;
|
||||
char buf[40960]={0};
|
||||
|
||||
if((sockfd = socket(AF_INET, SOCK_STREAM, 0))==-1)
|
||||
{
|
||||
perror("socket");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if((sockfd = socket(AF_INET,SOCK_STREAM,0)) == -1){
|
||||
perror("sock");
|
||||
exit(1);
|
||||
}
|
||||
bzero(&address,sizeof(address));
|
||||
address.sin_family = AF_INET;
|
||||
address.sin_port = htons(atoi(PORT));
|
||||
inet_pton(AF_INET,SVR,&address.sin_addr);
|
||||
len = sizeof(address);
|
||||
|
||||
if((result = connect(sockfd, (struct sockaddr *)&address, len))==-1)
|
||||
{
|
||||
perror("connect");
|
||||
close(sockfd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while(1){
|
||||
|
||||
printf("please input xml file name or exit to quit\n");
|
||||
|
||||
scanf("%s",file_name);
|
||||
|
||||
while ('\n' != getchar() );
|
||||
|
||||
if(strcmp(file_name,"exit") ==0)
|
||||
goto exit;
|
||||
|
||||
file = fopen(file_name,"r+b");
|
||||
|
||||
memset(char_send,0,512);
|
||||
fread(char_send,1,512,file);
|
||||
|
||||
fclose(file);
|
||||
|
||||
printf("send = %s\n",char_send);
|
||||
if((byte=send(sockfd,char_send,strlen(char_send),0))==-1)
|
||||
{
|
||||
printf("send error\n");
|
||||
close(sockfd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
char_send[0] = 0;
|
||||
memset(buf,0,40960);
|
||||
if((byte=recv(sockfd,buf,40960,0))==-1)
|
||||
{
|
||||
printf("recv error");
|
||||
close(sockfd);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
printf("recv = %s\n",buf);
|
||||
}
|
||||
exit:
|
||||
close(sockfd);
|
||||
exit(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><CMD_REQ code=1 index=1/>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><CMD_REQ code=2 index=2> <SSID>创凌WI-FI</SSID> <PASSWORD>12345678</PASSWORD> </CMD_REQ>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><CMD_REQ code=2 index=2> <SSID>TROLink_YF</SSID> <PASSWORD>12345678</PASSWORD> </CMD_REQ>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><CMD_REQ code=3 index=3/>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?> <CMD_REQ code=1 index=1/>
|
||||
<?xml version="1.0" encoding="utf-8"?> <CMD_REQ code=3 index=3/>
|
||||
<?xml version="1.0" encoding="utf-8"?><CMD_REQ code=2 index=2> <SSID>TROLink_YF</SSID> <PASSWORD>12345678</PASSWORD> </CMD_REQ>
|
||||
<?xml version="1.0" encoding="utf-8"?><CMD_REQ code=2 index=2> <SSID>zhouwu test www</SSID> <PASSWORD>12345678</PASSWORD> </CMD_REQ>
|
||||
|
||||
|
||||
|
||||
|
||||
the 3 ap info is <AP index = "3"><SSID>WSH-Link-0B85</SSID><ENCRYP_MODE>WPA1PSKWPA2PSK/AES</ENCRYP_MODE><SIGNAL>100</SIGNAL></AP>
|
||||
function 1 start!
|
||||
the 0 ap info is <AP index = "0"><SSID>Feixun_1C6A63</SSID><ENCRYP_MODE>WPA1PSKWPA2PSK/AES</ENCRYP_MODE><SIGNAL>50</SIGNAL></AP>
|
||||
the 1 ap info is <AP index = "1"><SSID>TROLink_YF</SSID><ENCRYP_MODE>WPA1PSKWPA2PSK/TKIPAES</ENCRYP_MODE><SIGNAL>100</SIGNAL></AP>
|
||||
the 2 ap info is <AP index = "2"><SSID>TP-LINK_AEA22E</SSID><ENCRYP_MODE>WPA1PSKWPA2PSK/TKIPAES</ENCRYP_MODE><SIGNAL>100</SIGNAL></AP>
|
||||
the 3 ap info is <AP index = "3"><SSID>WSH-Link-0B85</SSID><ENCRYP_MODE>WPA1PSKWPA2PSK/AES</ENCRYP_MODE><SIGNAL>100</SIGNAL></AP>
|
||||
[ 1017.690000] AP SETKEYS DONE - WPA2, AuthMode(7)=WPA2PSK, WepStatus(6)=AES, GroupWepStatus(4)=TKIP
|
||||
[ 1017.690000]
|
||||
[ 1020.890000] Rcv Wcid(1) AddBAReq
|
||||
[ 1020.890000] Start Seq = 00000037
|
||||
recvbuf place error!
|
||||
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 64 KiB |