Commit 8b7cd98a authored by Sandipan Patra's avatar Sandipan Patra Committed by Madan Lanka

[ENROLLEE] SoftAp host based on build command

Change-Id: Id3386264522b3015075c3333e14b38b1af9b3180
Signed-off-by: default avatarSandipan Patra <sandipan.p@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5025Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 23305f90
......@@ -44,7 +44,7 @@ if ('mediator' in es_role) :
if ('enrollee' in es_role) :
print "Building Easysetup enrollee SDK"
if es_target in ['linux', 'arduino', 'tizen']:
SConscript('enrollee/SConscript')
else :
......
......@@ -40,6 +40,9 @@ if 'IP' in enrollee_env.get('TARGET_TRANSPORT'):
print "Enrollees are implemented for IP transport only"
enrollee_env.AppendUnique(CPPDEFINES = ['ESWIFI'])
if enrollee_env.get('ES_SOFTAP_MODE') == 'ENROLLEE_SOFTAP':
enrollee_env.AppendUnique(CPPDEFINES = ['ENROLLEE_SOFTAP'])
######################################################################
# Build flags
######################################################################
......
......@@ -22,7 +22,7 @@
* @file
*
* This file has methods for on-boarding the Enrollee device.
* This will contain template methods that will have core business logic & negotiation algorithm
* This will contain template methods that will have core business logic & negotiation algorithm
* on various on-boarding methods.
*/
......@@ -66,14 +66,12 @@ bool ESOnboard(const char * ssid, const char* passwd, NetworkEventCallback cb)
if (ESSoftapOnboarding())
{
#ifndef ARDUINO //SoftAp at Arduino is not supported
if (ESSoftapAtEnrollee())
{
OC_LOG(DEBUG, ES_ENROLLEE_TAG, "Create softap at enrollee");
ESCreateSoftap(ssid, passwd, cb);
}
else
#endif
{
OC_LOG(DEBUG, ES_ENROLLEE_TAG, "Connecting to SoftAp");
ConnectToWiFiNetwork(ssid, passwd, cb);
......
......@@ -23,13 +23,20 @@ void ESCreateSoftapCallback(int result, const char *ip, const char* mac_addr,
NetworkEventCallback gCallback;
/**
* It will return Device which is creating Soft AP ; Devices are identified by their role.
* It will return Device which is creating Soft AP.
* i.e.Enrollee or Mediator.
* This decesion is based on, what is the value set for ES_SOFTAP_MODE in build command as well as
* in iotivity.spec file.
*/
DeviceRole ESSoftapHost()
{
// TODO: To implement
#ifdef ENROLLEE_SOFTAP
//SoftAp at enrollee
return ENROLLEE;
#else
//SoftAp at mediator
return MEDIATOR;
#endif
}
/**
......
......@@ -28,11 +28,11 @@ os_arch_map = {
es_role_map = {
'enrollee', 'mediator'
}
es_target_enrollee_map = {
'arduino', 'tizen', 'linux'
}
es_softap_mode_map = {
'ENROLLEE_SOFTAP', 'MEDIATOR_SOFTAP'
}
......
......@@ -30,7 +30,7 @@ Build Procedure
attribute value
es_target_enrollee tizen
es_role enrollee
softap_mode ENROLLEE_SOFTAP
softap_mode ENROLLEE_SOFTAP
3) Go to "iotivity/" folder.
4) Execute following command(s) to start build based on transport selection required :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment