From: Abhishek Sharma Date: Mon, 12 Oct 2015 10:55:15 +0000 (+0530) Subject: [ARDUINO][BLE] Enable Arduino BLE support in RI sample X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ad25ca88ce6ee3e5afd44362f6c722a60a28ca6;p=contrib%2Fiotivity.git [ARDUINO][BLE] Enable Arduino BLE support in RI sample Change-Id: Ie326dca25edbfea638e5fea718ad0802224e4c39 Signed-off-by: Abhishek Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/3807 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Jon A. Cruz --- diff --git a/arduino.scons b/arduino.scons index ae3b53f..4329775 100644 --- a/arduino.scons +++ b/arduino.scons @@ -35,6 +35,7 @@ Help(vars.GenerateHelpText(env)) env.ImportLib('SPI') if 'ETH' in env.get('SHIELD'): env.ImportLib('Ethernet') + env.AppendUnique(CPPDEFINES = ['ARDUINOETH']) if 'WIFI' in env.get('SHIELD'): env.ImportLib('WiFi') env.AppendUnique(CPPDEFINES = ['ARDUINOWIFI']) diff --git a/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript b/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript index 5b551bb..829ce52 100644 --- a/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript +++ b/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript @@ -21,9 +21,6 @@ Import('env') transport = env.get('TARGET_TRANSPORT') -if 'BLE' in transport: - # Only supported for ethernet and WiFi. - Return() arduino_simplecs_env = env.Clone() ###################################################################### diff --git a/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp b/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp index 22aab31..9c9885c 100644 --- a/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp +++ b/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp @@ -31,7 +31,7 @@ #include #include #include -#else +#elif defined ARDUINOETH // Arduino Ethernet Shield #include #include @@ -107,7 +107,7 @@ int ConnectToNetwork() OC_LOG_V(INFO, TAG, "IP Address: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); return 0; } -#else +#elif defined ARDUINOETH // Arduino Ethernet Shield int ConnectToNetwork() { @@ -249,11 +249,13 @@ void setup() OC_LOG(DEBUG, TAG, ("OCServer is starting...")); // Connect to Ethernet or WiFi network +#if defined(ARDUINOWIFI) || defined(ARDUINOETH) if (ConnectToNetwork() != 0) { OC_LOG(ERROR, TAG, ("Unable to connect to network")); return; } +#endif // Initialize the OC Stack in Server mode if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)