Commit 2f762d04 authored by jihwan.seo's avatar jihwan.seo Committed by Patrick Lankswert

modified build option for CoAP/TCP

- There is no way to select ALL option without TCP
  in previous build option.
- CoAP/TCP should be also used WITH_TCP option like WITH_RA.
- and CoAP/TCP can be supported optionally more easy
  for Non-IP Transfer.

Change-Id: I173205871d44a4e85fdfe5626841f74c27206c7a
Signed-off-by: default avatarAshok Channa <ashok.channa@samsung.com>
Signed-off-by: default avatarjihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3669Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarPatrick Lankswert <patrick.lankswert@intel.com>
parent 753d7a15
......@@ -79,13 +79,14 @@ help_vars.Add(EnumVariable('TARGET_OS', 'Target platform', host, host_target_map
help_vars.Add(BoolVariable('WITH_RA', 'Build with Remote Access module', False))
help_vars.Add(BoolVariable('WITH_TCP', 'Build with TCP adapter', False))
help_vars.Add(BoolVariable('SIMULATOR', 'Build with simulator module', False))
help_vars.Add(EnumVariable('WITH_RD', 'Build including Resource Directory', '0', allowed_values=('0', '1')))
if target_os in targets_disallow_multitransport:
help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'IP', ['BT', 'BLE', 'IP']))
else:
help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP', 'TCP']))
help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP']))
help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
......
......@@ -8,6 +8,7 @@ target_os = env.get('TARGET_OS')
transport = env.get('TARGET_TRANSPORT')
build_sample = env.get('BUILD_SAMPLE')
with_ra = env.get('WITH_RA')
with_tcp = env.get('WITH_TCP')
print "Given Transport is %s" % transport
print "Given OS is %s" % target_os
......@@ -24,8 +25,10 @@ if target_os in targets_disallow_multitransport:
if 'ALL' in transport:
if with_ra == True:
env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
if with_tcp == True:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
if target_os == 'linux':
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','LE_ADAPTER', 'TCP_ADAPTER'])
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','LE_ADAPTER'])
elif target_os == 'tizen':
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
elif target_os in['darwin','ios']:
......@@ -56,7 +59,7 @@ else:
else:
env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
if 'TCP' in transport:
if with_tcp == True:
if target_os in['linux']:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
print "CA Transport is TCP"
......
......@@ -8,6 +8,7 @@ libcoap_env = env.Clone()
target_os = env.get('TARGET_OS')
ca_transport = env.get('TARGET_TRANSPORT')
with_tcp = env.get('WITH_TCP')
# As in the source code(C) includes arduino Time library head file(C++)
# It requires compile the .c with g++
if target_os == 'arduino':
......@@ -37,7 +38,7 @@ if target_os not in ['windows', 'winrt']:
'-fdata-sections', '-fno-exceptions'])
if target_os == 'linux':
if (('TCP' in ca_transport) or ('ALL' in ca_transport)):
if with_tcp == True:
libcoap_env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
if target_os == 'android':
......
......@@ -10,6 +10,7 @@ ca_os = env.get('TARGET_OS')
ca_transport = env.get('TARGET_TRANSPORT')
secured = env.get('SECURED')
with_ra = env.get ('WITH_RA')
with_tcp = env.get('WITH_TCP')
root_dir = os.pardir
ca_path = os.curdir
......@@ -112,6 +113,7 @@ env.AppendUnique(CA_SRC = ca_common_src)
if 'ALL' in ca_transport:
transports = [ 'ip_adapter', 'bt_edr_adapter', 'bt_le_adapter']
if ca_os == 'linux':
if with_tcp:
transports.append ('tcp_adapter')
if with_ra:
transports.append ('ra_adapter')
......@@ -127,8 +129,6 @@ if 'BT' in ca_transport:
if 'BLE' in ca_transport:
env.SConscript(os.path.join(ca_path, 'bt_le_adapter/SConscript'))
if 'TCP' in ca_transport:
env.SConscript(os.path.join(ca_path, 'tcp_adapter/SConscript'))
print "Include path is %s" % env.get('CPPPATH')
print "Files path is %s" % env.get('CA_SRC')
......
......@@ -4197,6 +4197,10 @@ CAResult_t OCSelectNetwork()
#ifdef RA_ADAPTER
,CA_ADAPTER_REMOTE_ACCESS
#endif
#ifdef TCP_ADAPTER
,CA_ADAPTER_TCP
#endif
};
int numConnTypes = sizeof(connTypes)/sizeof(connTypes[0]);
......
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