Usage
To test the service you can run it on your host.
Create/Update a WiFi JSON configuration corresponding to your wanted setup
What you need to set in this configuration file to start your access point
-
For information about
metadata
section, please look at controller documentation -
config
section: This section is used to define the wifi access point parameters needed to start the service. Available keys:-
startAtInit
key is an optional key to specify if you want to start the access point using the configuration provided in the configuration file at the binding init. -
interfaceName
key is the name of the interface to use as access point ( it’s a mandatory key). -
ssid
key is the Service Set Identification (SSID) of the access point. It’s mandatory if you want to start the binding at init otherwise you can set it using the setSsid verb. -
channelNumber
key is used to set which Channel to use. Some legal restrictions might apply for your region.- The channel number must be between 1 and 14 for IEEE 802.11b/g.
- The channel number must be between 7 and 196 for IEEE 802.11a.
- The channel number must be between 1 and 6 for IEEE 802.11ad.
-
discoverable
key is used to set if the Access Point should announce its presence, otherwise it wil be hidden. -
IeeeStdMask
key is used to set which IEEE standard to use. -
securityProtocol
key is used to set the security protocol to use. It can either be set to none or WPA2. -
passphrase
key is used to generate the PSK. -
preSharedKey
key is used if you want to set the pre-SharedKey (PSK) directly. -
countrycode
key is used to set what country code to use for regulatory domain. ISO/IEC 3166-1 Alpha-2 code is used. -
maxNumberClient
key is used to set number of maximally allowed clients to connect to the Access Point at the same time. -
ip_ap
key is used to set the IP address of the Access Point (Mandatory if you want to start the access point at init). -
ip_start
key is used to set the start IP address of the Access Point (Mandatory if you want to start the access point at init). -
ip_stop
key is used to set the stop IP address of the Access Point (Mandatory if you want to start the access point at init).
-
Native build (Ubuntu, Fedora)
@note : you need to verify that in your configuration file you got the right name of the interface to use as access point.
Build your binding from shell:
mkdir build
cd build
cmake ..
make
Running the binding
Currently, the binding configuration file found in the path specified with CONTROL_CONFIG_PATH environment variable (the configuration file should begin with wifi-wifiap-binding-).
Run from shell (native execution)
afb-binder --name=afbd-wifiap-binding --port=1234 --ldpaths=package --workdir=. -vvv
Connect to binding
Connect to wifiAp binding using afb-client-demo
afb-client -H ws://localhost:1234/api
Set the SSID
wifiAp setSsid testAP
Output example:
ON-REPLY 1:wifiAp/setSsid: OK
{
"response":{
"SSID":"testAp"
},
"jtype":"afb-reply",
"request":{
"status":"success",
"info":"SSID set successfully"
}
}
Set the channel
wifiAP setChannel 1
Output example:
ON-REPLY 2:wifiAP/setChannel: OK
{
"response":{
"channelNumber":1
},
"jtype":"afb-reply",
"request":{
"status":"success"
}
}
Set the security protocol
wifiAP setSecurityProtocol none
Output example:
ON-REPLY 3:wifiAp/setSecurityProtocol: OK
{
"jtype":"afb-reply",
"request":{
"status":"success",
"info":"Security parameter was set to none!"
}
}
Set the ip addresses range of AP
wifiAp setIpRange {"ip_ap" : "192.168.2.1", "ip_start" : "192.168.2.10" , "ip_stop" : "192.168.2.100"}
Output example:
ON-REPLY 4:wifiAp/setIpRange: OK
{
"jtype":"afb-reply",
"request":{
"status":"success",
"info":"IP range was set successfully!"
}
}
Start the AP
wifiAp start
Output example:
ON-REPLY 5:wifiAp/start: OK
{
"jtype":"afb-reply",
"request":{
"status":"success",
"info":"Access point started successfully"
}
}
You can now connect to the wifi access point from another device
Stop the AP
wifiAp stop
Output example:
ON-REPLY 6:wifiAp/stop: OK
{
"jtype":"afb-reply",
"request":{
"status":"success",
"info":"Access Point was stopped successfully"
}
}