Detailed description of the invention
Embodiments of the invention are described below in detail, and the example of described embodiment is shown in the drawings, and the most same or similar label represents same or similar element or has the element of same or like function.The embodiment described below with reference to accompanying drawing is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, and singulative used herein " ", " one ", " described " and " being somebody's turn to do " may also comprise plural form.Should be further understood that, the wording used in the description of the present invention " includes " referring to there is described feature, integer, step, operation, element and/or assembly, but it is not excluded that existence or adds other features one or more, integer, step, operation, element, assembly and/or their group.It should be understood that when we claim element to be " connected " or during " coupled " to another element, and it can be directly connected or coupled to other elements, or can also there is intermediary element.Additionally, " connection " used herein or " coupling " can include wireless connections or wireless couple.Wording "and/or" used herein includes that one or more list the whole of item or any cell being associated combines with whole.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, and all terms used herein (include technical term and scientific terminology), have with the those of ordinary skill in art of the present invention be commonly understood by identical meaning.It should also be understood that, those terms defined in such as general dictionary, should be understood that there is the meaning consistent with the meaning in the context of prior art, and unless by specific definitions as here, otherwise will not explain by idealization or the most formal implication.
Those skilled in the art of the present technique are appreciated that, " terminal " used herein above, " terminal unit " had both included the equipment of wireless signal receiver, it only possesses the equipment of wireless signal receiver of non-emissive ability, include again the equipment receiving and launching hardware, it has the reception that on bidirectional communication link, can carry out two-way communication and the equipment launching hardware.This equipment may include that honeycomb or other communication equipments, and it has single line display or multi-line display or the honeycomb not having multi-line display or other communication equipments;PCS (PersonalCommunicationsService, PCS Personal Communications System), it can process with combine voice, data, fax and/or its communication ability;PDA (PersonalDigitalAssistant, personal digital assistant), it can include the access of radio frequency receiver, pager, the Internet/intranet, web browser, notepad, calendar and/or GPS (GlobalPositioningSystem, global positioning system) receptor;Conventional laptop and/or palmtop computer or other equipment, it has and/or includes the conventional laptop of radio frequency receiver and/or palmtop computer or other equipment." terminal " used herein above, " terminal unit " can be portable, can transport, be arranged in the vehicles (aviation, sea-freight and/or land), or it is suitable for and/or is configured at local runtime, and/or with distribution form, any other position operating in the earth and/or space is run." terminal " used herein above, " terminal unit " can also is that communication terminal, access terminals, music/video playback terminal, can be such as PDA, MID (MobileInternetDevice, mobile internet device) and/or there is the mobile phone of music/video playing function, it is also possible to it is the equipment such as intelligent television, Set Top Box.
As it is shown in figure 1, intelligent terminal's method for configuring route of the present invention, comprise the steps S21 to S24:
Step S21, make this intelligent terminal with the access of service end identity reception client.
Described service end and two kinds of roles of client, in the present invention, for two intelligent terminal with WiFiP2P agreement institute specification, wherein, work in as the chip module of the intelligent terminal of client under the P2P-Client pattern of this agreement institute specification, i.e. show as client role;The intelligent terminal of the present invention on the other side then works under the P2P-GroupOwner pattern of this agreement institute specification, i.e. shows as service end role.
In Android operation system, the WiFi chip module not allowing for same intelligent terminal simultaneously works under client and service end both of which, therefore, realize this effect, referring to an example of the follow-up announcement of the present invention, the follow-up intelligent terminal's hotspot pattern as service end that will disclose and station mode coexist control method.But it should be understood that no matter whether service end is under the state that both of which coexists, the most do not affect effective enforcement of the present invention.Because present invention seek to address that how the client under aforementioned protocols specification configures its route so that it is possess the technical problem communicated through service end, thus, can service end itself connect with outer net, and the technology having no effect on the present invention realizes.
In any case, the WiFi chip module of self, according to aforesaid technical specification, is worked in the state of WiFiP2PGO by the intelligent terminal of the present invention, is i.e. available for client and accesses, just can complete preliminary connection, serve as the effect being equivalent to AP (WAP).
Step S22, ask for the configuring request of routing configuration information in response to client and call corresponding configuration process.
Specification according to WiFiP2P agreement, after client completes tentatively to connect, configuring request DHCPRequest (DHCP will be initiated to service end, DynamicHostConfigurationProtocal, DHCP), obtaining corresponding routing configuration information with it, usual client can at least require following option (option) in it is asked:
Above option is substantially arranges according to the specification of DHCP protocol, and those skilled in the art all can know.
Service end acquiescence erection has Dynamic Host Configuration Protocol server, it is possible in response to described configuring request, and provides a routing configuration information, includes the configuration data (information) corresponding with described each option.Thus, client after sending above-mentioned configuring request, client communicate with service end unobstructed in the case of, can obtain corresponding configured list, thus be provided to client according to each option relative set self and complete routing configuration.
But, DHCP service needs by DNSmasq process, namely the configuration process of service end is come for the routing configuration information described in client offer.DNSmasq be one small and exquisite and be advantageously used in configure DNS and DHCP instrument, it is adaptable to mininet, it provide DNS function and selectable DHCP function.It services those domain names being only suitable in this locality, and these domain names are will not to occur in the dns server in the whole world.Dynamic Host Configuration Protocol server and dns server combine, and the address allowing DHCP to distribute normally can resolve in DNS, and the address of these DHCP distribution and related command can be configured in every main frame (client of the such as present invention), can also be configured in a nucleus equipment (such as serving as the described service end of router), DNSmasq supports static and dynamic two kinds of DHCP configuration modes.
After service end calls DNSmasq process, the follow-up function that routing configuration information is provided will be performed to client by this process.
Step S23, by the routing configuration information described in described configuration process structure and to client feedback, this routing configuration information comprises the control option forcing client executing static routing configuration.
DNSmasq process has a configuration file dnsmasq.conf of the same name, can be written as the route data that client provides, the option enumerated before being included in this configuration file.So, configuration process, by the corresponding contents of the config option described in reading, just can form described routing configuration information and be supplied to the client of described initiation configuring request.
It is to be noted, although various options provided above do not comprise the option of DHCP protocol serial number 121, actually the static routing data of content as option one 21 provides with 33 and comprises, but, in the configured list that the DHCP service of android system provides, no matter whether it comprises 33 or 121 options in routing configuration information, and the static routing data of option 33 and option one 21 are all ignored by client.And study discovery, after the control option dhcp-option-force that service end is added for forcing client executing static routing to configure in its routing configuration information provided, then situation can be taken on a new look.Specifically, when providing especially 121 these a kind of static routing data and coordinating with this control option, then client is using the configuration of the static routing data of having gone self as the instruction of a kind of absolute compulsory execution.Thus, the configuration file of described configuration information is just modified by the service end of the present invention so that it possesses makes described configuration process possess the ability comprising the described routing configuration information controlling option to client feedback.
Specifically, under default situations, not to configuration process configuration file modify in the case of, when after the routing configuration information that client receives described in service end, default rule according to android system, its configuration process will be started, complete routing configuration, the period not responsible setting completing static routing data freely, in this case, client is owing to lacking static routing information, and cannot access external network by service end, otherwise the packet of external network also cannot arrive client smoothly.It is thus desirable to the configuration file needed for described configuration process is reconfigured, refer to following one for revising the example of described configuration file:
First, described configuration process is made to be closed.
In one embodiment, perform to give an order: sudodnsmasq-C./dnsmasq.conf-z-k, perform the purpose of this instruction, it is to close with the dnsmasq process of android system acquiescence flow performing routing configuration with system highest weight limit, even if it has completed routing configuration, by instruction as escribed above, it is also possible to be turned off, and will be as the criterion with follow-up process.
Then, revise the configuration file of this configuration process so that it is comprise the control option forcing client executing static routing configuration, force client according to the static routing data that described option is 121 in the routing configuration information of service end offer, self to be configured.
After closing described configuration process, and then its configuration file dnsmasq.conf is modified, such as:
Dnsmasq process of stopping # reads the domain name file of other any such as/etc/resolv.conf
no-resolv
Port=0
# network card binding
Interface=wlan0
# specifies initial address, termination address and lease time
Dhcp-range=10.15.0.3,10.15.0.20,12h
# is sent to the domain name server address of client
Server=114.114.114.114
# forces routing configuration, arranges control option and sets option as 121
Dhcp-option-force=121,192.168.1.0/24,10.15.0.1
Dhcp-option-force=33,192.168.1.0,10.15.0.1
Then, after follow-up dnsmasq process is again started up, its configuration file will be directly read, by with the above-mentioned listed corresponding data of feature, the most especially include described control option and option one 21, close into the routing configuration information of agreement, comprise various corresponding data wherein, feed back to client in response to the configuring request of client.
Accordingly, client is after receiving described routing configuration information, it is resolved, obtain the data that wherein each option is corresponding, the network settings of self are updated, when it knows described control option and corresponding parameter options 121, can force to configure the static routing data of self voluntarily.After completing the configuration of this process, client just can serve as intelligent terminal and the outbound communication of service end by the present invention.
Referring to Fig. 2, according to computer software module thinking, present invention also offers a kind of intelligent terminal, this intelligent terminal includes access unit 21, response unit 22 and feedback unit 23, and existing function each unit possessed is explained below:
Described access unit 21, for making this intelligent terminal with the access of service end identity reception client.
Described service end and two kinds of roles of client, in the present invention, for two intelligent terminal with WiFiP2P agreement institute specification, wherein, work in as the chip module of the intelligent terminal of client under the P2P-Client pattern of this agreement institute specification, i.e. show as client role;The intelligent terminal of the present invention on the other side then works under the P2P-GroupOwner pattern of this agreement institute specification, i.e. shows as service end role.
In Android operation system, the WiFi chip module not allowing for same intelligent terminal simultaneously works under client and service end both of which, therefore, realize this effect, referring to an example of the follow-up announcement of the present invention, the follow-up intelligent terminal's hotspot pattern as service end that will disclose and station mode coexist control method.But it should be understood that no matter whether service end is under the state that both of which coexists, the most do not affect effective enforcement of the present invention.Because of present invention seek to address that the client under aforementioned protocols specification how to configure its route so that it is possess through service end communicate enabling technology problem, thus, can service end itself connect with outer net, have no effect on the present invention technology realization.
In any case, the WiFi chip module of self, according to aforesaid technical specification, is worked in the state of WiFiP2PGO by the intelligent terminal of the present invention, is i.e. available for client and accesses, just can complete preliminary connection, serve as the effect being equivalent to AP (WAP).
Described response unit 22, is configured to respond to client and asks for the configuring request of routing configuration information and call corresponding configuration process.
Specification according to WiFiP2P agreement, after client completes tentatively to connect, configuring request DHCPRequest (DHCP will be initiated to service end, DynamicHostConfigurationProtocal, DHCP), obtaining corresponding routing configuration information with it, usual client can at least require following option (option) in it is asked:
Above option is substantially arranges according to the specification of DHCP protocol, and those skilled in the art all can know.
Service end acquiescence erection has Dynamic Host Configuration Protocol server, it is possible in response to described configuring request, and provides a routing configuration information, includes the configuration data (information) corresponding with described each option.Thus, client after sending above-mentioned configuring request, client communicate with service end unobstructed in the case of, corresponding configured list can be obtained, thus relative set self completes routing configuration according to each option to be provided to client.
But, DHCP service needs by DNSmasq process, namely the configuration process of service end is come for the routing configuration information described in client offer.DNSmasq be one small and exquisite and be advantageously used in configure DNS and DHCP instrument, it is adaptable to mininet, it provide DNS function and selectable DHCP function.It services those domain names being only suitable in this locality, and these domain names are will not to occur in the dns server in the whole world.Dynamic Host Configuration Protocol server and dns server combine, and the address allowing DHCP to distribute normally can resolve in DNS, and the address of these DHCP distribution and related command can be configured in every main frame (client of the such as present invention), can also be configured in a nucleus equipment (such as serving as the described service end of router), DNSmasq supports static and dynamic two kinds of DHCP configuration modes.
After the response unit 22 of service end calls DNSmasq process, the follow-up function that routing configuration information is provided will be performed to client by this process.
Described feedback unit 23, is configured to, by the routing configuration information described in described configuration process structure and to client feedback, comprise the control option forcing client executing static routing configuration in this routing configuration information.
DNSmasq process has a configuration file dnsmasq.conf of the same name, can be written as the route data that client provides, the option enumerated before being included in this configuration file.So, configuration process, by the corresponding contents of the config option described in reading, just can form described routing configuration information and be supplied to the client of described initiation configuring request.
It is to be noted, although various options provided above do not comprise the option of DHCP protocol serial number 121, actually the static routing data of content as option one 21 provides with 33 and comprises, but, in the configured list that the DHCP service of android system provides, no matter whether it comprises 33 or 121 options in routing configuration information, and the static routing data of option 33 and option one 21 are all ignored by client.And study discovery, after the control option dhcp-option-force that service end is added for forcing client executing static routing to configure in its routing configuration information provided, then situation can be taken on a new look.Specifically, when providing especially 121 these a kind of static routing data and coordinating with this control option, then client is using the configuration of the static routing data of having gone self as the instruction of a kind of absolute compulsory execution.Thus, the configuration file of described configuration information is just modified by the service end of the present invention so that it possesses makes described configuration process possess the ability comprising the described routing configuration information controlling option to client feedback.
Specifically, under default situations, not to configuration process configuration file modify in the case of, when after the routing configuration information that client receives described in service end, default rule according to android system, its configuration process will be started, complete routing configuration, the period not responsible setting completing static routing data freely, in this case, client is owing to lacking static routing information, and cannot access external network by service end, otherwise the packet of external network also cannot arrive client smoothly.It is thus desirable to the configuration file needed for described configuration process is reconfigured, refer to following one for revising the example of described configuration file:
First, described configuration process is made to be closed.
In one embodiment, perform to give an order: sudodnsmasq-C./dnsmasq.conf-z-k, perform the purpose of this instruction, it is to close with the dnsmasq process of android system acquiescence flow performing routing configuration with system highest weight limit, even if it has completed routing configuration, by instruction as escribed above, it is also possible to be turned off, and will be as the criterion with follow-up process.
Then, revise the configuration file of this configuration process so that it is comprise the control option forcing client executing static routing configuration, force client according to the static routing data that described option is 121 in the routing configuration information of service end offer, self to be configured.
After closing described configuration process, and then its configuration file dnsmasq.conf is modified, such as:
Dnsmasq process of stopping # reads the domain name file of other any such as/etc/resolv.conf
no-resolv
Port=0
# network card binding
Interface=wlan0
# specifies initial address, termination address and lease time
Dhcp-range=10.15.0.3,10.15.0.20,12h
# is sent to the domain name server address of client
Server=114.114.114.114
# forces routing configuration, arranges control option and sets option as 121
Dhcp-option-force=121,192.168.1.0/24,10.15.0.1
Dhcp-option-force=33,192.168.1.0,10.15.0.1
Then, after follow-up dnsmasq process is again started up, its configuration file will be directly read, by with the above-mentioned listed corresponding data of feature, the most especially include described control option and option one 21, close into the routing configuration information of agreement, comprise various corresponding data wherein, feed back to client in response to the configuring request of client.
Accordingly, client is after receiving described routing configuration information, it is resolved, obtain the data that wherein each option is corresponding, the network settings of self are updated, when it knows described control option and corresponding parameter options 121, can force to configure the static routing data of self voluntarily.After completing the configuration of this process, client just can serve as intelligent terminal and the outbound communication of service end by the present invention.
The present invention coexists control method in front cited a kind of intelligent terminal's hotspot pattern and station mode, can match with the aforesaid method of the present invention, strengthen the function of the accessing external network of described service end, so that the intelligent terminal of the present invention of effect service end possesses the function being equivalent to router, and only need to depend on the specification of WiFiP2P agreement.
Concrete as it is shown on figure 3, described in the control method that coexists comprise the steps S11-S14:
Step S11, receives for starting the hotspot pattern of this intelligent terminal and the control instruction of station mode from user interface.
The realization of the present invention, being suitable for Android provides and installs an application program, it start, and in the case of obtaining system highest weight limit or open system highest weight limit, and improves interactive function to system, it is achieved the control needed for this method.
User interface refers to the display interface that can be used in sending described control instruction to intelligent terminal, such as, it can be arrange in the page option (or button of android system, added wherein by described application program, lower same), can also be an option from the informing or interaction page of desktop exhalation, it is also possible to be an option in the page that constructed of a moving component of described application program.
The present invention is preferably as follows two ways, for receiving described control instruction:
One, by providing single control button in user interface, receives described control instruction for one-touch, and this mode is easy to user and is realized operating in a key.
Its two, by providing control button respectively at user interface correspondence hotspot pattern and station mode, produce the corresponding control instruction starting corresponding pattern with corresponding different key respectively.
The control button provided according to above mode, generally these buttons can be preferably provided at system desktop informing list, or provide in the way of desktop suspended window, both it had been easy to user's touch-control control, the most do not affect user's visual effect, activate when can open WiFi button as the default feature of system with user the most yet.It is also preferred that the left described application program can set itself to self-starting item so that during system start-up, described button can be loaded voluntarily, consequently facilitating user operation.
When user is by described user interface, after the control button described in touch-control, just producing corresponding control instruction, this control instruction will be received by the process of described application program, and carries out follow-up process.
Step S12, be controlled by this control instruction and start system intialization for this intelligent terminal being configured to the focus maintenance process of hotspot pattern and the station maintenance process being used for being configured to this intelligent terminal station mode;
The effect of the described control instruction of generation user controlled, and then start the preset station maintenance process of android system and focus maintenance process, wherein, station maintenance process is for being configured to station mode by this intelligent terminal, in like manner, focus maintenance process is for being configured to hotspot pattern by this intelligent terminal.According to the analysis to android system, after its focus maintenance process is opened, station maintenance process can be closed by the former, thus, excel at leveraging this discovery, that be just conducive to maintaining two processes and deposit.
Described station maintenance process, refer in particular to the wpa_supplicant process that android system self provides, wpa_supplicant is originally open source projects source code, android mobile platform is added after being revised by Google, it is primarily used to support WEP, WPA/WPA2 and WAPI wireless protocols and encryption certification, and actual job content be by socket (no matter being that wpa_supplicant uses socket communication with upper strata or wpa_supplicant with driving) with drive mutual reported data to user, user can send commands to wpa_supplicant transfer driving by socket and to operate WiFi chip.Briefly, wpa_supplicant is exactly that WiFi drives and the additional support to agreement with encryption certification of terminal of user.Wpa_supplicant source program after compiling is it can be seen that two main performed instrument: wpa_supplicant and wpa_cli.Wpa_supplicant is kernel program, and it is exactly to service and the relation of client with the relation of wpa_cli: running background wpa_supplicant, uses wpa_cli to search for, arrange and connect network.
One presented below utilizes wpa_cli to complete the example that network connects, but should not be construed as the restriction of the realization to the present invention.Network connecting function to be realized, it is necessary first to run wpa_supplicant program to load basic function;
Perform :/system/bin/wpa_supplicant-d-Dwext-iwlan0-c/data/misc/wif i/wpa_supplicant.conf
Wherein:
-d: increase Debugging message
-Dwext:wext, drives title
-iwlan0:wlan0, network interface title
/ system/bin/wpa_supplicant:wpa_supplicant, executable program path
The Profile Path of/data/misc/wifi/wpa_supplicant.conf:wpa_supplicant
Then, command-line tool wpa_cli is run;
Perform: wpa_cli-iwlan0-p/data/system/wpa_supplicant
Noting, the wpa_supplicant in-p/data/system/wpa_supplicant is not executable program, but individual control socket.
Now can enter interactive mode.The wherein order of interactive mode such as following table:
Fullcommand
Shortcommand
Description
status
stat
displaysthecurrentconnectionstatus
disconnect
disc
preventswpa_supplicantfromconnectingtoanyaccesspoint
quit
q
exitswpa_cli
terminate
term
killswpa_supplicant
reconfigure
recon
reloadswpa_supplicantwiththeconfigurationfilesupplied(-cparameter)
scan
scan
scansforavailableaccesspoints(onlyscansit,doesn'tdisplayanything)
scan_result
scan_r
displaystheresultsofthelastscan
list_networks
list_n
displaysalistofconfigurednetworksandtheirstatus(activeornot,enabledordisabled)
select_network
select_n
selectanetworkamongthosedefinedtoinitiateaconnection(ieselect_network0)
enable_network
enable_n
makesaconfigurednetworkavailableforselection(ieenable_network0)
disable_network
disable_n
makesaconfigurednetworkunavailableforselection(iedisable_network0)
remove_network
remove_n
removesanetworkanditsconfigurationfromthelist(ieremove_network0)
add_network
add_n
addsanewnetworktothelist.Itsidwillbecreatedautomatically
set_network
set_n
showsaveryshortlistofavailableoptionstoconfigureanetworkwhensuppliedwithnoparameters.
Seenextsectionforalistofextremelyusefulparameterstobeusedwithset_networkandget_network.
get_network
get_n
displaystherequiredparameterforthespecifiednetwork.Seenextsectionforalistofparameters
save_config
save_c
savestheconfiguration
Above command entry can be checked from the public technology document of Android, the most only for reference.
The instruction of the basic format arranging network is: set_network<networkid><key><parameter>[<parameter>]
The instruction of the basic format of display networks is: get_network<networkid><key>
Corresponding parameter such as following table:
Key
Description
Parameters
ssid
Accesspointname
string
id_str
Stringidentifyingthenetwork
string
priority
ConnectionpriorityoverotherAPs
number(0beingthedefaultlowpriority)
bssid
Macaddressoftheaccesspoint
macaddress
scan_ssid
Enable/disbalessidscan
0,1,2
key_mgmt
Typeofkeymanagement
WPA-PSK,WPA_EAP,None
pairwise
PairwiseciphersforWPA
CCMP,TKIP
Group=TKIP
GroupciphersforWPA
CCMP,TKIP,WEP104,WEP40
psk
Pre-SharedKey(clearorencrypted)
string
wep_key0
WEPkey (upto4:wep_key [0123])
string
eap
ExtensibleAuthenticationProtocol
MD5,MSCHAPV2,OTP,GTC,TLS,PEAP,TTLS
identity
EAPidentitystring
string
password
EAPpassword
string
ca_cert
PathnametoCAcertificatefile
/full/path/to/certificate
client_cert
Pathnametoclientcertificate
/full/path/to/certificate(PEM/DER)
private_key
Pathnametoaclientprivatekeyfile
/full/path/to/private_key(PEM/DER/PFX)
In like manner, above parameter list also can be obtained from Android official by public approach, only for reference, pardons and does not repeats.Illustrate how that realizing network connects following with one for connecting the instantiation of the AP without encryption:
> add_network (network ID will be shown, it is assumed that return value is 0)
>set_network0ssid"666"
>set_network0key_mgmtNONE
>enable_network0
>quit
Recycling one is illustrated for the instantiation connecting the AP of WEP encryption:
> add_network (assuming that network ID returns 1)
>set_network1ssid"666"
>set_network1key_mgmtNONE
>set_network1wep_key0"yourappassword"
>enable_network1
Example as the AP connecting WPA-PSK/WPA2-PSK encryption is as follows:
> add_network (assuming that network ID returns 2)
>set_network2ssid"666"
>set_network2psk"yourpre-sharedkey"
>enable_network2
Arriving this, wifi module just can connect AP.
It is above being realized the connection of wifi network by command-line tool wpa_cli.It is of course also possible to realize connecting by the configuration file of wpa_supplicant.
Might as well look back again above run wpa_supplicant time perform order:
/system/bin/wpa_supplicant-d-Dwext-iwlan0-c/data/misc/wifi/wpa_supplicant.conf
We add-c/data/misc/wifi/wpa_supplicant.conf upon execution, so the AP's that will connect is arranged with in certain form write wpa_supplicant.conf configuration file.Such as:
Ctrl_interface=DIR=/data/system/wpa_supplicantGROUP=syst emupdate_config=1
Network={
Ssid=" myaccesspoint "
Proto=WPA
Key_mgmt=WPA-PSK
Psk=" youpasswords "
}
Visible, although android system is in default situations, station maintenance process can be automatically switched off while opening focus maintenance process, but, use instruction by above or use configuration file two ways, it is possible to achieve being controlled the unlatching of described station maintenance process by program process voluntarily.
Focus maintenance process, refers in particular to the hostapd process that android system provides.Hostapd is that the finger daemon of user control is for WAP (AP) and authorization server (authenticationservers).Hostapd achieves the AP management of IEEE802.11, IEEE802.1X/WPA/WPA2/EAP authorizes, radius client, EAP server and radius authorization server, latest edition supports linux system (HOSTAP at present, madwifi, mac80211-based drive) and FreeBSD (net80211).Hostapd is designed as a demons (process), running background, carries out the operation of some relevant control mandates.
The difference of Hostapd Yu wpa_supplicant is mainly reflected in wpa_supplicant and supports basic AP operation, but does not include various finer parameter adjustment, such as WPA2-Enterprise (RADIUSserver certification).As can be seen here, two kinds of processes are simply divided the work difference, and it acts on approximation.
In like manner, hostapd allows to be configured it by certain mode, such that it is able to started it voluntarily by application program.An example utilizing its configuration file to realize configuration presented below:
It is the topology example of a relevant configuration file herein, left side serial number line number for reference:
Based on this configuration file, focus can be set up as follows:
Build bridge: sudoapt-getinstallbridge-utils
Set up bridge:
sudobrctladbrbr0
02.sudoifconfigbr0192.168.2.236netmask255.255.255.0
03.sudorouteadddefaultgw192.168.2.254
Connection bridge two ends:
sudobrctladdifbr0eth0
02.sudobrctladdifbr0wlan0
Enable configuration:
sudo./hostapdhostapd.conf
Generally, as without other faults, other intelligent terminal just can scan the SSID of the focus thus set up, and owing to this focus is self-built, does not possesses DHCP service, therefore intelligent terminal needs to coordinate voluntarily static IP and could realize LAN and connect.
Below the station maintenance process be given respectively and the principle of focus maintenance process and the exemplary introduction implemented thereof, those skilled in the art on basis disclosed above, can understand the flexible and changeable implementation of the present invention.Wherein it is desired to it is noted that for the facility realized, improve efficiency of the practice, no matter for hostapd or wpa_supplicant process, all recommend configuration file and its .conf file that is preset in of network configuration information is carried out pre-configured, then restart corresponding maintenance process.
As described in previous step, user both can wish to open hotspot pattern and station mode by single control button simultaneously, it is also possible to is opened by two buttons corresponding with both of which, essentially provides multiple operation change case.These changes corresponding, illustrate further below.
If user interface provides single control button, user triggers its user instruction by this single control button, the most just can first open hostapd process, i.e. focus maintenance process.Owing to the unlatching of hostapd process can cause being automatically switched off wpa_supplicant process, therefore, the program process of the present invention needs with reference to above-mentioned implementation, after focus maintenance process is opened, start this station maintenance process the most voluntarily, the most just can realize two maintenance process and deposit.Otherwise, it is also possible to starting website maintenance process in advance, after it completes to open, then row opens focus maintenance process with reference to above-mentioned example.It is to say, the control instruction caused corresponding to single control button, can be with focus maintenance process and the boot sequence of station maintenance process described in different embodiment flexible arrangement.
And correspondence user interface provides different control buttons, for characterizing the example of different maintenance process of opening an account respectively, then can click on the different order controlling button by user and sequentially open corresponding maintenance process, this measure has no effect on the enforcement of the present invention.
Realize man-machine interaction howsoever, the focusing on both and in succession open of the control of focus maintenance process and station maintenance process, and need the process of the application program alleged by the present invention to be acted on.
In preferred scheme, it is recommended that preferentially allow station maintenance process open prior to focus maintenance process, in the case of guaranteeing that this intelligent terminal can connect outer net, provide access function to other intelligent terminal, some idle works can be exempted, the most energy-conservation.
In theory, after station maintenance process and focus maintenance process being sequentially activated, coexisting of two maintenance process can just be realized, then, because of system may the impact of potential some risks, may result in two maintenance process and one of to be arbitrarily closed, thus still need and strengthened by follow-up means.
Step S13, maintains described focus maintenance process and described station maintenance process to be coexisted formula work.
The formula that coexists work designated herein, refers to that focus maintenance process may be opened in succession with station maintenance process, but may not open by synchronization.As long as both of which is present in internal memory operation, both cycle of operations in internal memory have temporal concurrently so that within a time cycle, intelligent terminal can be access in and can also access other access points, i.e. can be considered coexist formula work.
After focus maintenance process is unlocked, owing to it will close website maintenance process, thus, the program process of the present invention is suitably according to predetermined scheduled duration, and after scheduled duration terminates, then row starts website maintenance process, in order to avoid previous station maintenance process collision, cause startup unsuccessful.In like manner, if first starting website maintenance process, for avoiding it may close focus maintenance process, it is possible to be suitable for this method.
In order to ensure described focus maintenance process and described station maintenance process during user uses normally or relative normally use; whether the program process of the present invention can be closed with any one in two maintenance process of periodic scanning on backstage; when one of them is closed; control pent process the most in the manner previously described to open; so that it is guaranteed that expect according to user, two maintenance process are made to work with can coexisting formula.
Visible, maintain focus maintenance process and station maintenance process to run in internal memory, be to ensure that the reinforcement means of network stabilization.
Step S14, characterizes the object information of the concurrent state that this intelligent terminal is in hotspot pattern and station mode coexists to user interface output.
In the control device completing above-mentioned step S12 or S13, make two maintenance process coexist formula work after, the program process of the present invention just can export some object informations to user interface, to inform the concurrent state that this intelligent terminal of user currently coexists already at hotspot pattern and station mode.Expression-form as described object information, both can be to be shown in informing by system message, can also pop-up show on the table, more excellent mode can be to call default third party's icon, for characterizing the concurrent state that this intelligent terminal is in hotspot pattern and station mode coexists, this third party's icon is shown in the system mode hurdle of user interface so that user is easier to know described object information.
It is to be noted, after described step S12 is run, step S14 can be performed in theory realize icon and show, then step S13 is continuously carried out, thus, it will be appreciated by those skilled in the art that the execution sequence that should not understand each step of the present invention with the character arranging order of the present invention, and should be understood with the substantial principle disclosed in the present invention.
In sum, the Android intelligent terminal that the invention enables the service end as WiFiP2P agreement institute specification has possessed pressure its client configuration static routing, thus it is built into Intranet with service end, and by service end be client provide outer net access ability, be greatly expanded the networking capability of intelligent terminal.Especially, when in the function that service end realizes its hotspot pattern and station mode coexists, more can only rely upon WiFiP2P technology and network capacity extension function, be greatly improved the utilization ratio of the network infrastructure elements to intelligent terminal.
Those skilled in the art of the present technique are appreciated that the present invention includes the one or more equipment relating to perform in operation described herein.These equipment can be required purpose and specialized designs and manufacture, or can also include the known device in general purpose computer.These equipment have storage computer program within it, and these computer programs optionally activate or reconstruct.nullSuch computer program can be stored in equipment (such as,Computer) in computer-readable recording medium or be stored in and be suitable to store e-command and be coupled to any kind of medium of bus respectively,Described computer-readable medium includes but not limited to that any kind of dish (includes floppy disk、Hard disk、CD、CD-ROM、And magneto-optic disk)、ROM(Read-OnlyMemory,Read only memory)、RAM(RandomAccessMemory,Memorizer immediately)、EPROM(ErasableProgrammableRead-OnlyMemory,Erarable Programmable Read only Memory)、EEPROM(ElectricallyErasableProgrammableRead-OnlyMemory,EEPROM)、Flash memory、Magnetic card or light card.It is, computer-readable recording medium includes by equipment (such as, computer) with the form storage that can read or any medium of transmission information.
Those skilled in the art of the present technique are appreciated that the combination of the frame in each frame and these structure charts and/or block diagram and/or flow graph that can realize in these structure charts and/or block diagram and/or flow graph with computer program instructions.Those skilled in the art of the present technique are appreciated that, the processor that these computer program instructions can be supplied to general purpose computer, special purpose computer or other programmable data processing methods realizes, thus is performed the scheme specified in structure chart disclosed by the invention and/or block diagram and/or the frame of flow graph or multiple frame by the processor of computer or other programmable data processing methods.
Those skilled in the art of the present technique are appreciated that the step in the various operations discussed in the present invention, method, flow process, measure, scheme can be replaced, change, combine or delete.Further, have the various operations discussed in the present invention, method, other steps in flow process, measure, scheme can also be replaced, changed, reset, decomposed, combined or deleted.Further, of the prior art have can also be replaced with the step in the various operations disclosed in the present invention, method, flow process, measure, scheme, changed, reset, decomposed, combined or deleted.
The above is only the some embodiments of the present invention; it should be pointed out that, for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be regarded as protection scope of the present invention.