From: hyuna0213.jo Date: Mon, 7 Mar 2016 07:40:39 +0000 (+0900) Subject: removed unnecessary cafragmentation files X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e26f05d77c666033380b8499f00bc5366bd1659b;p=contrib%2Fiotivity.git removed unnecessary cafragmentation files because fragmentation was not used, I deleted related code Change-Id: Ic5bbfdc731a3157235c2ca59d061e54575916c78 Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/5481 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Jon A. Cruz --- diff --git a/resource/csdk/connectivity/build/android/jni/Android.mk b/resource/csdk/connectivity/build/android/jni/Android.mk index 347daf7..efbf64f 100644 --- a/resource/csdk/connectivity/build/android/jni/Android.mk +++ b/resource/csdk/connectivity/build/android/jni/Android.mk @@ -151,7 +151,6 @@ LOCAL_SRC_FILES = \ camessagehandler.c canetworkconfigurator.c caprotocolmessage.c \ caretransmission.c caqueueingthread.c cablockwisetransfer.c \ $(ADAPTER_UTILS)/caadapternetdtls.c $(ADAPTER_UTILS)/caadapterutils.c \ - $(ADAPTER_UTILS)/cafragmentation.c \ bt_le_adapter/caleadapter.c $(LE_ADAPTER_PATH)/caleclient.c \ $(LE_ADAPTER_PATH)/caleserver.c $(LE_ADAPTER_PATH)/caleutils.c \ $(LE_ADAPTER_PATH)/calenwmonitor.c \ diff --git a/resource/csdk/connectivity/build/arduino/arduinomega.properties b/resource/csdk/connectivity/build/arduino/arduinomega.properties index 7227798..e1786e8 100755 --- a/resource/csdk/connectivity/build/arduino/arduinomega.properties +++ b/resource/csdk/connectivity/build/arduino/arduinomega.properties @@ -95,7 +95,7 @@ CORE_CPPOBJ = CDC.cpp.o HardwareSerial.cpp.o HardwareSerial0.cpp.o HardwareSeria main.cpp.o new.cpp.o Print.cpp.o Stream.cpp.o Tone.cpp.o USBCore.cpp.o WMath.cpp.o WString.cpp.o SPI_OBJ = SPI.cpp.o LOGGER_OBJ = logger.c.o oic_logger.c.o oic_console_logger.c.o oic_malloc.c.o oic_string.c.o uarraylist.c.o -UTIL_OBJ = caadapterutils.c.o cafragmentation.c.o +UTIL_OBJ = caadapterutils.c.o CACOMMON_OBJ = caconnectivitymanager_singlethread.c.o cainterfacecontroller_singlethread.c.o camessagehandler_singlethread.c.o canetworkconfigurator_singlethread.c.o caprotocolmessage_singlethread.c.o \ caremotehandler.c.o caretransmission_singlethread.c.o diff --git a/resource/csdk/connectivity/inc/cafragmentation.h b/resource/csdk/connectivity/inc/cafragmentation.h deleted file mode 100644 index 253fbd4..0000000 --- a/resource/csdk/connectivity/inc/cafragmentation.h +++ /dev/null @@ -1,169 +0,0 @@ -/* **************************************************************** - * - * Copyright 2014 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. - * - ******************************************************************/ - -/** - * @file - * - * This file contains common utility functions to manage the CA msg - * fragmentation and reassemebly. - */ - -#ifndef CA_FRAGMENTATION_H_ -#define CA_FRAGMENTATION_H_ - -#include "cacommon.h" -#include "logger.h" - -/** - * From the adapter level, this is the maximum data length is supported - * for the data transmission. - */ -#define MAX_DATA_LENGTH_SUPPORTED 4095 - -/** - * The number of bits allocated to represent data length in header. - */ -#define NUMBER_OF_BITS_TO_IDENTIFY_DATA 12 - -/** - * The length of the header in bits. - */ -#define NUMBER_OF_BITS_IN_CA_HEADER 15 - -/** - * The length of the header in bytes. - */ -#define CA_HEADER_LENGTH 2 - -/** - * The MTU supported for BLE adapter - */ -#define CA_SUPPORTED_BLE_MTU_SIZE 20 - -#ifdef __TIZEN__ -/** - * Reserved bit to differentiating the platform. Currently not in use. - */ -#define PLATFORM_IDENTIFIER_BIT 1 - -/** - * The MTU supported from Tizen platform for EDR adapter. - */ -#define CA_SUPPORTED_EDR_MTU_SIZE 512 - -#elif __ANDROID__ -/** - * Reserved bit to differentiating the platform. Currently not in use. - */ -#define PLATFORM_IDENTIFIER_BIT 0 - -/** - * The MTU supported from Android platform for EDR adapter. - */ -#define CA_SUPPORTED_EDR_MTU_SIZE 200 - -#elif __ARDUINO__ -/** - * Reserved bit to differentiating the platform. Currently not in use. - */ -#define PLATFORM_IDENTIFIER_BIT 0 - -/** - * The MTU supported from Arduino platform for EDR adapter. - */ -#define CA_SUPPORTED_EDR_MTU_SIZE 200 - -#else //Other Platforms -/** - * Reserved bit to differentiating the platform. Currently not in use. - */ -#define PLATFORM_IDENTIFIER_BIT 0 - -/** - * The MTU supported for EDR adapter - */ -#define CA_SUPPORTED_EDR_MTU_SIZE 200 - -#endif - -/** - * Current Header version. - */ -#define HEADER_VERSION 1 - -#ifdef __cplusplus -extern "C" -{ -#endif - -/***************************************************************** - * @file The CA Header format - * CA Header will be defined by 2 bytes of Header. - * First two bits : Header version(Currently Its not being used) - * Third bit and fourth bit: Reserved bits for future use. - * 5th to 16th bit : 12 bits to provide the length of the data. - *****************************************************************/ - -/** - * This function is used to generate the CA specific header to - * maintain the fragmentation logic. The header structure explained - * above will be formed and returned to the caller. - * - * @param[in,out] header Pointer to the octet array that will - * contain the generated header. - * @param[in] headerLength Length of the @a header octet array. - * @param[in] dataLength The total length of the data. The - * length will be embedded in bits 5-16 of - * the header, meaning the maximum overall - * length of the data to be fragmented can - * be no more than 4096 (2^12). - * - * @return @c CA_STATUS_OK on success. One of the @c CA_STATUS_FAILED - * or other error values on error. - * @retval @c CA_STATUS_OK Successful - * @retval @c CA_STATUS_INVALID_PARAM Invalid input arguments - * @retval @c CA_STATUS_FAILED Operation failed - */ -CAResult_t CAGenerateHeader(uint8_t *header, - size_t headerLength, - size_t datalength); - -/** - * This function is used to parse the header in the receiver end. This - * function will provide the information of the total length of the - * data which has been fragmented. - * - * @param[in] header Pointer to the octet array data which contains - * the header information. Note that pointer should - * point to two bytes of data header which needs to - * be parsed. - * @param[in] length Length of the @a octet array containing the - * header. - * - * @return Overall length of the data to be reassembled, or 0 on - * failure. - */ -uint32_t CAParseHeader(const uint8_t *header, size_t length); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* CA_FRAGMENTATION_H_ */ diff --git a/resource/csdk/connectivity/src/SConscript b/resource/csdk/connectivity/src/SConscript index 161f937..897e390 100644 --- a/resource/csdk/connectivity/src/SConscript +++ b/resource/csdk/connectivity/src/SConscript @@ -60,8 +60,6 @@ if env.get('SECURED') == '1': env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/caadapterutils.c')]) -env.AppendUnique(CA_SRC = [os.path.join(ca_path, - 'adapter_util/cafragmentation.c')]) if env.get('SECURED') == '1': env.AppendUnique(CA_SRC = [os.path.join(ca_path, diff --git a/resource/csdk/connectivity/src/adapter_util/cafragmentation.c b/resource/csdk/connectivity/src/adapter_util/cafragmentation.c deleted file mode 100644 index 6c6032f..0000000 --- a/resource/csdk/connectivity/src/adapter_util/cafragmentation.c +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************** - * - * Copyright 2014 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. - * - ******************************************************************/ - -#include -#include - -#include "cacommon.h" -#include "caadapterutils.h" -#include "cafragmentation.h" - -/** - * Debugging tag for fragmentation module. - */ -#define CA_FRAGMENTATION_TAG "OIC_CA_FRAG" - -CAResult_t CAGenerateHeader(uint8_t *header, - size_t headerLength, - size_t dataLength) -{ - OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "IN"); - - VERIFY_NON_NULL(header, CA_FRAGMENTATION_TAG, "header is NULL"); - - if (headerLength < CA_HEADER_LENGTH) - { - return CA_STATUS_FAILED; - } - - if (dataLength > MAX_DATA_LENGTH_SUPPORTED) - { - OIC_LOG_V(WARNING, - CA_FRAGMENTATION_TAG, - "Given length is more than %d. It will be truncated.", - MAX_DATA_LENGTH_SUPPORTED); - } - - // Only bother initializing the header section of the buffer. It - // is up to the caller to handle the data section. - memset(header, 0, CA_HEADER_LENGTH); - - // If length is more than 4095 then it will be truncated. - header[1] = dataLength & 0xFF; - dataLength >>= 8; - header[0] = dataLength & 0x0F; - header[0] = header[0] | 0x40; // Adding version 0100. - // (Not used. Future use) - - OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "OUT"); - - return CA_STATUS_OK; -} - -uint32_t CAParseHeader(const uint8_t *header, size_t length) -{ - OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "IN"); - - VERIFY_NON_NULL_RET(header, CA_FRAGMENTATION_TAG, "header is NULL", 0); - - uint32_t dataLen = 0; - - if (length >= CA_HEADER_LENGTH) - { - dataLen = ((header[0] & 0x0F) << 8) | (header[1] & 0xFF); - } - - OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "OUT"); - - return dataLen; -} diff --git a/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c b/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c index 956ddd4..ed5c47a 100644 --- a/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c +++ b/resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c @@ -29,7 +29,6 @@ #include "caedrinterface.h" #include "caadapterutils.h" #include "logger.h" -#include "cafragmentation.h" #include "caqueueingthread.h" #include "oic_malloc.h" #include "caremotehandler.h" diff --git a/resource/csdk/connectivity/src/bt_le_adapter/arduino/cableserver.cpp b/resource/csdk/connectivity/src/bt_le_adapter/arduino/cableserver.cpp index 8cd2fee..6e2c639 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/arduino/cableserver.cpp +++ b/resource/csdk/connectivity/src/bt_le_adapter/arduino/cableserver.cpp @@ -33,7 +33,6 @@ #include "caleinterface.h" #include "oic_malloc.h" #include "caadapterutils.h" -#include "cafragmentation.h" #define TAG "LES" /** diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 5266674..16122fe 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -29,7 +29,6 @@ #ifndef SINGLE_THREAD #include "caqueueingthread.h" #endif -#include "cafragmentation.h" #include "oic_malloc.h" #include "oic_string.h" #include "caremotehandler.h" @@ -41,6 +40,11 @@ #define CALEADAPTER_TAG "OIC_LE_ADAP" /** + * The MTU supported for BLE adapter + */ +#define CA_SUPPORTED_BLE_MTU_SIZE 20 + +/** * Stores information of all the senders. * * This structure will be used to track and defragment all incoming @@ -2580,4 +2584,4 @@ static void CALEErrorHandler(const char *remoteAddress, CAFreeEndpoint(rep); OIC_LOG(DEBUG, CALEADAPTER_TAG, "CALEErrorHandler OUT"); -} \ No newline at end of file +} diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c index b61f34c..2888c7b 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c @@ -22,7 +22,6 @@ #include "bluez.h" #include "utils.h" -#include "cafragmentation.h" #include "cagattservice.h" #include "logger.h" #include "oic_malloc.h" diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c index 99bfdd8..c50ba1b 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c @@ -19,7 +19,6 @@ #include "recv.h" #include "caremotehandler.h" -#include "cafragmentation.h" #include "oic_malloc.h" #include "oic_string.h" diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c index 3732bc9..3d4fd24 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient.c @@ -34,7 +34,6 @@ #include "uarraylist.h" #include "caqueueingthread.h" #include "caadapterutils.h" -#include "cafragmentation.h" #include "cagattservice.h" #include "oic_string.h" #include "oic_malloc.h"