From 9f79e7a9892b5e8a3db704e3632ea118d314b250 Mon Sep 17 00:00:00 2001 From: Aleksandar Bozhinovski Date: Mon, 2 Apr 2012 16:56:05 +0200 Subject: Improve error handling New LCD function added which for received error code number returns its short and long description. ST-Ericsson ID: 321379 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204 Change-Id: I9537fc920696e718e35127875ad8441405af8ed2 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/54515 Reviewed-by: QATEST Reviewed-by: Viktor MLADENOVSKI Tested-by: Vlatko STENKOSKI Tested-by: Aleksandar BOZHINOVSKI Reviewed-by: Vlatko PISTOLOV Tested-by: Vlatko PISTOLOV --- Makefile | 13 +- lcmodule/Makefile | 2 +- .../config/error_codes.xml | 2 +- source/LCDriver.cpp | 6 + source/LCDriver.h | 12 ++ source/config/error_codes_desc_cpp.xsl | 140 +++++++++++++++++++++ source/config/lcdriver_error_codes.xml | 28 ++--- source/error_codes_desc.h | 11 ++ 8 files changed, 195 insertions(+), 19 deletions(-) create mode 100644 source/config/error_codes_desc_cpp.xsl create mode 100644 source/error_codes_desc.h diff --git a/Makefile b/Makefile index 4beeaf4..9b8c826 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ MINGW_X64_CC:=amd64-mingw32msvc- XALAN_PATH:=./lcmodule/tools/xalan-j_2_7_1/ LCD_CONFIG:=./source/config/ LCD_DIR:=./ +LCM_ERR_DESC_PATH:=../../lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml ifneq ($(shell which $(MINGW_X32_CC)g++), ) USE_MINGW_X32 := 1 @@ -55,7 +56,8 @@ LIBSRC := \ source/security_algorithms/SecurityAlgorithms.cpp\ source/security_algorithms/sha/sha2.cpp\ $(AUTO_DIR_LIB)/commands_marshal.cpp\ - $(AUTO_DIR_LIB)/a2_commands_marshal.cpp + $(AUTO_DIR_LIB)/a2_commands_marshal.cpp\ + $(AUTO_DIR_LIB)/error_codes_desc.cpp ifeq ($(BUILD_WIN),) LIBSRC += \ source/api_wrappers/linux/CThreadWrapper.cpp\ @@ -85,7 +87,8 @@ AUTOGEN_FILES := $(AUTO_DIR_LIB)/command_ids.h\ $(AUTO_DIR_LIB)/a2_command_ids.h\ $(AUTO_DIR_LIB)/a2_commands.h\ $(AUTO_DIR_LIB)/a2_commands_impl.h\ - $(AUTO_DIR_LIB)/a2_commands_marshal.cpp + $(AUTO_DIR_LIB)/a2_commands_marshal.cpp\ + $(AUTO_DIR_LIB)/error_codes_desc.cpp #include directories @@ -113,7 +116,7 @@ ifeq ($(BUILD_WIN),) CXXFLAGS := -c -O2 -Wall -fPIC -fvisibility=hidden -fno-strict-aliasing -DLCDRIVER_EXPORTS -D_FILE_OFFSET_BITS=64 else # For Windows x32 and x64 version compile flags -CXXFLAGS := -D__WIN32__ -mwindows -mthreads -fno-strict-aliasing -Wall $(BYTE_ORDER) -DWIN32 -DWIN32_LEAN_AND_MEAN -DNDEBUG -D_WINDOWS -D_USRDLL -DLCDRIVER_EXPORTS -D_FILE_OFFSET_BITS=64 +CXXFLAGS := -D__WIN32__ -O2 -mwindows -mthreads -fno-strict-aliasing -Wall $(BYTE_ORDER) -DWIN32 -DWIN32_LEAN_AND_MEAN -DNDEBUG -D_WINDOWS -D_USRDLL -DLCDRIVER_EXPORTS -D_FILE_OFFSET_BITS=64 endif ifeq ($(BUILD_WIN),) @@ -309,6 +312,10 @@ $(AUTO_DIR_LIB)/a2_commands_marshal.cpp: $(LCD_CONFIG)a2_commands.xml $(LCD_CONF @echo "Generating autogen $(AUTO_DIR_LIB)/a2_commands_marshal.cpp..." @java -classpath $(XALAN_PATH)xalan.jar org.apache.xalan.xslt.Process -in $(LCD_CONFIG)a2_commands.xml -xsl $(LCD_CONFIG)a2_commands_marshal_cpp.xsl -out $(AUTO_DIR_LIB)/a2_commands_marshal.cpp +$(AUTO_DIR_LIB)/error_codes_desc.cpp: $(LCD_CONFIG)lcdriver_error_codes.xml $(LCD_CONFIG)error_codes_desc_cpp.xsl | setup_folders + @echo "Generating autogen $(AUTO_DIR_LIB)/error_codes_desc.cpp..." + @java -classpath $(XALAN_PATH)xalan.jar org.apache.xalan.xslt.Process -in $(LCD_CONFIG)lcdriver_error_codes.xml -xsl $(LCD_CONFIG)error_codes_desc_cpp.xsl -out $@ -PARAM errorCodesLcmXml $(LCM_ERR_DESC_PATH) + #setting up needed folders $(BUILDFOLDER): | configfile @mkdir -p $@ 2> /dev/null diff --git a/lcmodule/Makefile b/lcmodule/Makefile index e464e8b..2834db2 100644 --- a/lcmodule/Makefile +++ b/lcmodule/Makefile @@ -119,7 +119,7 @@ ifeq ($(BUILD_WIN),) CFLAGS := -g -O2 -Wall -fPIC -fvisibility=hidden -DUINT64_SUPPORTED -DSINT64_SUPPORTED -DINT64_BASE_TYPE="long long" -DCFG_ENABLE_A2_FAMILY -DLCM_EXPORTS else # For Windows x32 and x64 version compile flags -CFLAGS := -Wall -D__WIN32__ -mthreads -mwindows -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DLCM_EXPORTS +CFLAGS := -Wall -O2 -D__WIN32__ -mthreads -mwindows -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DLCM_EXPORTS endif build: diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml b/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml index 459edac..68b9da3 100644 --- a/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml +++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml @@ -222,7 +222,7 @@ Internal error.Report this problem Internal error. Report this problem Internal error. Report this problem - short="Timer interrupt configure failed.">Internal error. Report this problem + Internal error. Report this problem + + + + + + + + + + + + + + + diff --git a/source/config/lcdriver_error_codes.xml b/source/config/lcdriver_error_codes.xml index 412a9e9..2f7720c 100644 --- a/source/config/lcdriver_error_codes.xml +++ b/source/config/lcdriver_error_codes.xml @@ -9,7 +9,7 @@ * General Fatal 10001-10025 * General Non-Fatal 10026-10050 --> - Timeout for previously sent request has occured. Request could be Protrom Command, Bulk transfer, or R15 Command. + Timeout for previously sent request has occurred. Request could be Protrom Command, Bulk transfer, or R15 Command. Invalid parameter found during executing LCDriver initialization functions. Failed to initialize Context. Failed to add the LCDriver context for the new device in the devices list. Try to reconnect the device, if the problem is still present report it. Failed to create interface for loader methods, possibly not enough memory to perform the operation. Try to reconnect the device, if the problem is still present report it. - Unknown exception occured while trying to create context for the connected device. Try to reconnect the device, if the problem is still present report it. + Unknown exception occurred while trying to create context for the connected device. Try to reconnect the device, if the problem is still present report it. Failed to create LCDriver context for the connected device, possibly not enough memory to perform the operation. Try to reconnect the device, if the problem is still present report it. Tried to create LCDriver interface with invalid pointer. - Tried to configure device with invalid pointer to LCDriver interface. Create the LCDriver interface for the conneceted device and try to configure the device later. If the problem is still present report it. + Tried to configure device with invalid pointer to LCDriver interface. Create the LCDriver interface for the connected device and try to configure the device later. If the problem is still present report it. The context for the device was previously created. Tried to execute loader method without creating loader method interface. Create the interface first and retry the same operation. If the problem is still present report it. Tried to create LCDriver context with invalid ID for the context. Try to create context with different context ID, if the problem is still present report it. @@ -31,7 +31,7 @@ * System Thread Fatal 10101-10125 * System Thread Non-Fatal 10126-10150 --> - The LCDriver thread exited in unexpected way. The error is not recognized, if the problem persists report it. + The LCDriver thread exited in unexpected way. The error is not recognized, if the problem persists report it. - Error occured while communicating the ROM code. Possibly there is some security issue with the used SW/HW. + Error occurred while communicating the ROM code. Possibly there is some security issue with the used SW/HW. The HW failed to respond during the initialization sequence. Try with other HW, if the problem still exist report it, otherwise probably it faulty HW. The HW initialization failed to start. Try with other HW, if the problem still exist report it, otherwise probably it faulty HW. @@ -53,10 +53,10 @@ * Loader Command Execution Non-Fatal 10276-10300 --> Failed to execute command because there is other active command. Try to execute command again. If the problem persists probably there is some blocked command. Restart the HW. - Callbacks for communication decvice are not configured. Try to configure device driver callbacks. If the problem persists report it. - Recived response for command other than it was expected. Probably there is communication error. Restart the HW, if the problem persists report it. + Callbacks for communication device are not configured. Try to configure device driver callbacks. If the problem persists report it. + Received response for command other than it was expected. Probably there is communication error. Restart the HW, if the problem persists report it. Command received from ME other than it was expected. Probably there is communication error. Restart the HW, if the problem persists report it. - Canceled execution of active command/communication due to reciving of cancel event. + Canceled execution of active command/communication due to receiving of cancel event. Unexpected event was received during command execution. Unexpected event was received during command execution. @@ -81,8 +81,8 @@ * LCM DLL Fatal 10401-10425 * LCM DLL Non-Fatal 10426-10450 --> - Loading of dependant library failed. Make sure that it is placed on correct location. - Some of dependend functions was not found in the given LCM library. Make sure that the version that is used is compatible. + Loading of dependent library failed. Make sure that it is placed on correct location. + Some of dependent functions was not found in the given LCM library. Make sure that the version that is used is compatible. Some of functions may not work in the given LCM library. Make sure that the PC LCM version that is used is compatible. Some of functions may not work in the given LCM library. Make sure that the LDR LCM version that is used is compatible. @@ -90,9 +90,9 @@ * Exceptions Fatal 10451-10475 * Exceptions Non-Fatal 10476-10500 --> - The active operation was stopped by uknown exception. Repeat the failure procedure, if the problem persists report it. - The activity didn't complete properly. Unhandled event was recieved during execution of command/activity. - The transfer of bulk data was interrpted by unknown exception. Data was not transferred successfuly. + The active operation was stopped by unknown exception. Repeat the failure procedure, if the problem persists report it. + The activity didn't complete properly. Unhandled event was received during execution of command/activity. + The transfer of bulk data was interrupted by unknown exception. Data was not transferred successfully. Failed to perform desired operation on the LCDriver context due to unknown exception.