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(EnumVariable('WITH_RD', 'Build including Resource Directory', '0', allowed_values=('0', '1')))
help_vars.Add(BoolVariable('SIMULATOR', 'Build with simulator module', False))
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')))
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
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']:
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"
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':
'-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':
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
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')
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')
#ifdef RA_ADAPTER
,CA_ADAPTER_REMOTE_ACCESS
#endif
+
+#ifdef TCP_ADAPTER
+ ,CA_ADAPTER_TCP
+#endif
};
int numConnTypes = sizeof(connTypes)/sizeof(connTypes[0]);