modified build option for CoAP/TCP
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 7 Oct 2015 05:13:55 +0000 (14:13 +0900)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Wed, 7 Oct 2015 12:42:15 +0000 (12:42 +0000)
- 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: Ashok Channa <ashok.channa@samsung.com>
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3669
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
build_common/SConscript
resource/csdk/connectivity/SConscript
resource/csdk/connectivity/lib/libcoap-4.1.1/SConscript
resource/csdk/connectivity/src/SConscript
resource/csdk/stack/src/ocstack.c

index 5f03948..d808228 100644 (file)
@@ -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')))
index fbcbe66..0e37d4b 100644 (file)
@@ -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"
index 2f42239..ded6fd0 100644 (file)
@@ -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':
index 95a8076..8c4309c 100755 (executable)
@@ -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')
index 60b036b..46a110b 100755 (executable)
@@ -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]);