file naming convention should be consistent throughout the entire code.
camsgparser seems to mean the control layer functionality.
Change-Id: Idb5d31fb4b480e879cb50b70588cc6ef24c6a8a6
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1134
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Naga Ashok Jampani <jn.ashok@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
camessagehandler.c canetworkconfigurator.c caprotocolmessage.c \
caretransmission.c caqueueingthread.c \
$(ADAPTER_UTILS)/caadapternetdtls.c $(ADAPTER_UTILS)/caadapterutils.c \
- $(ADAPTER_UTILS)/camsgparser.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 \
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 camsgparser.c.o
+UTIL_OBJ = caadapterutils.c.o cafragmentation.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
* fragmentation and reassemebly.
*/
-#ifndef CA_MSG_PARSER_H_
-#define CA_MSG_PARSER_H_
+#ifndef CA_FRAGMENTATION_H_
+#define CA_FRAGMENTATION_H_
#include "cacommon.h"
#include "logger.h"
/*****************************************************************
* @file The CA Header format
- * @brief CA Header will be difined by 2 bytes of Header.
+ * @brief 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.
/**
* @fn CAGenerateHeader
* @brief This function is used to generate the CA specific header to maintain the fragmentation
-* logic. The header sturcture explained above will be formed and returned to the caller.
+* logic. The header structure explained above will be formed and returned to the caller.
*
-* @param[in] data Pointer to the charcter data which needs to be printed.
+* @param[in] data Pointer to the character data which needs to be printed.
* @param[in] length The total legth of the data which will be represented from 5th -16th bits
* in the header.
*
* @return CA_STATUS_OK on success. One of theCA_STATUS_FAILED or other error values on error.
* @retval CA_STATUS_OK Successful
-* @retval CA_STATUS_INVALID_PARAM Invalid input argumets
+* @retval CA_STATUS_INVALID_PARAM Invalid input arguments
* @retval CA_STATUS_FAILED Operation failed
*/
CAResult_t CAGenerateHeader(char *header, uint32_t length);
* @brief 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 charcter data which contains the header information.
+* @param[in] header Pointer to the character data which contains the header information.
* Note that pointer should point to two bytes of data header
* which needs to be parsed.
*
} /* extern "C" */
#endif
-#endif /* CA_MSG_PARSER_H_ */
+#endif /* CA_FRAGMENTATION_H_ */
env.AppendUnique(CA_SRC=[ca_path+'adapter_util/caadapterutils.c'])
-env.AppendUnique(CA_SRC=[ca_path+'adapter_util/camsgparser.c'])
+env.AppendUnique(CA_SRC=[ca_path+'adapter_util/cafragmentation.c'])
if env.get('SECURED') == '1':
env.AppendUnique(CA_SRC=[ca_path+'adapter_util/caadapternetdtls.c'])
env.AppendUnique(CPPPATH = [root_dir + '/external/inc/'])
*
******************************************************************/
-#include "camsgparser.h"
-
#include <string.h>
#include <math.h>
#include "cacommon.h"
#include "caadapterutils.h"
+#include "cafragmentation.h"
/**
- * @var CA_MSG_PARSER_TAG
- * @brief debugging tag for parser module
+ * @var CA_FRAGMENTATION_TAG
+ * @brief debugging tag for fragmentation module
*/
-#define CA_MSG_PARSER_TAG "CA_MSG_PARSER"
+#define CA_FRAGMENTATION_TAG "CA_FRAGMENTATION"
CAResult_t CAGenerateHeader(char *header, uint32_t length)
{
- OIC_LOG(DEBUG, CA_MSG_PARSER_TAG, "IN");
+ OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "IN");
- VERIFY_NON_NULL(header, CA_MSG_PARSER_TAG, "header is NULL");
+ VERIFY_NON_NULL(header, CA_FRAGMENTATION_TAG, "header is NULL");
memset(header, 0x0, sizeof(char) * CA_HEADER_LENGTH);
if(length > MAX_DATA_LENGTH_SUPPORTED)
{
- OIC_LOG(DEBUG, CA_MSG_PARSER_TAG, "Given length is more than 4095.It will be truncated");
+ OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG,
+ "Given length is more than 4095.It will be truncated");
}
//if length is more than 4095 then it will be truncated.
header[1] = length & 0xFF;
header[0] = length & 0x0F;
header[0] = header[0] | 0x40; // Adding version 0100.(Not used. Future use)
- OIC_LOG(DEBUG, CA_MSG_PARSER_TAG, "OUT");
+ OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "OUT");
+
return CA_STATUS_OK;
}
uint32_t CAParseHeader(const char *header)
{
- OIC_LOG(DEBUG, CA_MSG_PARSER_TAG, "IN");
+ OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "IN");
- VERIFY_NON_NULL(header, CA_MSG_PARSER_TAG, "header is NULL");
+ VERIFY_NON_NULL(header, CA_FRAGMENTATION_TAG, "header is NULL");
uint32_t dataLen = ((header[0] & 0x0F) << 8) | (header[1] & 0xFF);
- OIC_LOG(DEBUG, CA_MSG_PARSER_TAG, "OUT");
+ OIC_LOG(DEBUG, CA_FRAGMENTATION_TAG, "OUT");
return dataLen;
}
-
#include "caedrinterface.h"
#include "caadapterutils.h"
#include "logger.h"
-#include "camsgparser.h"
+#include "cafragmentation.h"
#include "caqueueingthread.h"
#include "oic_malloc.h"
#include "camutex.h"
#include "caadapterutils.h"
#include "caqueueingthread.h"
-#include "camsgparser.h"
+#include "cafragmentation.h"
#include "oic_malloc.h"
#include "oic_string.h"
#include "cableserver.h"
#include "logger.h"
#include "caadapterutils.h"
-#include "camsgparser.h"
+#include "cafragmentation.h"
#define TAG "LAD"
#include "uarraylist.h"
#include "caqueueingthread.h"
#include "caadapterutils.h"
-#include "camsgparser.h"
+#include "cafragmentation.h"
#include "oic_string.h"
#include "oic_malloc.h"
#include "camutex.h"
#include "caqueueingthread.h"
#include "caadapterutils.h"
-#include "camsgparser.h"
+#include "cafragmentation.h"
#include "cableutil.h"
#include "oic_string.h"
#include "oic_malloc.h"