Commit 49e729ae authored by jnashok's avatar jnashok Committed by Erich Keane

Fixing CA android sample application and ndk build

While resolving merge conflicts, header file is missed.
This is necessary to build the sample application.
Added necessary changes to build androd ndk as well

Change-Id: I0e2185abb5c82042bf7273ef61022e448b32468d
Signed-off-by: default avatarjnashok <jn.ashok@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/962Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarjihwan seo <jihwan.seo@samsung.com>
Reviewed-by: default avatarErich Keane <erich.keane@intel.com>
parent afbdefd9
APP_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PATH = $(APP_PATH)
LOCAL_MODULE := TinyDtls
LOCAL_SRC_FILES := dtls.c crypto.c ccm.c hmac.c netq.c peer.c dtls_time.c session.c
#LOCAL_SRC_FILES += debug.c
LOCAL_SRC_FILES += aes/rijndael.c
LOCAL_SRC_FILES += ecc/ecc.c
LOCAL_SRC_FILES += sha2/sha2.c
LOCAL_C_INCLUDES := $(APP_PATH) $(APP_PATH)/aes $(APP_PATH)/ecc $(APP_PATH)/sha2
#LOCAL_CFLAGS := -DWITH_OICSTACK -fPIC
LOCAL_CFLAGS += -DDTLSv12 -DWITH_SHA256 -DDTLS_CHECK_CONTENTTYPE -DHAVE_SYS_TIME_H
include $(BUILD_SHARED_LIBRARY)
...@@ -13,6 +13,7 @@ $(info PLATFORM=$(APP_PLATFORM)) ...@@ -13,6 +13,7 @@ $(info PLATFORM=$(APP_PLATFORM))
BUILD = debug BUILD = debug
PROJECT_ROOT_PATH ?= ../.. PROJECT_ROOT_PATH ?= ../..
EXT_LIB_PATH = ../../../../../../extlibs
PROJECT_API_PATH = $(PROJECT_ROOT_PATH)/api PROJECT_API_PATH = $(PROJECT_ROOT_PATH)/api
PROJECT_INC_PATH = $(PROJECT_ROOT_PATH)/inc PROJECT_INC_PATH = $(PROJECT_ROOT_PATH)/inc
PROJECT_SRC_PATH = $(PROJECT_ROOT_PATH)/src PROJECT_SRC_PATH = $(PROJECT_ROOT_PATH)/src
...@@ -21,23 +22,22 @@ PROJECT_COMMON_INC_PATH = $(PROJECT_COMMON_PATH)/inc ...@@ -21,23 +22,22 @@ PROJECT_COMMON_INC_PATH = $(PROJECT_COMMON_PATH)/inc
PROJECT_COMMON_SRC_PATH = $(PROJECT_COMMON_PATH)/src PROJECT_COMMON_SRC_PATH = $(PROJECT_COMMON_PATH)/src
PROJECT_LIB_PATH = $(PROJECT_ROOT_PATH)/lib PROJECT_LIB_PATH = $(PROJECT_ROOT_PATH)/lib
PROJECT_EXTERNAL_PATH = $(PROJECT_ROOT_PATH)/external/inc PROJECT_EXTERNAL_PATH = $(PROJECT_ROOT_PATH)/external/inc
DTLS_LIB = $(PROJECT_LIB_PATH)/tinydtls DTLS_LIB = $(EXT_LIB_PATH)/tinydtls
GLIB_PATH = ../../../../../../extlibs/glib/glib-2.40.2 #GLIB_PATH = ../../../../../../extlibs/glib/glib-2.40.2
#Modify below values to enable/disable the Adapter #Modify below values to enable/disable the Adapter
#Suffix "NO_" to disable given adapter #Suffix "NO_" to disable given adapter
EDR = NO_EDR_ADAPTER EDR = EDR_ADAPTER
WIFI = WIFI_ADAPTER IP = IP_ADAPTER
LE = NO_LE_ADAPTER LE = LE_ADAPTER
ETHERNET = NO_ETHERNET_ADAPTER
#Add Pre processor definitions #Add Pre processor definitions
DEFINE_FLAG = -DWITH_POSIX -D__ANDROID__ DEFINE_FLAG = -DWITH_POSIX -D__ANDROID__
DEFINE_FLAG += -D$(EDR) -D$(LE) -D$(WIFI) -D$(ETHERNET) DEFINE_FLAG = -D__WITH_DTLS__
DEFINE_FLAG += -D$(EDR) -D$(LE) -D$(IP)
#Add Debug flags here #Add Debug flags here
DEBUG_FLAG = -DTB_LOG DEBUG_FLAG = -DTB_LOG
#DEBUG_FLAG += -DADB_SHELL
BUILD_FLAG.debug = $(DEFINE_FLAG) $(DEBUG_FLAG) BUILD_FLAG.debug = $(DEFINE_FLAG) $(DEBUG_FLAG)
BUILD_FLAG.release = $(DEFINE_FLAG) BUILD_FLAG.release = $(DEFINE_FLAG)
...@@ -46,26 +46,26 @@ BUILD_FLAG = $(BUILD_FLAG.$(BUILD)) ...@@ -46,26 +46,26 @@ BUILD_FLAG = $(BUILD_FLAG.$(BUILD))
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include glib #include glib
include $(CLEAR_VARS) #include $(CLEAR_VARS)
LOCAL_PATH = $(PROJECT_LIB_PATH)/android #LOCAL_PATH = $(PROJECT_LIB_PATH)/android
LOCAL_MODULE = Glib #LOCAL_MODULE = Glib
LOCAL_SRC_FILES := libglib-2.40.2.so #LOCAL_SRC_FILES := libglib-2.40.2.so
LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \ #LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \
$(GLIB_PATH)/glib # $(GLIB_PATH)/glib
#
include $(PREBUILT_SHARED_LIBRARY) #include $(PREBUILT_SHARED_LIBRARY)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include glibthread #include glibthread
include $(CLEAR_VARS) #include $(CLEAR_VARS)
LOCAL_PATH = $(PROJECT_LIB_PATH)/android #LOCAL_PATH = $(PROJECT_LIB_PATH)/android
LOCAL_MODULE = GLibThread #LOCAL_MODULE = GLibThread
LOCAL_SRC_FILES := libgthread-2.40.2.so #LOCAL_SRC_FILES := libgthread-2.40.2.so
LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \ #LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \
$(GLIB_PATH)/glib # $(GLIB_PATH)/glib
#
include $(PREBUILT_SHARED_LIBRARY) #include $(PREBUILT_SHARED_LIBRARY)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Build TinyDtls #Build TinyDtls
...@@ -82,10 +82,11 @@ include $(CLEAR_VARS) ...@@ -82,10 +82,11 @@ include $(CLEAR_VARS)
LOCAL_PATH = $(PROJECT_COMMON_SRC_PATH) LOCAL_PATH = $(PROJECT_COMMON_SRC_PATH)
LOCAL_MODULE = CACommon LOCAL_MODULE = CACommon
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
#LOCAL_SHARED_LIBRARIES = Glib GLibThread
LOCAL_SHARED_LIBRARIES = Glib GLibThread LOCAL_STATIC_LIBRARIES = rt pthread
LOCAL_CFLAGS = -D__ANDROID__ $(DEBUG_FLAG) LOCAL_CFLAGS = -D__ANDROID__ $(DEBUG_FLAG)
LOCAL_CFLAGS += -std=c99
LOCAL_C_INCLUDES = $(PROJECT_COMMON_INC_PATH) LOCAL_C_INCLUDES = $(PROJECT_COMMON_INC_PATH)
LOCAL_C_INCLUDES += $(PROJECT_API_PATH) LOCAL_C_INCLUDES += $(PROJECT_API_PATH)
...@@ -93,7 +94,7 @@ LOCAL_C_INCLUDES += $(PROJECT_API_PATH) ...@@ -93,7 +94,7 @@ LOCAL_C_INCLUDES += $(PROJECT_API_PATH)
LOCAL_SRC_FILES = oic_logger.c \ LOCAL_SRC_FILES = oic_logger.c \
oic_console_logger.c logger.c oic_malloc.c \ oic_console_logger.c logger.c oic_malloc.c \
uarraylist.c uqueue.c oic_string.c \ uarraylist.c uqueue.c oic_string.c \
uthreadpool.c umutex.c cathreadpool_pthreads.c camutex_pthreads.c
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
...@@ -121,7 +122,7 @@ LOCAL_PLATFORM = android ...@@ -121,7 +122,7 @@ LOCAL_PLATFORM = android
ENET_ADAPTER_PATH = ethernet_adapter/$(LOCAL_PLATFORM) ENET_ADAPTER_PATH = ethernet_adapter/$(LOCAL_PLATFORM)
EDR_ADAPTER_PATH = bt_edr_adapter/$(LOCAL_PLATFORM) EDR_ADAPTER_PATH = bt_edr_adapter/$(LOCAL_PLATFORM)
LE_ADAPTER_PATH = bt_le_adapter/$(LOCAL_PLATFORM) LE_ADAPTER_PATH = bt_le_adapter/$(LOCAL_PLATFORM)
WIFI_ADAPTER_PATH = wifi_adapter/$(LOCAL_PLATFORM) IP_ADAPTER_PATH = ip_adapter
ADAPTER_UTILS = adapter_util ADAPTER_UTILS = adapter_util
include $(CLEAR_VARS) include $(CLEAR_VARS)
...@@ -140,13 +141,13 @@ LOCAL_C_INCLUDES += $(PROJECT_EXTERNAL_PATH) ...@@ -140,13 +141,13 @@ LOCAL_C_INCLUDES += $(PROJECT_EXTERNAL_PATH)
LOCAL_C_INCLUDES += $(DTLS_LIB) LOCAL_C_INCLUDES += $(DTLS_LIB)
LOCAL_CFLAGS += $(BUILD_FLAG) LOCAL_CFLAGS += $(BUILD_FLAG)
LOCAL_CFLAGS += -std=c99 LOCAL_CFLAGS += -std=c99 -DWITH_POSIX
LOCAL_SRC_FILES = \ LOCAL_SRC_FILES = \
caconnectivitymanager.c caremotehandler.c cainterfacecontroller.c \ caconnectivitymanager.c caremotehandler.c cainterfacecontroller.c \
camessagehandler.c canetworkconfigurator.c caprotocolmessage.c \ camessagehandler.c canetworkconfigurator.c caprotocolmessage.c \
caretransmission.c caqueueingthread.c \ caretransmission.c caqueueingthread.c \
$(ADAPTER_UTILS)/caadapterutils.c \ $(ADAPTER_UTILS)/caadapternetdtls.c $(ADAPTER_UTILS)/caadapterutils.c \
$(ADAPTER_UTILS)/camsgparser.c \ $(ADAPTER_UTILS)/camsgparser.c \
bt_le_adapter/caleadapter.c $(LE_ADAPTER_PATH)/caleclient.c \ bt_le_adapter/caleadapter.c $(LE_ADAPTER_PATH)/caleclient.c \
$(LE_ADAPTER_PATH)/caleserver.c $(LE_ADAPTER_PATH)/caleutils.c \ $(LE_ADAPTER_PATH)/caleserver.c $(LE_ADAPTER_PATH)/caleutils.c \
...@@ -154,8 +155,8 @@ LOCAL_SRC_FILES = \ ...@@ -154,8 +155,8 @@ LOCAL_SRC_FILES = \
bt_edr_adapter/caedradapter.c $(EDR_ADAPTER_PATH)/caedrutils.c \ bt_edr_adapter/caedradapter.c $(EDR_ADAPTER_PATH)/caedrutils.c \
$(EDR_ADAPTER_PATH)/caedrclient.c $(EDR_ADAPTER_PATH)/caedrserver.c \ $(EDR_ADAPTER_PATH)/caedrclient.c $(EDR_ADAPTER_PATH)/caedrserver.c \
$(EDR_ADAPTER_PATH)/caedrnwmonitor.c \ $(EDR_ADAPTER_PATH)/caedrnwmonitor.c \
wifi_adapter/cawifiadapter.c $(WIFI_ADAPTER_PATH)/cawifiserver.c \ $(IP_ADAPTER_PATH)/caipadapter.c $(IP_ADAPTER_PATH)/caipserver.c \
$(WIFI_ADAPTER_PATH)/cawificlient.c $(WIFI_ADAPTER_PATH)/cawifinwmonitor.c \ $(IP_ADAPTER_PATH)/caipclient.c $(IP_ADAPTER_PATH)/android/caipnwmonitor.c \
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
...@@ -3,7 +3,7 @@ APP_PROJECT_PATH = ./ ...@@ -3,7 +3,7 @@ APP_PROJECT_PATH = ./
APP_STL = gnustl_shared APP_STL = gnustl_shared
APP_MODULES := CA APP_MODULES := CA
APP_PLATFORM = android-19 APP_PLATFORM = android-21
APP_CPPFLAGS += -fexceptions APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti += -Wno-error=format-security APP_CPPFLAGS += -frtti += -Wno-error=format-security
APP_CFLAGS = -Wno-error=format-security APP_CFLAGS = -Wno-error=format-security
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
APP_PROJECT_PATH = ./ APP_PROJECT_PATH = ./
APP_STL = gnustl_shared APP_STL = gnustl_shared
APP_PLATFORM = android-19 APP_PLATFORM = android-21
APP_CPPFLAGS += -fexceptions APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti += -Wno-error=format-security APP_CPPFLAGS += -frtti += -Wno-error=format-security
APP_CFLAGS = -Wno-error=format-security APP_CFLAGS = -Wno-error=format-security
APP_STL := gnustl_static APP_STL := gnustl_static
APP_PLATFORM = android-19 APP_PLATFORM = android-21
APP_CPPFLAGS += -fexceptions APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti APP_CPPFLAGS += -frtti
APP_CFLAGS = -Wno-error=format-security APP_CFLAGS = -Wno-error=format-security
...@@ -59,34 +59,42 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMFindResource ...@@ -59,34 +59,42 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMFindResource
/* /*
* Class: org_iotivity_service_RMInterface * Class: org_iotivity_service_RMInterface
* Method: RMSendRequest * Method: RMSendRequest
* Signature: (Ljava/lang/String;III)V * Signature: (Ljava/lang/String;Ljava/lang/String;III)V
*/ */
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendRequest JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendRequest
(JNIEnv *, jobject, jstring, jstring, jint, jint, jint); (JNIEnv *, jobject, jstring, jstring, jint, jint, jint);
/*
* Class: org_iotivity_service_RMInterface
* Method: RMSendReqestToAll
* Signature: (Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendReqestToAll
(JNIEnv *, jobject, jstring, jint);
/* /*
* Class: org_iotivity_service_RMInterface * Class: org_iotivity_service_RMInterface
* Method: RMSendResponse * Method: RMSendResponse
* Signature: (Ljava/lang/String;III)V * Signature: (IIII)V
*/ */
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendResponse JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendResponse
(JNIEnv *, jobject, jstring, jstring, jint, jint); (JNIEnv *, jobject, jint, jint, jint, jint);
/* /*
* Class: org_iotivity_service_RMInterface * Class: org_iotivity_service_RMInterface
* Method: RMAdvertiseResource * Method: RMAdvertiseResource
* Signature: (Ljava/lang/String;I)V * Signature: (Ljava/lang/String)V
*/ */
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMAdvertiseResource JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMAdvertiseResource
(JNIEnv *, jobject, jstring, jint); (JNIEnv *, jobject, jstring);
/* /*
* Class: org_iotivity_service_RMInterface * Class: org_iotivity_service_RMInterface
* Method: RMSendNotification * Method: RMSendNotification
* Signature: (Ljava/lang/String;I)V * Signature: (Ljava/lang/String;Ljava/lang/String;IIII)V
*/ */
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification
(JNIEnv *, jobject, jstring, jstring, jint, jint); (JNIEnv *, jobject, jstring, jstring, jint, jint, jint, jint);
/* /*
* Class: org_iotivity_service_RMInterface * Class: org_iotivity_service_RMInterface
...@@ -96,6 +104,22 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification ...@@ -96,6 +104,22 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSelectNetwork JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSelectNetwork
(JNIEnv *, jobject, jint); (JNIEnv *, jobject, jint);
/*
* Class: org_iotivity_service_RMInterface
* Method: RMUnSelectNetwork
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMUnSelectNetwork
(JNIEnv *, jobject, jint);
/*
* Class: org_iotivity_service_RMInterface
* Method: RMGetNetworkInfomation
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMGetNetworkInfomation
(JNIEnv *, jobject);
/* /*
* Class: org_iotivity_service_RMInterface * Class: org_iotivity_service_RMInterface
* Method: RMHandleRequestResponse * Method: RMHandleRequestResponse
...@@ -108,4 +132,3 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMHandleRequestResp ...@@ -108,4 +132,3 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMHandleRequestResp
} }
#endif #endif
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment