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))
BUILD = debug
PROJECT_ROOT_PATH ?= ../..
EXT_LIB_PATH = ../../../../../../extlibs
PROJECT_API_PATH = $(PROJECT_ROOT_PATH)/api
PROJECT_INC_PATH = $(PROJECT_ROOT_PATH)/inc
PROJECT_SRC_PATH = $(PROJECT_ROOT_PATH)/src
......@@ -21,23 +22,22 @@ PROJECT_COMMON_INC_PATH = $(PROJECT_COMMON_PATH)/inc
PROJECT_COMMON_SRC_PATH = $(PROJECT_COMMON_PATH)/src
PROJECT_LIB_PATH = $(PROJECT_ROOT_PATH)/lib
PROJECT_EXTERNAL_PATH = $(PROJECT_ROOT_PATH)/external/inc
DTLS_LIB = $(PROJECT_LIB_PATH)/tinydtls
GLIB_PATH = ../../../../../../extlibs/glib/glib-2.40.2
DTLS_LIB = $(EXT_LIB_PATH)/tinydtls
#GLIB_PATH = ../../../../../../extlibs/glib/glib-2.40.2
#Modify below values to enable/disable the Adapter
#Suffix "NO_" to disable given adapter
EDR = NO_EDR_ADAPTER
WIFI = WIFI_ADAPTER
LE = NO_LE_ADAPTER
ETHERNET = NO_ETHERNET_ADAPTER
EDR = EDR_ADAPTER
IP = IP_ADAPTER
LE = LE_ADAPTER
#Add Pre processor definitions
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
DEBUG_FLAG = -DTB_LOG
#DEBUG_FLAG += -DADB_SHELL
BUILD_FLAG.debug = $(DEFINE_FLAG) $(DEBUG_FLAG)
BUILD_FLAG.release = $(DEFINE_FLAG)
......@@ -46,26 +46,26 @@ BUILD_FLAG = $(BUILD_FLAG.$(BUILD))
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include glib
include $(CLEAR_VARS)
LOCAL_PATH = $(PROJECT_LIB_PATH)/android
LOCAL_MODULE = Glib
LOCAL_SRC_FILES := libglib-2.40.2.so
LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \
$(GLIB_PATH)/glib
include $(PREBUILT_SHARED_LIBRARY)
#include $(CLEAR_VARS)
#LOCAL_PATH = $(PROJECT_LIB_PATH)/android
#LOCAL_MODULE = Glib
#LOCAL_SRC_FILES := libglib-2.40.2.so
#LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \
# $(GLIB_PATH)/glib
#
#include $(PREBUILT_SHARED_LIBRARY)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include glibthread
include $(CLEAR_VARS)
LOCAL_PATH = $(PROJECT_LIB_PATH)/android
LOCAL_MODULE = GLibThread
LOCAL_SRC_FILES := libgthread-2.40.2.so
LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \
$(GLIB_PATH)/glib
include $(PREBUILT_SHARED_LIBRARY)
#include $(CLEAR_VARS)
#LOCAL_PATH = $(PROJECT_LIB_PATH)/android
#LOCAL_MODULE = GLibThread
#LOCAL_SRC_FILES := libgthread-2.40.2.so
#LOCAL_EXPORT_C_INCLUDES = $(GLIB_PATH) \
# $(GLIB_PATH)/glib
#
#include $(PREBUILT_SHARED_LIBRARY)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Build TinyDtls
......@@ -82,18 +82,19 @@ include $(CLEAR_VARS)
LOCAL_PATH = $(PROJECT_COMMON_SRC_PATH)
LOCAL_MODULE = CACommon
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 += -std=c99
LOCAL_C_INCLUDES = $(PROJECT_COMMON_INC_PATH)
LOCAL_C_INCLUDES += $(PROJECT_API_PATH)
LOCAL_SRC_FILES = oic_logger.c \
oic_console_logger.c logger.c oic_malloc.c \
uarraylist.c uqueue.c oic_string.c \
uthreadpool.c umutex.c
oic_console_logger.c logger.c oic_malloc.c \
uarraylist.c uqueue.c oic_string.c \
cathreadpool_pthreads.c camutex_pthreads.c
include $(BUILD_STATIC_LIBRARY)
......@@ -121,7 +122,7 @@ LOCAL_PLATFORM = android
ENET_ADAPTER_PATH = ethernet_adapter/$(LOCAL_PLATFORM)
EDR_ADAPTER_PATH = bt_edr_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
include $(CLEAR_VARS)
......@@ -140,13 +141,13 @@ LOCAL_C_INCLUDES += $(PROJECT_EXTERNAL_PATH)
LOCAL_C_INCLUDES += $(DTLS_LIB)
LOCAL_CFLAGS += $(BUILD_FLAG)
LOCAL_CFLAGS += -std=c99
LOCAL_CFLAGS += -std=c99 -DWITH_POSIX
LOCAL_SRC_FILES = \
caconnectivitymanager.c caremotehandler.c cainterfacecontroller.c \
camessagehandler.c canetworkconfigurator.c caprotocolmessage.c \
caretransmission.c caqueueingthread.c \
$(ADAPTER_UTILS)/caadapterutils.c \
$(ADAPTER_UTILS)/caadapternetdtls.c $(ADAPTER_UTILS)/caadapterutils.c \
$(ADAPTER_UTILS)/camsgparser.c \
bt_le_adapter/caleadapter.c $(LE_ADAPTER_PATH)/caleclient.c \
$(LE_ADAPTER_PATH)/caleserver.c $(LE_ADAPTER_PATH)/caleutils.c \
......@@ -154,8 +155,8 @@ LOCAL_SRC_FILES = \
bt_edr_adapter/caedradapter.c $(EDR_ADAPTER_PATH)/caedrutils.c \
$(EDR_ADAPTER_PATH)/caedrclient.c $(EDR_ADAPTER_PATH)/caedrserver.c \
$(EDR_ADAPTER_PATH)/caedrnwmonitor.c \
wifi_adapter/cawifiadapter.c $(WIFI_ADAPTER_PATH)/cawifiserver.c \
$(WIFI_ADAPTER_PATH)/cawificlient.c $(WIFI_ADAPTER_PATH)/cawifinwmonitor.c \
$(IP_ADAPTER_PATH)/caipadapter.c $(IP_ADAPTER_PATH)/caipserver.c \
$(IP_ADAPTER_PATH)/caipclient.c $(IP_ADAPTER_PATH)/android/caipnwmonitor.c \
include $(BUILD_STATIC_LIBRARY)
......@@ -3,7 +3,7 @@ APP_PROJECT_PATH = ./
APP_STL = gnustl_shared
APP_MODULES := CA
APP_PLATFORM = android-19
APP_PLATFORM = android-21
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti += -Wno-error=format-security
APP_CFLAGS = -Wno-error=format-security
......@@ -22,7 +22,7 @@
APP_PROJECT_PATH = ./
APP_STL = gnustl_shared
APP_PLATFORM = android-19
APP_PLATFORM = android-21
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti += -Wno-error=format-security
APP_CFLAGS = -Wno-error=format-security
APP_STL := gnustl_static
APP_PLATFORM = android-19
APP_PLATFORM = android-21
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti
APP_CFLAGS = -Wno-error=format-security
......@@ -59,34 +59,42 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMFindResource
/*
* Class: org_iotivity_service_RMInterface
* 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
(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
* Method: RMSendResponse
* Signature: (Ljava/lang/String;III)V
* Signature: (IIII)V
*/
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
* Method: RMAdvertiseResource
* Signature: (Ljava/lang/String;I)V
* Signature: (Ljava/lang/String)V
*/
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMAdvertiseResource
(JNIEnv *, jobject, jstring, jint);
(JNIEnv *, jobject, jstring);
/*
* Class: org_iotivity_service_RMInterface
* 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
(JNIEnv *, jobject, jstring, jstring, jint, jint);
(JNIEnv *, jobject, jstring, jstring, jint, jint, jint, jint);
/*
* Class: org_iotivity_service_RMInterface
......@@ -96,6 +104,22 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSendNotification
JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMSelectNetwork
(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
* Method: RMHandleRequestResponse
......@@ -108,4 +132,3 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_RMInterface_RMHandleRequestResp
}
#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