if ('enrollee' in es_role) :
print "Building Easysetup enrollee SDK"
-
- if es_target in ['linux', 'arduino']: #TODO add tizen platform [also add dependencies in iotivity.spec file]
+
+ if es_target in ['linux', 'arduino', 'tizen']:
SConscript('enrollee/SConscript')
else :
print "****************************Enrollee supports linux, tizen and arduino platform****************************"
\ No newline at end of file
enrollee_env.InstallTarget(enrollee_sdk_shared, 'libESEnrollee')
if target_os == 'tizen':
- enrollee_sdk_shared = enrollee_env.SharedLibrary('ESSDKLibrary',
- [enrollee_env.get('SRC_DIR') + '/service/easy-setup/sdk/enrollee/src/easysetup.cpp',
- enrollee_env.get('SRC_DIR') + '/service/easy-setup/sdk/enrollee/src/onboarding.cpp',
- enrollee_env.get('SRC_DIR') + '/service/easy-setup/sdk/enrollee/src/softap.cpp',
- enrollee_env.get('SRC_DIR') + '/service/easy-setup/sdk/enrollee/src/resourcehandler.cpp',
- enrollee_env.get('SRC_DIR') + '/service/easy-setup/sdk/enrollee/tizen/wifi/networkhandler.cpp',
- enrollee_env.get('SRC_DIR') + '/service/easy-setup/sdk/enrollee/tizen/wifi/softapnative.cpp'])
- enrollee_env.InstallTarget(enrollee_sdk_shared, 'libESSDK')
+ enrollee_sdk_shared = enrollee_env.SharedLibrary('ESEnrolleeSDK',
+ [enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/src/easysetup.cpp',
+ enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/src/onboarding.cpp',
+ enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/src/softap.cpp',
+ enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/src/resourcehandler.cpp',
+ enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/tizen/wifi/networkhandler.cpp',
+ enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/tizen/wifi/softapnative.cpp'])
+ enrollee_env.InstallTarget(enrollee_sdk_shared, 'libESEnrolleeSDK')
if target_os == 'arduino':
es_sdk_static = enrollee_env.StaticLibrary('ESEnrolleeSDK', [
/**
* @file
*
- * This file will have methods for on-boarding the Enrollee device.
- * This will contain template methods that has will have core business logic & negotiation algorithm on various on-boarding methods.
+ * This file has methods for on-boarding the Enrollee device.
+ * This will contain template methods that will have core business logic & negotiation algorithm
+ * on various on-boarding methods.
*/
#include "easysetup.h"
'yocto': ['i586', 'x86_64', 'arm', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
}
+es_role_map = {
+ 'enrollee', 'mediator'
+ }
+
+es_target_enrollee_map = {
+ 'arduino', 'tizen', 'linux'
+ }
+
+es_softap_mode_map = {
+ 'ENROLLEE_SOFTAP', 'MEDIATOR_SOFTAP'
+ }
+
host = platform.system().lower()
if not host_target_map.has_key(host):
# Get the device name
device_name = ARGUMENTS.get('DEVICE_NAME', "OIC-DEVICE")
+# Get es_role
+es_role = ARGUMENTS.get('ES_ROLE')
+
+if es_role not in es_role_map:
+ print "\nError: Unknown ES_ROLE: %s (Allow values: %s)\n" % (es_role, es_role_map)
+ Exit(1)
+
+# Get es_target_enrollee
+es_target_enrollee = ARGUMENTS.get('ES_TARGET_ENROLLEE')
+
+if es_target_enrollee not in es_target_enrollee_map:
+ print "\nError: Unknown ES_TARGET_ENROLLEE: %s (Allow values: %s)\n" % (es_target_enrollee, es_target_enrollee_map)
+ Exit(1)
+
+# Get es_soft_mode
+es_soft_mode = ARGUMENTS.get('ES_SOFTAP_MODE')
+
+if es_soft_mode not in es_softap_mode_map:
+ print "\nError: Unknown ES_SOFTAP_MODE: %s (Allow values: %s)\n" % (es_soft_mode, es_softap_mode_map)
+ Exit(1)
+
######################################################################
# Common build options (release, target os, target arch)
######################################################################
help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device', 'OIC-DEVICE', None, None),)
+#ES_TARGET_ENROLLEE is for specifying what is our target enrollee (Arduino or rest of platforms which support Multicast)
+help_vars.Add(EnumVariable('ES_TARGET_ENROLLEE', 'Target Enrollee', 'arduino', allowed_values=('arduino', 'tizen', 'linux')))
+#ES_ROLE is for specifying the role (Enrollee or Mediator) for which scons is being executed
+help_vars.Add(EnumVariable('ES_ROLE', 'Target build mode', 'mediator', allowed_values=('mediator', 'enrollee')))
+#ES_SOFT_MODE is for specifying MODE (Mode 1 : Enrollee with Soft AP or Mode 2 : Mediator with Soft AP)
+help_vars.Add(EnumVariable('ES_SOFTAP_MODE', 'Target build mode', 'ENROLLEE_SOFTAP', allowed_values=('ENROLLEE_SOFTAP', 'MEDIATOR_SOFTAP')))
+
AddOption('--prefix',
dest='prefix',
type='string',
tools = ['gnulink', 'gcc', 'g++', 'ar', 'as']
)
else:
- env = Environment(variables = help_vars, TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'))
+ env = Environment(variables = help_vars, TARGET_ARCH = target_arch, TARGET_OS = target_os, ES_ROLE = es_role, ES_TARGET_ENROLLEE = es_target_enrollee, ES_SOFTAP_MODE = es_soft_mode, ESPREFIX = GetOption('prefix'))
Help(help_vars.GenerateHelpText(env))
secured = env.get('SECURED')
logging = env.get('LOGGING')
routing = env.get('ROUTING')
+es_role = env.get('ES_ROLE')
+es_target_enrollee = env.get('ES_TARGET_ENROLLEE')
+es_softap_mode = env.get('ES_SOFTAP_MODE')
print "Given Transport is %s" % transport
print "Given OS is %s" % target_os
+print "Given es_role is %s" % es_role
+print "Given es_target_enrollee is %s" % es_target_enrollee
+print "Given es_softap_mode is %s" % es_softap_mode
+
+
if target_os == 'tizen':
- command = "sh service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/gbsbuild.sh %s %s %s %s %s %s" % (transport, secured, buildsample, routing, release_mode, logging)
+ command = "sh service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/gbsbuild.sh %s %s %s %s %s %s %s %s %s" % (transport, secured, buildsample, routing, release_mode, logging, es_role, es_target_enrollee, es_softap_mode)
print "Created Command is %s" % command
gbs_script = env.Command('gbs_build', None, command)
AlwaysBuild ('gbs_script')
\ No newline at end of file
git commit -m "Initial commit"
fi
echo "Calling sample gbs build command"
-gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./ --define 'TARGET_TRANSPORT IP' --define 'SECURED 0' --define 'RELEASE 0' --define 'LOGGING True' --define 'ROUTING EP' --define 'TARGET_ENROLLEE tizen
-'"
+gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'ROUTING $4' --define 'RELEASE $5' --define 'LOGGING $6' --define 'ES_ROLE $7' --define 'ES_TARGET_ENROLLEE $8' --define 'ES_SOFTAP_MODE $9'"
echo $gbscommand
if eval $gbscommand; then
echo "Sample build is successful"
%build
-scons TARGET_OS=tizen LOGGING=True TARGET_TRANSPORT=%{TARGET_TRANSPORT} SECURED=%{SECURED} RELEASE=%{RELEASE} ROUTING=%{ROUTING}
+scons TARGET_OS=tizen LOGGING=True TARGET_TRANSPORT=%{TARGET_TRANSPORT} SECURED=%{SECURED} RELEASE=%{RELEASE} ROUTING=%{ROUTING} ES_ROLE=%{ES_ROLE} ES_TARGET_ENROLLEE=%{ES_TARGET_ENROLLEE} ES_SOFTAP_MODE=%{ES_SOFTAP_MODE}
%install
env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
elif routing == 'EP':
env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
-env.Append(LIBS=['octbstack','connectivity_abstraction','coap', 'ESEnrolleeSDK','pthread'])
+env.Append(LIBS=['octbstack','connectivity_abstraction','coap', 'libESEnrolleeSDK','pthread'])
if secured == '1':
env.PrependUnique(CPPPATH = [root_dir + '/external/inc/'])
1) If you are building first time, then delete GBS-ROOT folder from home directory.
Note: Default build server URL for Tizen is set in gbs configuration file @ iotivity/tools/tizen/.gbs.conf.
If needed, same can be modified as per appropriate target.
-2) Go to "iotivity/" folder.
-3) Execute following command(s) to start build based on transport selection required :
+2) Make the changes to spec file.
+ File name: iotivity/tools/tizen/iotivity.spec
+ Attributes to change[line no. 28~32] :
+ attribute value
+ es_target_enrollee tizen
+ es_role enrollee
+ softap_mode ENROLLEE_SOFTAP
+
+3) Go to "iotivity/" folder.
+4) Execute following command(s) to start build based on transport selection required :
scons -f service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP ROUTING=EP RELEASE=0 LOGGING=true
+ ES_ROLE=enrollee ES_TARGET_ENROLLEE=android ES_SOFTAP_MODE=ENROLLEE_SOFTAP
(If needed, modify the parameters accordingly)
Note :- Upon successful execution of above command(s) RI library and sample console application(for tizen enrollee)
%define release_mode false
%define secure_mode 0
+%define es_target_enrollee tizen
+%define es_role enrollee
+%define softap_mode ENROLLEE_SOFTAP
%description
IoTivity Base (RICH & LITE) Stack & IoTivity Services
%endif
-scons -j 4 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=IP RELEASE=%{release_mode} SECURED=%{secure_mode}
+scons -j 4 TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=IP RELEASE=%{release_mode} SECURED=%{secure_mode} ES_TARGET_ENROLLEE=%{es_target_enrollee} ES_ROLE=%{es_role} ES_SOFTAP_MODE=%{softap_mode}
%install
rm -rf %{buildroot}
%{_libdir}/librcs_common.so
%{_libdir}/librcs_container.so
%{_libdir}/librcs_server.so
+%{_libdir}/libESEnrolleeSDK.so
%files test
%manifest %{name}-test.manifest