Fix Arduino CI
authorDavid Antler <david.a.antler@intel.com>
Thu, 1 Sep 2016 21:46:06 +0000 (14:46 -0700)
committerUze Choi <uzchoi@samsung.com>
Wed, 7 Sep 2016 05:31:27 +0000 (05:31 +0000)
This should fix an issue with Arduino CI introduced through a
false-positive result.

Change-Id: I0255e8f78038557ececc7e0a1ff9741a9140f346
Signed-off-by: David Antler <david.a.antler@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11307
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
resource/csdk/SConscript
resource/csdk/security/src/directpairing.c

index 7aa175e..f1e7b50 100644 (file)
@@ -175,6 +175,11 @@ if with_tcp == True:
 
 liboctbstack_src.extend(env['cbor_files'])
 
+# Insert a hack for Arduino, whose compiler may not support all defines expected
+# by tinycbor
+if target_os in ['arduino']:
+       liboctbstack_env.AppendUnique(CPPDEFINES = ['INT64_MAX=0x7FFFFFFFFFFFFFFF'])
+
 if target_os in ['windows', 'msys_nt']:
        # Avoid a name conflict with the octbstack.lib target of the SharedLibrary.
        static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack_static', liboctbstack_src)
index e7ef882..b3680cf 100644 (file)
@@ -253,8 +253,12 @@ bool DPGenerateQuery(bool isSecure,
 \r
     switch(connType & CT_MASK_ADAPTER)\r
     {\r
+// @todo: Remove this ifdef. On Arduino, CT_ADAPTER_TCP resolves to the same value\r
+// as CT_ADAPTER_IP, resulting in a compiler error.\r
+#if (!defined(WITH_ARDUINO)) || defined(WITH_TCP)\r
         case CT_ADAPTER_TCP:\r
             prefix = (isSecure == true) ? QPREFIX_COAPS_TCP : QPREFIX_COAP_TCP;\r
+#endif // (!defined(WITH_ARDUINO)) || defined(WITH_TCP)\r
         case CT_ADAPTER_IP:\r
             switch(connType & CT_MASK_FLAGS & ~CT_FLAG_SECURE)\r
             {\r