WiFi collocation method
Technical field
The present invention relates to a kind of method for carrying out WiFi configuration.
Background technology
Along with various intelligent home devices and Intelligent worn device wide variety of today, need a kind of practicable, and there is a kind of comparatively safe and that relative time is shorter method, realize being connected by smart machine by various instruments such as mobile phones the router of upper correspondence.
Summary of the invention
It is an object of the invention to provide a kind of method that can realize WiFi configuration easily, effectively solve the WiFi allocation problem of smart machine.
For reaching above-mentioned purpose, the technical solution used in the present invention is:
A kind of WiFi collocation method, for the second smart machine being connected to router by the first smart machine, described WiFi collocation method is: described first smart machine sends the data message comprising described route-map in the way of udp broadcast, described router receives and forwards described data message, after described second smart machine is completely received described data message, resolves and obtain the route-map comprised in described data message and be connected to the described router of correspondence according to described route-map.
Preferably, described first smart machine cycles through described data message.
Preferably, each character in described data message or data all adopt two packets to send, and described packet has uniqueness and can identification.
Preferably, described data message comprises the AP name of described router and corresponding password.
Preferably, described first smart machine first sends two condition codes and detects for described router, until by being then turned on performing described WiFi collocation method after detecting.
Described first smart machine is mobile phone or panel computer.
Described second smart machine is intelligent home device or Intelligent worn device.
Owing to technique scheme is used, the present invention compared with prior art has the advantage that the present invention can realize WiFi configuration convenient, rapidly, efficiently solves the WiFi allocation problem of smart machine.
Accompanying drawing explanation
Accompanying drawing 1 is the schematic flow sheet of the WiFi collocation method of the present invention.
Detailed description of the invention
Below in conjunction with embodiment shown in the drawings, the invention will be further described.
Embodiment one: shown in accompanying drawing 1, a kind of WiFi collocation method for the second smart machine being connected to by the first smart machine router, for: the first smart machine sends the data message comprising route-map in the way of udp broadcast, router receives and forwards data message, after second smart machine is completely received data message, resolves and obtain the route-map comprised in data message and be connected to the router of correspondence according to route-map.
Concrete, the first smart machine is mobile phone or panel computer, and the second smart machine is intelligent home device or Intelligent worn device.
Before carrying out WiFi configuration, the first smart machine first sends two condition codes and detects for router, until by being then turned on execution WiFi collocation method after detecting.
When performing WiFi configuration, in view of the packet loss of broadcast packet, the first smart machine cycles through data message, until the second smart machine to receive this data message complete. Data message comprises the AP name of router and corresponding password, and each character or the data in data message all adopt two packets to send, packet have uniqueness and can identification, the information between corresponding two packets needs to receive could completely resolve this character or data. The process that the two packet sends allows packet loss, it is allowed to order entanglement. If the second smart machine as receiving terminal does not receive when first round data message sends completely, continue cycling through second and take turns transmission and resolve, until confirming that total data information receives.
Above-mentioned WiFi collocation method has taken into account the restriction of various router feature and the limitation of the technology of smart machine itself, it it is the general spendable collocation method of one of design after the test of various brands and various performance router, it is applicable to the router of all support udp broadcasts, and configuration speed is greatly improved, implementation process is simple. The method realizes passing through mobile phone, the instruments such as flat board realize being configured on fixing router by a certain module, within the relatively short time, this purpose is realized in the way of relatively safer, the repeatability of differently configured AP name and the sent out data of password is very low, success rate is very high, and setup time is short.
Above-described embodiment only for technology design and the feature of the present invention are described, its object is to allow person skilled in the art will appreciate that present disclosure and to implement according to this, can not limit the scope of the invention with this. All equivalences made according to spirit of the invention change or modify, and all should be encompassed within protection scope of the present invention.