From 0ddb310bb30fc3445b9aa2be8cfb615cdadfdb78 Mon Sep 17 00:00:00 2001 From: xmarvla Date: Wed, 28 Sep 2011 10:30:52 +0100 Subject: Add Change UART Baudrate command in LCDriver ST-Ericsson ID: 351285 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204 Change-Id: I23db5d677a9eef4771bc3a76089faf32fc60424f Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/29952 Reviewed-by: QATOOLS Reviewed-by: Zoran ANCEVSKI Tested-by: Vlatko STENKOSKI Reviewed-by: QATEST Reviewed-by: Vlatko PISTOLOV Tested-by: Vlatko PISTOLOV --- lcmodule/source/LCM.rc | 6 +++--- .../config/commands.xml | 24 ++++++++++++++++++++++ source/CEH/commands_impl.cpp | 7 +++++++ source/LCDriver.cpp | 7 +++++++ source/LCDriver.h | 10 +++++++++ source/LCDriver.rc | 6 +++--- source/LCDriverMethods.cpp | 20 ++++++++++++++++++ source/LCDriverMethods.h | 1 + source/config/commands.xml | 24 ++++++++++++++++++++++ 9 files changed, 99 insertions(+), 6 deletions(-) diff --git a/lcmodule/source/LCM.rc b/lcmodule/source/LCM.rc index 7060905..bbd16c4 100644 --- a/lcmodule/source/LCM.rc +++ b/lcmodule/source/LCM.rc @@ -69,15 +69,15 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "Build date: 2011-09-13" + VALUE "Comments", "Build date: 2011-09-28" VALUE "CompanyName", "STEricsson AB" VALUE "FileDescription", "LCDriver Dynamic Link Library" VALUE "FileVersion", "1, 0, 0, 1" VALUE "InternalName", "Loader Communication Driver" VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2011" - VALUE "PrivateBuild", "Change-Id: Ia28609e74901696c92ef23f95af44f730584804c" + VALUE "PrivateBuild", "Change-Id: I23db5d677a9eef4771bc3a76089faf32fc60424f" VALUE "ProductName", "CXA1104507 Loader Communication Module" - VALUE "ProductVersion", "PT3" + VALUE "ProductVersion", "P1T" END END BLOCK "VarFileInfo" diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/commands.xml b/lcmodule/source/cnh1606344_ldr_communication_module/config/commands.xml index 3441001..d5cd45e 100644 --- a/lcmodule/source/cnh1606344_ldr_communication_module/config/commands.xml +++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/commands.xml @@ -82,6 +82,30 @@ + + + + This command is used to change the loader UART baudrate. + + + Baud rate. + + + + + + + + + + + + + + + + + diff --git a/source/CEH/commands_impl.cpp b/source/CEH/commands_impl.cpp index a5839dc..8cceed9 100644 --- a/source/CEH/commands_impl.cpp +++ b/source/CEH/commands_impl.cpp @@ -24,6 +24,13 @@ ErrorCode_e LoaderRpcInterfaceImpl::DoRPC_System_LoaderStartUpStatusImpl(uint16 return E_SUCCESS; } +ErrorCode_e LoaderRpcInterfaceImpl::DoneRPC_System_ChangeBaudRateImpl(uint16 Session, ErrorCode_e Status) +{ + cmdResult_->GeneralResponse_Session = Session; + + return E_SUCCESS; +} + ErrorCode_e LoaderRpcInterfaceImpl::DoneRPC_System_RebootImpl(uint16 Session, ErrorCode_e Status) { cmdResult_->GeneralResponse_Session = Session; diff --git a/source/LCDriver.cpp b/source/LCDriver.cpp index 9be6fb3..6afb1c1 100644 --- a/source/LCDriver.cpp +++ b/source/LCDriver.cpp @@ -205,6 +205,13 @@ LCDRIVER_API int __cdecl System_LoaderStartupStatus(LCDContext Context, char *pc return Context->m_pObject->Done_System_LoaderStartupStatus(pchVersion, piVersionSize, pchProtocol, piProtocolSize); } +LCDRIVER_API int __cdecl System_ChangeBaudrate(LCDContext Context, int iBaudRate) +{ + VERIFY_CONTEXT_STARTED(Context); + + return Context->m_pObject->Do_System_ChangeBaudRate(iBaudRate); +} + LCDRIVER_API int __cdecl System_Reboot(LCDContext Context, int iMode) { VERIFY_CONTEXT_STARTED(Context); diff --git a/source/LCDriver.h b/source/LCDriver.h index 8e8f82a..d50007e 100644 --- a/source/LCDriver.h +++ b/source/LCDriver.h @@ -288,6 +288,16 @@ extern "C" /// Status of the command. LCDRIVER_API int __cdecl System_LoaderStartupStatus(LCDContext Context, char *pchVersion, int *piVersionSize, char *pchProtocol, int *piProtocolSize); + /// + /// The ChangeBaudrate command is used to instruct the loader to change the UART baud rate. + /// The ME does not return GeneralResponse to this command. It changes to new BaudRate + /// and expects the further communication over UART to be realized using the new BaudRate. + /// + /// LCD context on which to execute the operation. + /// Indicates the new UART baud rate. + /// Status of the command. + LCDRIVER_API int __cdecl System_ChangeBaudrate(LCDContext Context, int iBaudRate); + /// /// The Reboot command is used to instruct the loader to reset the ME. Upon receiving this command, /// the loader shuts down in a controlled fashion and restarts the ME. The Mode parameter is used to diff --git a/source/LCDriver.rc b/source/LCDriver.rc index 6969602..6a8185f 100644 --- a/source/LCDriver.rc +++ b/source/LCDriver.rc @@ -81,15 +81,15 @@ BEGIN BEGIN BLOCK "000904b0" BEGIN - VALUE "Comments", "Build date: 2011-09-13" + VALUE "Comments", "Build date: 2011-09-28" VALUE "CompanyName", "STEricsson AB" VALUE "FileDescription", "LCDriver Dynamic Link Library" VALUE "FileVersion", "1, 0, 0, 1" VALUE "InternalName", "Loader Communication Driver" VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2011" - VALUE "PrivateBuild", "Change-Id: Ia28609e74901696c92ef23f95af44f730584804c" + VALUE "PrivateBuild", "Change-Id: I23db5d677a9eef4771bc3a76089faf32fc60424f" VALUE "ProductName", "CXC 173 0865, LCDriver DLL" - VALUE "ProductVersion", "PT3" + VALUE "ProductVersion", "P1S" END END BLOCK "VarFileInfo" diff --git a/source/LCDriverMethods.cpp b/source/LCDriverMethods.cpp index d214631..8a23a40 100644 --- a/source/LCDriverMethods.cpp +++ b/source/LCDriverMethods.cpp @@ -536,6 +536,26 @@ ErrorExit: return ReturnValue; } +/// +/// The ChangeBaudrate command is used to instruct the loader to change the UART baud rate. +/// The ME does not return GeneralResponse to this command. It changes to new BaudRate +/// and expects the further communication over UART to be realized using the new BaudRate. +/// +/// LCD context on which to execute the operation. +/// Indicates the new UART baud rate. +/// Status of the command. +int CLCDriverMethods::Do_System_ChangeBaudRate(int iBaudRate) +{ + uint16 uiSessionOut = 0; + int ReturnValue = E_SUCCESS; + + VERIFY_SUCCESS(IsMainThreadAlive()); + VERIFY_SUCCESS(m_pLoaderRpcFunctions->DoRPC_System_ChangeBaudRate(uiSessionOut, iBaudRate)); + +ErrorExit: + return ReturnValue; +} + /// /// The Reboot command is used to instruct the loader to reset the ME. Upon receiving this command, /// the loader shuts down in a controlled fashion and restarts the ME. The Mode parameter is used to diff --git a/source/LCDriverMethods.h b/source/LCDriverMethods.h index 921a8fb..2bbf189 100644 --- a/source/LCDriverMethods.h +++ b/source/LCDriverMethods.h @@ -57,6 +57,7 @@ public: // Loader methods int Done_System_LoaderStartupStatus(char *pchVersion, int *piVersionSize, char *pchProtocol, int *piProtocolSize); + int Do_System_ChangeBaudRate(int iBaudRate); int Do_System_Reboot(int iMode); int Do_System_Shutdown(); int Do_System_SupportedCommands(TSupportedCmd *pCmdList, int *piCmdListSize); diff --git a/source/config/commands.xml b/source/config/commands.xml index 03a8835..6060fe8 100644 --- a/source/config/commands.xml +++ b/source/config/commands.xml @@ -80,6 +80,30 @@ + + + + This command is used to change the loader UART baudrate. + + + Baud rate. + + + + + + + + + + + + + + + + + -- cgit v1.2.3