1 // http://www.apache.org/licenses/LICENSE-2.0
3 // Unless required by applicable law or agreed to in writing, software
4 // distributed under the License is distributed on an "AS IS" BASIS,
5 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6 // See the License for the specific language governing permissions and
7 // limitations under the License.
9 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12 * These are adapter APIs will make caller modules agnostic to platform.
15 #include "softapnative.h"
16 #include "easysetup.h"
18 #include "networkhandler.h"
20 void ESCreateSoftapCallback(int result, const char *ip, const char* mac_addr,
21 const char* device_name );
23 NetworkEventCallback gCallback;
26 * It will return Device which is creating Soft AP ; Devices are identified by their role.
27 * i.e.Enrollee or Mediator.
29 DeviceRole ESSoftapHost()
36 * It will return true if the Soft AP is created at Enrollee device
38 bool ESSoftapAtEnrollee()
40 return ( ESSoftapHost() == ENROLLEE) ? true : false;
44 * It will return true if the Soft AP is created at Mediator device
46 bool ESSoftapAtMediator()
48 return (ESSoftapHost() == MEDIATOR) ? true : false;
52 * This API will map result returned from the native to the caller.
53 * Callback API's signature needs to be modified under build switch according
54 * to the underline platform.
56 void ESCreateSoftapCallback(int result, const char *ip, const char* mac_addr,
57 const char* device_name)
59 if(SOFTAP_SUCCESS == result) //on Success
70 * This API will create the softap at enrollee
72 void ESCreateSoftap(const char * ssid, const char* passwd, NetworkEventCallback cb)
76 // TODO: To be implemented
77 // Create Soft AP through native APIs -- start
78 // native API call by and pass ESCreateSoftapCallback() as callback
79 ESCreateSoftapNative(ssid, passwd,ESCreateSoftapCallback);
80 // Create Soft AP through native APIs -- end