Merge remote-tracking branch 'origin/master' into notification-service
[platform/upstream/iotivity.git] / service / easy-setup / Build_Instructions_Android_Arduino.txt
old mode 100755 (executable)
new mode 100644 (file)
index 9056422..e6081fa
@@ -1,3 +1,23 @@
+#******************************************************************
+#
+# Copyright 2016 Samsung Electronics 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.
+#
+#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
 === Prerequisites ===
 
 * 1. Scons
@@ -29,13 +49,19 @@ Steps to build and deploy Easysetup Mediator in Android platform
         You should see the .aar files generated inside of '<iotivity>/android/android_api/base/build/outputs/aar' directory. The .aar files contain jni directory and also a .jar file
 
     c) Now navigate to the Easysetup NDK folder
-        <iotivity-root>/service/easy-setup/sdk/mediator/android
+        <iotivity-root>/service/easy-setup/mediator/richsdk/android
 
     d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files
        <iotivity>/extlibs/android/ndk/android-ndk-r10d/ndk-build
 
     e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder
-       <iotivity>/service/easy-setup/sdk/mediator/android/libs/armeabi
+       <iotivity>/service/easy-setup/mediator/richsdk/android/libs/armeabi
+
+NOTE: If you are going to use the SECURITY feature :
+
+      (a) please remove the "oic_svr_db_client.dat" file from the application (EasySetup/app/src/main/assets/)
+
+      (b) Copy the same file in the same folder from : <iotivity>/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat
 
 2) Compilation using Android Studio
 
@@ -43,8 +69,8 @@ Steps to build and deploy Easysetup Mediator in Android platform
         Install Android Studio and use the Android SDK manager to update the Android API to 21
 
     a) Import following projects to the Studio using the "File->New->Import Project"
-        - service\easy-setup\sdk\android\EasySetupCore
-        - service\easy-setup\sampleapp\android\EasySetup
+        - service/easy-setup/mediator/richsdk/android/EasySetupCore
+        - service/easy-setup/sampleapp/android/EasySetup
 
     b) EasySetupCore is dependent on the .aar files generated in 1.b
         1) To add an .aar file to the 'EasySetupCore' project,
@@ -56,11 +82,12 @@ Steps to build and deploy Easysetup Mediator in Android platform
     c)    Build EasySetupCore project using "Android Studio->Build->Make Module "easySetupCore"
         If the project is setup correctly, you should see a BUILD SUCCESSFUL in the Android Studio Gradle Build terminal
             You should see the .aar file generated inside of
-            'iotivity\service\easy-setup\sdk\mediator\android\easySetupCore\build\outputs\aar'
+            'iotivity/service/easy-setup/mediator/richsdk/android/easySetupCore/build/outputs/aar'
 
     d) EasySetup application is also dependent on the .so files generated in 1.d step
-        1) Drag and drop the following .so files in to the EasySetup\app\src\main\jniLibs\armeabi folder
-            - libeasysetup-jni.so [Easy Setup file]
+        1) Drag and drop the following .so files in to the EasySetup/app/src/main/jniLibs/armeabi folder
+            - libeasysetup-jni.so [Easy Setup JNI library]
+                       - libESMediatorRich.so [Easy Setup Mediator library]
 
     e) EasySetup is also dependent on the .aar files generated in 1.b and 2.c steps
         1) To add an .aar file to the 'EasySetup' project,
@@ -83,25 +110,26 @@ Steps to build and deploy Easysetup Mediator in Arduino platform
     c) Prerequisite exports for Arduino
          export ARDUINO_HOME=<ARDUINO_HOME_DIR>
     d) Start Arduino IDE. Select ""Tools->Port->Programming port"
-    e) scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI
+    e) scons service TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI
         - With debug or logging
-            scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
+            scons service TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
         - With installation to Arduino
-            scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 UPLOAD=true
-        NOTE: BOARD=arduino_due_x_dbg|arduino_due_x. Default is arduino_due_x_dbg.
+            scons service TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 UPLOAD=true
+        NOTE: 1) BOARD=arduino_due_x_dbg|arduino_due_x. Default is arduino_due_x_dbg.
+              2) For Mega board, please use the following options. BOARD=mega & TARGET_ARCH=avr
 
-       Possible values for <transport> are:
+       Possible values for <transport> are: [Only ip is currently supported]
         -> IP :
-        $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
+        $ scons service TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
         -> BLE :
-        $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
+        $ scons service TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=BLE RELEASE=0 [Currently not supporting]
 
         Note :- Only single transport can be built at a time for Arduino
     f) The above command will build sample. The "enrollee.hex" can be found at "out/arduino/arm/release/service/easy-setup/sampleapp/enrollee/arduino"
     g) After building sample, script will try to install on "/dev/ttyACM0" port in 'sudo' mode.
         To skip installation, set command line argument 'UPLOAD=false' or without UPLOAD option
     h) To set BLE Shield Name, include the option DEVICE_NAME during scons build.
-        -> $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=BLE RELEASE=0 DEVICE_NAME=OIC
+        -> $ scons service TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=BLE RELEASE=0 DEVICE_NAME=OIC
 
             Specified Device name length MUST be less than 10 characters. RBL Library has this limitation.
             By Default DEVICE_NAME=OIC-DEVICE, if device name option is not specified
@@ -111,22 +139,38 @@ Steps to build and deploy Easysetup Mediator in Arduino platform
 
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Folder structure:
-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++        
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 iotivity/
 └── service
     └── easy-setup/
         │── SConscript
-        │── sdk
+        │── enrollee
         │    └── inc
         │    └── src
-        │    └── android
-        │    └── arduino
-        │        └──wifi
-        │            └──inc
-        │            └──src
+        │    └── arduino/wifi
+        │    └── linux/wifi
+        │    └── tizen/wifi
+        │    └── SConscript
+        │
+        │── mediator
+        │    └── csdk
+        │        └──inc
+        │        └──src
+        │        └──SConscript
+        │    └── richsdk
+        │        └──android
+        │        └──inc
+        │        └──src
+        │        └──SConscript
+        │    └── SConscript
+        │
         │── sampleapp
         │    └──mediator/android
         │    └──mediator/linux
         │    └──enrollee/arduino
+        │    └──enrollee/linux
+        │    └──enrollee/tizen
+        │    └──enrollee/tizen-sdb
+        │
         └── Build_Instructions_Android_Arduino.txt - You are reading this.