X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=arduino.scons;h=43297753eb137022e27dd353c7697376feeac214;hb=856b306ed7f38f1fcbc92c6ac64863ebe95703d6;hp=4ab2affffc300e5e2a0cd64fe9655108c193b53c;hpb=27178e2d0135760d6e8cf8b1e0936d658d192fff;p=platform%2Fupstream%2Fiotivity.git diff --git a/arduino.scons b/arduino.scons index 4ab2aff..4329775 100644 --- a/arduino.scons +++ b/arduino.scons @@ -1,11 +1,52 @@ +#****************************************************************** +# +# Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved. +# +#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# ## # This script includes arduino specific config for oic-resource ## Import('env') -env.ImportLib('Time') -if env.get('NET') == 'Ethernet': +# Add 'SHIELD' build option, let user select board network connection type +vars = Variables() +if 'IP' in env.get('TARGET_TRANSPORT'): + vars.Add(EnumVariable('SHIELD', 'Network connection type', 'WIFI', ['ETH', 'WIFI'])) +elif 'BLE' in env.get('TARGET_TRANSPORT'): + vars.Add(EnumVariable('SHIELD', 'Network connection type', 'RBL_NRF8001', ['RBL_NRF8001'])) +vars.Update(env) +Help(vars.GenerateHelpText(env)) + +env.ImportLib('SPI') +if 'ETH' in env.get('SHIELD'): env.ImportLib('Ethernet') -else: + env.AppendUnique(CPPDEFINES = ['ARDUINOETH']) +if 'WIFI' in env.get('SHIELD'): env.ImportLib('WiFi') -env.ImportLib('SPI') \ No newline at end of file + env.AppendUnique(CPPDEFINES = ['ARDUINOWIFI']) +if 'RBL_NRF8001' in env.get('SHIELD'): + env.ImportLib('BLE') + env.ImportLib('RBL_nRF8001') + +env.ImportLib('Time/Time') +# we have variety of macros for arduino!! +env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO', '__ARDUINO__']) +# Set device name to __OIC_DEVICE_NAME__ +env.AppendUnique(CPPDEFINES = ['-D__OIC_DEVICE_NAME__=' + "\'\"" + env.get('DEVICE_NAME') + "\"\'"]) +if env.get('LOGGING'): + env.AppendUnique(CPPDEFINES = ['TB_LOG'])