summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxmarvla <vlatko.markovic@seavus.com>2011-09-28 10:30:52 +0100
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2011-10-28 18:54:06 +0200
commit0ddb310bb30fc3445b9aa2be8cfb615cdadfdb78 (patch)
tree8f28a3ea5936983d70e8a8f6ebfca0bfb0902fb7
parent90cfff26b762bd140701a2f25f0ad57e7396437c (diff)
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 <zoran.ancevski@seavus.com> Tested-by: Vlatko STENKOSKI Reviewed-by: QATEST Reviewed-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com> Tested-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com>
-rw-r--r--lcmodule/source/LCM.rc6
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/commands.xml24
-rw-r--r--source/CEH/commands_impl.cpp7
-rw-r--r--source/LCDriver.cpp7
-rw-r--r--source/LCDriver.h10
-rw-r--r--source/LCDriver.rc6
-rw-r--r--source/LCDriverMethods.cpp20
-rw-r--r--source/LCDriverMethods.h1
-rw-r--r--source/config/commands.xml24
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 @@
</output>
</command>
+ <command number="2" name="Change Uart Baud Rate" ADbg="false" source="PC" supportedcmdtype="longrunning">
+ <interface type="loader" name="ChangeBaudRate"/>
+ <documentation>
+ This command is used to change the loader UART baudrate.
+ </documentation>
+ <input>
+ <value type="uint32" name="BaudRate">Baud rate.</value>
+ </input>
+ <output>
+ </output>
+ <authentication depandancy="or" factory="TRUE" rd="TRUE" product="TRUE" service="TRUE">
+ <value ref="A1"/>
+ <value ref="CA"/>
+ </authentication>
+ <permissions>
+ <value ref="ServiceModeLevel"/>
+ <value ref="FlashModeLevel"/>
+ <value ref="AdvanceServiceModeLevel"/>
+ <value ref="ProductionModeLevel"/>
+ <value ref="LimitedProductionModeLevel"/>
+ <value ref="VeryLimitedProductionModeLevel"/>
+ </permissions>
+ </command>
+
<command number="3" name="System Reboot" ADbg="false" source="PC" supportedcmdtype="longrunning">
<interface type="loader" name="Reboot"/>
<documentation>
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
@@ -289,6 +289,16 @@ extern "C"
LCDRIVER_API int __cdecl System_LoaderStartupStatus(LCDContext Context, char *pchVersion, int *piVersionSize, char *pchProtocol, int *piProtocolSize);
/// <summary>
+ /// 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.
+ /// </summary>
+ /// <param name="Context">LCD context on which to execute the operation.</param>
+ /// <param name="iBaudRate">Indicates the new UART baud rate.</param>
+ /// <returns>Status of the command.</returns>
+ LCDRIVER_API int __cdecl System_ChangeBaudrate(LCDContext Context, int iBaudRate);
+
+ /// <summary>
/// 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
/// select the mode of reset. The ME does not accept any further communication after a successful
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
@@ -537,6 +537,26 @@ ErrorExit:
}
/// <summary>
+/// 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.
+/// </summary>
+/// <param name="Context">LCD context on which to execute the operation.</param>
+/// <param name="iBaudRate">Indicates the new UART baud rate.</param>
+/// <returns>Status of the command.</returns>
+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;
+}
+
+/// <summary>
/// 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
/// select the mode of reset. The ME does not accept any further communication after a successful
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 @@
</output>
</command>
+ <command number="2" name="Change Uart Baud Rate" ADbg="false" source="PC" supportedcmdtype="longrunning">
+ <interface type="loader" name="ChangeBaudRate"/>
+ <documentation>
+ This command is used to change the loader UART baudrate.
+ </documentation>
+ <input>
+ <value type="uint32" name="BaudRate">Baud rate.</value>
+ </input>
+ <output>
+ </output>
+ <authentication depandancy="or" factory="TRUE" rd="TRUE" product="TRUE" service="TRUE">
+ <value ref="A1"/>
+ <value ref="CA"/>
+ </authentication>
+ <permissions>
+ <value ref="ServiceModeLevel"/>
+ <value ref="FlashModeLevel"/>
+ <value ref="AdvanceServiceModeLevel"/>
+ <value ref="ProductionModeLevel"/>
+ <value ref="LimitedProductionModeLevel"/>
+ <value ref="VeryLimitedProductionModeLevel"/>
+ </permissions>
+ </command>
+
<command number="3" name="System Reboot" ADbg="false" source="PC">
<interface type="loader" name="Reboot"/>
<documentation>