The content of the invention
The technical problems to be solved by the invention are to provide a kind of length by checking WIFI packets and realize that WIFI is set
Standby Internet-surfing configuration method.
A kind of length by checking WIFI packets realizes the Internet-surfing configuration method of WIFI equipment, comprises the following steps:
The data frame for configuration of surfing the Net is generated, the data frame includes predetermined fixed character string MAGIC-CODE, number
According to frame length, SSID length, SSID, encryption type and password;
The AES that data frame is consulted by configuring and being configured both sides, is encrypted, then by the number after encryption
It is transmitted according to frame, in transmission process, the number of the corresponding UDP message bag sent of length of data frame, each UDP message bag pair
The length answered is numerical value corresponding to each byte inside its data frame;
According to the MAC Address of WIFI equipment, the data for establishing different WIFI equipments respectively send the chained list of length;
Fixed character string MAGIC-CODE can be matched by checking whether;
If matching fixed character string, data frame is obtained;
Check whether verification summation checksum is correct, if correctly, obtaining SSID according to the data frame, encrypting class
Type and password.
The positive effect of the present invention is:Technique effect:
1st, the WIFI equipment being configured, on the premise of it need not add AD-HOC or AP functions, you can complete its online
Configuration, reduces the use of device resource
2nd, without external other communication interfaces, WIFI radio configurations are directly passed through
3rd, it is compatible well, need that the equipment that WIFI communicates can be supported for various, as long as being integrated with UDP communication protocols
View, you can realize to the configuration for the WIFI equipment being configured,
4th, solve the operating system that such as iOS is limited WIFI api interfaces, realize the allocation problem of WIFI equipment
5th, this collocation method is not limited by the cryptographic protocol (WEP, WPA, WPA2) of legacy network, because this method
It is that regardless of encryption method, packet content is encrypted, and data packet length is not come transmission information using the length of packet
Become.
Embodiment
The present invention is further detailed explanation with reference to the accompanying drawings and detailed description.
A kind of length by checking WIFI packets of the present invention realizes that the Internet-surfing configuration method of WIFI equipment is included such as
Lower step:
WIFI configurations equipment generates the data frame for configuration of surfing the Net, and the data frame includes predetermined fixed character string
MAGIC-CODE, data frame length, SSID length, SSID, encryption type and password;Optionally, the data frame also includes school
Test word.Optionally, the fixed character string, data frame length, SSID length, SSID, encryption type, password and check word is suitable
Sequence and the fixed character string, data frame length, SSID length, SSID, encryption type, the shared word of password or check word
Corresponding relation between joint number and represented value is default or exterior arrangement.
Data frame is encrypted by AES encryption algorithm.
Send the UDP message bag quantity of data frame length.As data frame length be 60, send 60 UDP, each UDP numbers
Numerical value according to the length of bag for the byte inside corresponding data frame, the content of UDP message bag is actually invalid content.
It is configured MAC Address of the WIFI equipment according to WIFI equipment, the data for establishing different WIFI equipments respectively send length
The chained list of degree;
It is configured WIFI equipment and checks whether that fixed character string MAGIC-CODE can be matched;
If matching fixed character string, it is configured WIFI equipment and then obtains data frame;
Whether correct it is configured WIFI equipment inspection verification summation checksum, if correctly, according to the data frame
Obtain SSID, encryption type and password.
Be configured WIFI equipment use the acquisition SSID, encryption type connected with password corresponding to WIFI AP networks,
And confirmation broadcast data is sent, confirm that configuration is completed.
The implementation of above-described embodiment is specifically illustrated below:
The online of WIFI equipment needs to obtain its connection AP SSID (maximum 32 bytes) first, encryption type (NONE,
WEP, WPA, WPA2), password.
For the equipment for being not yet connected to AP, although the packet of WIFI passages can be listened to, due to
Most of AP networks cannot obtain the actual data content of its transmission all by encryption, intelligently listen to transmission
The length of data.
Present invention design, it is exactly in its configuration WIFI equipment application program developed above, is sent out by WIFI network
UDP hash strings are sent, the length of different pieces of information string corresponds to our encoded contents, is configured equipment and listens to same WIFI to set
After standby (MAC Address differentiation) sends the serial data with configuration feature, its configuration information is obtained, realization is configured.
The present invention includes following several parts:The coding and hair of SSID, encryption type and password above configuration equipment
Send;The monitoring and information for being configured equipment parse.
First, the data frame composition of SSID, encryption type and password
We configure the AP of online SSID as needed first, encryption type, password, generate the required data transmitted
Frame, the composition of data frame is as shown in Figure 1.
MAGIC-CODE above, for configuration WIFI equipment and be configured WIFI equipment agreement fixed character string such as
(BLK) 3 bytes also, are taken for the initial code of mark data frame.
The length of data, 1 byte.
Check word, check whether data frame is correct, 2 bytes.Obtained by the way that the numerical value in all data frames is added.
SSID length, 1 byte
SSID, to need the SSID character strings of the AP on configuring
Encryption type:0none (is not encrypted), 1WEP encryptions, 2WPA encryptions, 3WPA2 encryptions, takes 1 byte.
Password:The remaining part of data frame is password string.
2nd, the transmission of data frame
The transmission of data, it is as follows by sending a string of UDP method of packet.
By each byte inside data frame, corresponding numerical value, the length of transmission UDP message bag.In data frame
Numerical value corresponding to character " 1 " is 31, then sends the UDP message bag of 31 bytes.
Such as:Some data frame length is 30, then cycles through 30 UDP packet, each UDP data packet length
The numerical value of its corresponding correspondence position.
3rd, the WIFI equipment being configured
The WIFI equipment being configured, each WIFI of scan round passage, intercept possible configuration data bag.
The flow intercepted:
According to the MAC Address of WIFI equipment, the data for establishing distinct device respectively send the chained list of length
MAGIC-CODE can be matched by checking whether
Obtain data frame
Check whether checksum is correct
Due in transmission process, other packets may be inserted, it is thus possible to which data frame is abnormal, it is necessary to circulate prison
Listen
4th, it is configured equipment connection WIFI network
After the WIFI equipment correct SSID of acquisition being configured, encryption type and password, WIFI AP corresponding to connection
Network, while confirmation broadcast data is sent, confirm that configuration is completed.
Technique effect:
By the method for foregoing invention, solve the problems, such as following
1st, the WIFI equipment being configured, on the premise of it need not add AD-HOC or AP functions, you can complete its online
Configuration, reduces the use of device resource
2nd, without external other communication interfaces, WIFI radio configurations are directly passed through
3rd, it is compatible well, need that the equipment that WIFI communicates can be supported for various, as long as being integrated with UDP communication protocols
View, you can realize to the configuration for the WIFI equipment being configured,
4th, solve the operating system that such as iOS is limited WIFI api interfaces, realize the allocation problem of WIFI equipment
Realization in order to demonstrate the invention, describe above-mentioned embodiment.But other changes of the present invention
Change and change, will be readily apparent to one having ordinary skill, in the range of essence disclosed in this invention and basic principle
Any modification/change or imitate conversion belong to the present invention claims.