summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorunknown <XSLOSHO@.seavus-dev2.com>2011-11-07 10:14:35 +0100
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2012-05-25 14:38:13 +0200
commite5812923ee1ae1298cb9ebf8a095cc62367a399c (patch)
tree5879aa1d44cc4a7704c86e1efb58059a7b39255b /source
parentc60e5c40802a7f14e9005eb9f462c6f741b1e839 (diff)
Add LCD/LCM compatibility check
LCD/LCM compatibility check added to determine whether PC-LCM is compatible with the LCD. Error handling in LCM is added. Depends-On: I6ad7dc8807cb8c407379fe448f06816904253520 ST-Ericsson ID: 362575 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204 Change-Id: If5b3c993739f93276e2a76b012a1852d687ad746 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/36378 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com> Tested-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com>
Diffstat (limited to 'source')
-rw-r--r--[-rwxr-xr-x]source/LCDriver.rc4
-rw-r--r--source/LCDriver.vcproj4
-rw-r--r--source/LCDriverMethods.cpp75
-rw-r--r--source/LCDriverMethods.h3
-rw-r--r--source/LCM/include/t_bulk_protocol.h19
-rw-r--r--source/LcdVersion.cpp21
-rw-r--r--source/LcmInterface.cpp46
-rw-r--r--source/LcmInterface.h13
-rw-r--r--source/config/lcdriver_error_codes.xml2
-rw-r--r--source/utilities/BulkHandler.cpp6
-rw-r--r--source/utilities/BulkHandler.h2
11 files changed, 166 insertions, 29 deletions
diff --git a/source/LCDriver.rc b/source/LCDriver.rc
index 7fe379e..4d6b2e5 100755..100644
--- a/source/LCDriver.rc
+++ b/source/LCDriver.rc
@@ -87,9 +87,9 @@ BEGIN
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "Loader Communication Driver"
VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2011"
- VALUE "PrivateBuild", "Change-Id: I0498cbaecea78651418d11ea2643fcafa3ac4880"
+ VALUE "PrivateBuild", "Change-Id: If5b3c993739f93276e2a76b012a1852d687ad746"
VALUE "ProductName", "CXC 173 0865, LCDriver DLL"
- VALUE "ProductVersion", "PT8"
+ VALUE "ProductVersion", "R1T"
END
END
BLOCK "VarFileInfo"
diff --git a/source/LCDriver.vcproj b/source/LCDriver.vcproj
index 23d1308..21feb76 100644
--- a/source/LCDriver.vcproj
+++ b/source/LCDriver.vcproj
@@ -539,6 +539,10 @@
RelativePath=".\LCDriverThread.cpp"
>
</File>
+ <File
+ RelativePath=".\LcdVersion.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="api_wrappers"
diff --git a/source/LCDriverMethods.cpp b/source/LCDriverMethods.cpp
index a24e5b9..13997ea 100644
--- a/source/LCDriverMethods.cpp
+++ b/source/LCDriverMethods.cpp
@@ -343,6 +343,13 @@ void CLCDriverMethods::BulkDataReqCallback(void *pObject, uint16 uiSession, uint
return pLcdMethods->Do_BulkDataReqCallback(uiSession, uiChunkSize, uiOffset, uiLength, uiTotalLength, uiTransferedLength);
}
+void CLCDriverMethods::BulkReleaseBuffers(void *pObject, TL_BulkVectorList_t *BulkVector_p)
+{
+ CLCDriverMethods *pLcdMethods = static_cast<CLCDriverMethods *>(pObject);
+ return pLcdMethods->m_pBuffers->ReleaseBulkVector(BulkVector_p);
+}
+
+
void CLCDriverMethods::BulkDataEndOfDumpCallback(void *pObject)
{
CLCDriverMethods *pLcdMethods = static_cast<CLCDriverMethods *>(pObject);
@@ -526,6 +533,10 @@ int CLCDriverMethods::Done_System_LoaderStartupStatus(char *pchVersion, int *piV
CopyStringToArray(m_pCmdResult->System_LoaderStartupStatus_LoaderVersion, pchVersion, piVersionSize);
CopyStringToArray(m_pCmdResult->System_LoaderStartupStatus_ProtocolVersion, pchProtocol, piProtocolSize);
+ //TODO: enable LCM_LDR Version check here!!!!
+ //LCM_t LCMType = LDR_LCM;
+ //VERIFY_SUCCESS(m_pLcmInterface->CommunicationCheckVersion(pchProtocol,LCMType));
+
ErrorExit:
if (E_SUCCESS != ReturnValue) {
@@ -688,7 +699,12 @@ int CLCDriverMethods::Do_System_ExecuteSoftware(const uint32 ExecuteMode, const
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
+
m_pBuffers->ReleaseBulkFile();
}
@@ -910,6 +926,7 @@ int CLCDriverMethods::Do_Flash_ProcessFile(const char *pchPath, const char *pchT
if (iUseBulk) {
CLockCS lock(LCDMethodsCS);
m_pLcmInterface->BulkSetCallbacks((void *)BulkCommandReqCallback, (void *)BulkDataReqCallback, (void *)BulkDataEndOfDumpCallback);
+ m_pLcmInterface->BulkBuffersRelease((void *)BulkReleaseBuffers);
VERIFY_SUCCESS(m_pBuffers->AllocateBulkFile(pchPath));
uint64 uiLength = m_pBuffers->GetBulkFileLength();
m_uiBulkLength = uiLength;
@@ -927,10 +944,14 @@ int CLCDriverMethods::Do_Flash_ProcessFile(const char *pchPath, const char *pchT
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
- if (0 != iDeleteBuffers) {
- m_pBuffers->ReleaseBulkFile();
+ if (0 != iDeleteBuffers) {
+ m_pBuffers->ReleaseBulkFile();
+ }
}
}
@@ -1008,7 +1029,11 @@ int CLCDriverMethods::Do_Flash_DumpArea(const char *pchPathToDump, uint64 uiStar
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
}
return ReturnValue;
@@ -1081,7 +1106,11 @@ int CLCDriverMethods::Do_Flash_FlashRaw(const char *pchPath, uint64 uiStart, uin
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
if (0 != iDeleteBuffers) {
m_pBuffers->ReleaseBulkFile();
@@ -1282,7 +1311,11 @@ int CLCDriverMethods::Do_FileSystem_CopyFile(const char *pchSourcePath, int iSou
ErrorExit:
if (iSourceUseBulk || iDestinationUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
if (iSourceUseBulk) {
m_pBuffers->ReleaseBulkFile();
@@ -1376,7 +1409,13 @@ int CLCDriverMethods::Do_FileSystem_ReadLoadModuleManifests(const char *pchTarge
VERIFY_SUCCESS(WaitForEvent(EVENT_GR_RECEIVED, GROUP_FILE_SYSTEM_OPERATIONS, COMMAND_FILE_SYSTEM_OPERATIONS_READLOADMODULESMANIFESTS));
ErrorExit:
- m_pBulkHandler->Finish();
+
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
+
return ReturnValue;
}
@@ -1495,7 +1534,12 @@ int CLCDriverMethods::Do_OTP_StoreSecureObject(const char *pchSourcePath, int iD
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
+
m_pBuffers->ReleaseBulkFile();
}
@@ -1580,7 +1624,11 @@ int CLCDriverMethods::Do_ParameterStorage_ReadGlobalDataSet(const char *pchGdfsI
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
}
return ReturnValue;
@@ -1618,7 +1666,12 @@ int CLCDriverMethods::Do_ParameterStorage_WriteGlobalDataSet(const char *pchGdfs
ErrorExit:
if (iUseBulk) {
- m_pBulkHandler->Finish();
+ if (E_SUCCESS != ReturnValue) {
+ m_pBulkHandler->Finish(TRUE);
+ } else {
+ m_pBulkHandler->Finish(FALSE);
+ }
+
m_pBuffers->ReleaseBulkFile();
}
diff --git a/source/LCDriverMethods.h b/source/LCDriverMethods.h
index 203b0e5..037b880 100644
--- a/source/LCDriverMethods.h
+++ b/source/LCDriverMethods.h
@@ -215,6 +215,9 @@ public:
static void BulkDataEndOfDumpCallback(void *pObject);
void Do_BulkDataEndOfDumpCallback();
+ static void BulkReleaseBuffers(void *pObject, TL_BulkVectorList_t *BulkVector_p);
+
+
int MapLcmError(int error);
void SignalError(int error);
diff --git a/source/LCM/include/t_bulk_protocol.h b/source/LCM/include/t_bulk_protocol.h
index 99109e6..38ca8b4 100644
--- a/source/LCM/include/t_bulk_protocol.h
+++ b/source/LCM/include/t_bulk_protocol.h
@@ -35,13 +35,6 @@
/** Defined bulk error in 64 bits format. */
#define BULK_ERROR_64 0xffffffffffffffff
-#ifndef CFG_ENABLE_LOADER_TYPE
-/** Defined Callback functions used for bulk transfer in the LCM on PC side. */
-typedef void (*BulkCommandReqCallback_t)(void *Object_p, uint16 Session, uint32 ChunkSize, uint64 Offset, uint32 Length, boolean ACK_Read);
-typedef void (*BulkDataReqCallback_t)(void *Object_p, uint16 Session, uint32 ChunkSize, uint64 Offset, uint32 Length, uint64 TotalLength, uint32 TransferedLength);
-typedef void (*BulkDataEndOfDump_t)(void *Object_p);
-#endif // CFG_ENABLE_LOADER_TYPE
-
/** Defined bulk commands. */
typedef enum {
CMD_BULK_STATUS = 0x00, /**< Status packet type command. */
@@ -71,7 +64,8 @@ TYPEDEF_ENUM {
WAIT_TX_DONE = 9, /**< Wait all chunks to be sent. */
WRITE_BULK_FINISH = 10, /**< Bulk acknowledge has been received,
finish the write bulk process. */
- WAIT_WRITE_REQUEST = 11 /**< Wait bulk request command. */
+ WAIT_WRITE_REQUEST = 11, /**< Wait bulk request command. */
+ CANCEL_BULK = 12
} ENUM8(TL_BulkProtocolState_t);
/** Defined bulk process states. */
@@ -162,6 +156,15 @@ typedef struct {
current session is in process of sending. */
} BulkHandle_t;
+#ifndef CFG_ENABLE_LOADER_TYPE
+/** Defined Callback functions used for bulk transfer in the LCM on PC side. */
+typedef void (*BulkCommandReqCallback_t)(void *Object_p, uint16 Session, uint32 ChunkSize, uint64 Offset, uint32 Length, boolean ACK_Read);
+typedef void (*BulkDataReqCallback_t)(void *Object_p, uint16 Session, uint32 ChunkSize, uint64 Offset, uint32 Length, uint64 TotalLength, uint32 TransferedLength);
+typedef void (*BulkDataEndOfDump_t)(void *Object_p);
+typedef void (*BulkBuffersRelease_t)(void *Object_p, TL_BulkVectorList_t *BulkVector_p);
+#endif // CFG_ENABLE_LOADER_TYPE
+
+
/** @} */
/** @} */
/** @} */
diff --git a/source/LcdVersion.cpp b/source/LcdVersion.cpp
new file mode 100644
index 0000000..4b46588
--- /dev/null
+++ b/source/LcdVersion.cpp
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (C) ST-Ericsson SA 2011
+ * License terms: 3-clause BSD license
+ ******************************************************************************/
+#include "lcdriver_error_codes.h"
+#include "LcmInterface.h"
+#include "Error.h"
+#ifdef _WIN32
+#include "WinApiWrappers.h"
+#else
+#include "LinuxApiWrappers.h"
+#include <dlfcn.h>
+#define GetProcAddress dlsym
+#endif
+/**
+ * var char *LCD_VersionList[]
+ * brief ASCII string list variable holding the LCD version/build time/product number..
+ */
+char *LCD_VersionList[] = {"R1V",
+ NULL
+ };
diff --git a/source/LcmInterface.cpp b/source/LcmInterface.cpp
index f820603..335fbe0 100644
--- a/source/LcmInterface.cpp
+++ b/source/LcmInterface.cpp
@@ -15,7 +15,7 @@
#endif
char *LcmInterface::m_pchLCMLibPath = 0;
-
+extern char *LCD_VersionList[];
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -75,6 +75,7 @@ int LcmInterface::LoadLCMLibrary()
Communication.Send_Fn = (CommunicationSend_t)GetProcAddress(m_hDLL, "Do_Communication_Send");
Communication.SetProtocolTimeouts_Fn = (CommunicationSetProtocolTimeouts_t)GetProcAddress(m_hDLL, "Do_Communication_SetProtocolTimeouts");
Communication.GetProtocolTimeouts_Fn = (CommunicationGetProtocolTimeouts_t)GetProcAddress(m_hDLL, "Do_Communication_GetProtocolTimeouts");
+ Communication.GetVersion_Fn = (CommunicationGetVersion_t)GetProcAddress(m_hDLL, "Do_Communication_GetVersion");
Communication.CancelReceiver_Fn = (CommunicationCancelReceiver_t)GetProcAddress(m_hDLL, "Do_Communication_Cancel_Receiver");
R15Command.Send_Fn = (R15CommandSend_t)GetProcAddress(m_hDLL, "Do_R15_Command_Send");
@@ -87,8 +88,9 @@ int LcmInterface::LoadLCMLibrary()
R15Bulk.GetStatusSession_Fn = (R15BulkGetStatusSession_t)GetProcAddress(m_hDLL, "Do_R15_Bulk_GetStatusSession");
R15Bulk.CloseSession_Fn = (R15BulkCloseSession_t)GetProcAddress(m_hDLL, "Do_R15_Bulk_CloseSession");
R15Bulk.SetCallbacks_Fn = (R15BulkSetCallbacks_t)GetProcAddress(m_hDLL, "Do_R15_Bulk_SetCallbacks");
+ R15Bulk.SetBuffersRelease_Fn = (R15BulkBuffersRelease_t)GetProcAddress(m_hDLL, "Do_R15_Bulk_SetBuffersRelease");
- A2Command.Send_Fn = (A2CommandSend_t)GetProcAddress(m_hDLL, "Do_A2_Command_Send");
+ A2Command.Send_Fn = (A2CommandSend_t)GetProcAddress(m_hDLL, "Do_A2_Command_Send");
A2Command.SpeedflashStart_Fn = (A2SpeedflashStart_t)GetProcAddress(m_hDLL, "Do_A2_Speedflash_Start");
A2Command.SpeedflashSetLastBlock_Fn = (A2SpeedflashSetLastBlock_t)GetProcAddress(m_hDLL, "Do_A2_Speedflash_SetLastBlock");
A2Command.SpeedflashWriteBlock_Fn = (A2SpeedflashWriteBlock_t)GetProcAddress(m_hDLL, "Do_A2_Speedflash_WriteBlock");
@@ -101,6 +103,7 @@ int LcmInterface::LoadLCMLibrary()
Communication.Send_Fn == 0 ||
Communication.SetProtocolTimeouts_Fn == 0 ||
Communication.GetProtocolTimeouts_Fn == 0 ||
+ Communication.GetVersion_Fn == 0 ||
R15Command.Send_Fn == 0 ||
R15Command.ResetSessionCounters_Fn == 0 ||
R15Bulk.OpenSession_Fn == 0 ||
@@ -110,10 +113,10 @@ int LcmInterface::LoadLCMLibrary()
R15Bulk.GetStatusSession_Fn == 0 ||
R15Bulk.CloseSession_Fn == 0 ||
R15Bulk.SetCallbacks_Fn == 0 ||
- A2Command.Send_Fn == 0 ||
- A2Command.SpeedflashStart_Fn == 0 ||
- A2Command.SpeedflashSetLastBlock_Fn == 0 ||
- A2Command.SpeedflashWriteBlock_Fn == 0
+ A2Command.Send_Fn == 0 ||
+ A2Command.SpeedflashStart_Fn == 0 ||
+ A2Command.SpeedflashSetLastBlock_Fn == 0 ||
+ A2Command.SpeedflashWriteBlock_Fn == 0
) {
return LCM_DLL_LOAD_FUNCTION_NOT_FOUND;
}
@@ -150,12 +153,16 @@ void LcmInterface::CloseLCMLibrary()
ErrorCode_e LcmInterface::CommunicationInitialize(void *Object_p, Family_t Family, HashDevice_t *HashDevice_p, CommunicationDevice_t *CommunicationDevice_p, Do_CEH_Call_t CommandCallback_p, BuffersInterface_t *Buffers_p, TimersInterface_t *Timers_p, QueueInterface_t *Queue_p)
{
int ReturnValue = E_SUCCESS;
+ char *LCMVersion_p = NULL;
+ LCM_t LCMType = PC_LCM;
if (m_hDLL == NULL) {
CLockCS lock(m_CriticalSection);
if (m_hDLL == NULL) {
VERIFY_SUCCESS(LoadLCMLibrary());
+ // LCMVersion_p = Communication.GetVersion_Fn(m_pCommunication);
+ // VERIFY_SUCCESS(CommunicationCheckVersion(LCMVersion_p, LCMType));
}
}
@@ -185,6 +192,28 @@ ErrorCode_e LcmInterface::CommunicationGetProtocolTimeouts(void *TimeoutData_p)
return Communication.GetProtocolTimeouts_Fn(m_pCommunication, TimeoutData_p);
}
+ErrorCode_e LcmInterface::CommunicationCheckVersion(char *LCMVersion_p, LCM_t LCMType)
+{
+
+ int ReturnValue = LCM_DLL_LOAD_INCOMPATIBLE_PC_VERSION;
+ int i = 0;
+
+ if (LCMType == LDR_LCM) {
+ ReturnValue = LCM_DLL_LOAD_INCOMPATIBLE_LDR_VERSION;
+ }
+
+ do {
+ if (strcmp(LCMVersion_p, LCD_VersionList[i]) == 0) {
+ ReturnValue = E_SUCCESS;
+ break;
+ }
+
+ i++;
+ } while (LCD_VersionList[i] != NULL);
+
+ return static_cast<ErrorCode_e>(ReturnValue);
+}
+
ErrorCode_e LcmInterface::CommunicationShutdown()
{
return Communication.Shutdown_Fn(&m_pCommunication);
@@ -214,6 +243,11 @@ void LcmInterface::BulkSetCallbacks(void *BulkCommandCallback_p, void *BulkDataC
R15Bulk.SetCallbacks_Fn(m_pCommunication, BulkCommandCallback_p, BulkDataCallback_p, BulkDataEndOfDump_p);
}
+void LcmInterface::BulkBuffersRelease(void *BulkBufferRelease_p)
+{
+ R15Bulk.SetBuffersRelease_Fn(m_pCommunication, BulkBufferRelease_p);
+}
+
uint32 LcmInterface::BulkOpenSession(const uint16 SessionId, const TL_SessionMode_t Mode, uint32 Length)
{
return R15Bulk.OpenSession_Fn(m_pCommunication, SessionId, Mode, Length);
diff --git a/source/LcmInterface.h b/source/LcmInterface.h
index 9525f02..021559e 100644
--- a/source/LcmInterface.h
+++ b/source/LcmInterface.h
@@ -24,6 +24,7 @@ typedef ErrorCode_e(*CommunicationSetFamily_t)(Communication_t *Communication_p,
typedef ErrorCode_e(*CommunicationSend_t)(Communication_t *Communication_p, void *InputData_p);
typedef ErrorCode_e(*CommunicationSetProtocolTimeouts_t)(Communication_t *Communication_p, void *TimeoutData_p);
typedef ErrorCode_e(*CommunicationGetProtocolTimeouts_t)(Communication_t *Communication_p, void *TimeoutData_p);
+typedef char*(*CommunicationGetVersion_t)(Communication_t *Communication_p);
typedef ErrorCode_e(*CommunicationCancelReceiver_t)(Communication_t *Communication_p, uint8 PacketsBeforeTransferStop);
typedef ErrorCode_e(*R15CommandSend_t)(Communication_t *Communication_p, CommandData_t *CmdData_p);
@@ -36,6 +37,7 @@ typedef TL_BulkSessionState_t (*R15BulkGetStatusSession_t)(const Communication_t
typedef uint32(*R15BulkDestroyVector_t)(const Communication_t *const Communication_p, TL_BulkVectorList_t *BulkVector_p, boolean ReqReleaseBuffer);
typedef uint32(*R15BulkOpenSession_t)(const Communication_t *const Communication_p, const uint16 SessionId, const TL_SessionMode_t Mode, uint32 Length);
typedef void (*R15BulkSetCallbacks_t)(Communication_t *Communication_p, void *BulkCommandCallback_p, void *BulkDataCallback_p, void *BulkDataEndOfDump_p);
+typedef void (*R15BulkBuffersRelease_t)(Communication_t *Communication_p, void *BulkBuffersRelease_p);
typedef ErrorCode_e(*A2CommandSend_t)(Communication_t *Communication_p, A2_CommandData_t *CmdData_p);
typedef void (*A2SpeedflashStart_t)(Communication_t *Communication_p);
@@ -50,6 +52,7 @@ typedef struct {
CommunicationSend_t Send_Fn;
CommunicationSetProtocolTimeouts_t SetProtocolTimeouts_Fn;
CommunicationGetProtocolTimeouts_t GetProtocolTimeouts_Fn;
+ CommunicationGetVersion_t GetVersion_Fn;
CommunicationCancelReceiver_t CancelReceiver_Fn;
} CommunicationInterface_t;
@@ -66,6 +69,7 @@ typedef struct {
R15BulkDestroyVector_t DestroyVector_Fn;
R15BulkOpenSession_t OpenSession_Fn;
R15BulkSetCallbacks_t SetCallbacks_Fn;
+ R15BulkBuffersRelease_t SetBuffersRelease_Fn;
} R15BulkInterface_t;
typedef struct {
@@ -75,6 +79,13 @@ typedef struct {
A2SpeedflashWriteBlock_t SpeedflashWriteBlock_Fn;
} A2CommandInterface_t;
+
+typedef enum {
+ UNKNOWN_LCM = 0,
+ LDR_LCM = 1,
+ PC_LCM = 2
+} LCM_t;
+
class LcmInterface
{
public:
@@ -87,6 +98,7 @@ public:
ErrorCode_e CommunicationSetFamily(Family_t family, Do_CEH_Call_t CEHCallback);
ErrorCode_e CommunicationSetProtocolTimeouts(void *TimeoutData_p);
ErrorCode_e CommunicationGetProtocolTimeouts(void *TimeoutData_p);
+ ErrorCode_e CommunicationCheckVersion(char *LCMVersion_p, LCM_t LCM_type);
ErrorCode_e CommunicationShutdown();
ErrorCode_e CommunicationCancelReceiver(uint8 PacketsBeforeReceiverStop);
@@ -94,6 +106,7 @@ public:
ErrorCode_e CommandResetSessionCounters();
void BulkSetCallbacks(void *BulkCommandCallback_p, void *BulkDataCallback_p, void *BulkDataEndOfDump_p);
+ void BulkBuffersRelease(void *BulkBufferRelease_p);
uint32 BulkOpenSession(const uint16 SessionId, const TL_SessionMode_t Mode, uint32 Length);
TL_BulkVectorList_t *BulkCreateVector(const uint32 BulkVector, uint32 Length, const uint32 BuffSize, TL_BulkVectorList_t *CreatedBulkVector_p);
ErrorCode_e BulkStartSession(TL_BulkVectorList_t *BulkVector_p, const uint64 Offset);
diff --git a/source/config/lcdriver_error_codes.xml b/source/config/lcdriver_error_codes.xml
index a68d939..a7f7f5c 100644
--- a/source/config/lcdriver_error_codes.xml
+++ b/source/config/lcdriver_error_codes.xml
@@ -83,6 +83,8 @@
-->
<value number="10401" name="LCM_DLL_LOAD_LOADLIBRARY_ERROR" fatal="true" short="Failed to load LCM library.">Loading of dependant library failed. Make sure that it is placed on correct location.</value>
<value number="10402" name="LCM_DLL_LOAD_FUNCTION_NOT_FOUND" fatal="true" short="Failed to import LCM functionality.">Some of dependend functions was not found in the given LCM library. Make sure that the version that is used is compatible.</value>
+ <value number="10426" name="LCM_DLL_LOAD_INCOMPATIBLE_PC_VERSION" fatal="false" short="Incompatible PC LCM version.">Some of functions may not work in the given LCM library. Make sure that the PC LCM version that is used is compatible.</value>
+ <value number="10427" name="LCM_DLL_LOAD_INCOMPATIBLE_LDR_VERSION" fatal="false" short="Incompatible LDR LCM version.">Some of functions may not work in the given LCM library. Make sure that the LDR LCM version that is used is compatible.</value>
<!--
* Exceptions Fatal 10451-10475
diff --git a/source/utilities/BulkHandler.cpp b/source/utilities/BulkHandler.cpp
index 9dc9169..eb09fe3 100644
--- a/source/utilities/BulkHandler.cpp
+++ b/source/utilities/BulkHandler.cpp
@@ -91,7 +91,7 @@ int BulkHandler::Receive(const string &destinationFile)
return 0;
}
-void BulkHandler::Finish()
+void BulkHandler::Finish(bool ForceFinish)
{
if (BULK_RX == m_State) {
m_State = BULK_INACTIVE;
@@ -99,6 +99,10 @@ void BulkHandler::Finish()
m_pFileWriteThread->WaitToDie(INFINITE);
} else {
m_State = BULK_INACTIVE;
+
+ if (ForceFinish) {
+ m_pBulkVector->State = CANCEL_BULK;
+ }
}
}
diff --git a/source/utilities/BulkHandler.h b/source/utilities/BulkHandler.h
index b441a67..94370a8 100644
--- a/source/utilities/BulkHandler.h
+++ b/source/utilities/BulkHandler.h
@@ -52,7 +52,7 @@ public:
int Receive(const std::string &sourceFile);
int Send(const std::string &destinationFile);
- void Finish();
+ void Finish(bool ForceFinish);
void HandleCommandRequest(uint16 session, uint32 chunkSize, uint64 offset, uint32 length, bool acknowledge);
private:
CLCDriverMethods *m_Methods;