summaryrefslogtreecommitdiff
path: root/lcmodule/source/cnh1606344_ldr_communication_module
diff options
context:
space:
mode:
Diffstat (limited to 'lcmodule/source/cnh1606344_ldr_communication_module')
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml672
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl6
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl16
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml65
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h6
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h11
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h25
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c16
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c42
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c2
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c18
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c24
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c8
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c2
14 files changed, 475 insertions, 438 deletions
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml b/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml
index b2ad470..171df8f 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml
@@ -9,14 +9,13 @@
<?xml-stylesheet type="text/xml" href="a2_commands_impl_h.xsl"?>
<?xml-stylesheet type="text/xml" href="a2_common.xsl"?>
-
<commandspec>
<AuthenticationList>
<value number="1" name="A1">A1</value>
<value number="2" name="CA">CA</value>
</AuthenticationList>
-
+
<PermissionList>
<value number="0" name="Permission1">Permission1</value>
<value number="2" name="Permission2">Permission2</value>
@@ -43,19 +42,19 @@
A2 System commands group (0x01)
</documentation>
<interface type="loader" name="A2_System"/>
-
+
<command number="101" name="TestCommand" source="PC">
<interface type="loader" name="TestCommand"/>
<documentation>
Performs controlled power down of the ME.
</documentation>
<input>
- <value type="uint32" name="EnglandLength"/>
- <value type="string" name="Sweden"/>
+ <value type="uint32" name="EnglandLength"/>
+ <value type="string" name="Sweden"/>
<value type="uint32" name="GermanyLength"/>
- <value type="uint32" name="France"/>
- <value type="buffer" name="Germany" length="GermanyLength"/>
- <value type="buffer" name="England" length="EnglandLength"/>
+ <value type="uint32" name="France"/>
+ <value type="buffer" name="Germany" length="GermanyLength"/>
+ <value type="buffer" name="England" length="EnglandLength"/>
</input>
<output>
<value type="uint32" name="AfricaLength"/>
@@ -72,12 +71,12 @@
The Loader shuts down in a controlled fashion and proceeds to shut down the ME itself.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ShutdownIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ShutdownIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="ShutdownOutLenght">Loader version length</value>
- <value type="buffer" name="ShutdownOut" length="ShutdownOutLenght">No data</value>
+ <value type="uint32" name="ShutdownOutLenght">Loader version length</value>
+ <value type="buffer" name="ShutdownOut" length="ShutdownOutLenght">No data</value>
</output>
</command>
@@ -87,42 +86,42 @@
The Loader Version command is sent by the PC to request version information from the loader. The ME responds with a Loader Version information coded as ASCII characters in the data field.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="LoaderVersionIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="LoaderVersionIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="LVLength">Loader version length</value>
+ <value type="uint32" name="LVLength">Loader version length</value>
<value type="buffer" name="LoaderVersionOut" length="LVLength">Loader version identifier</value>
</output>
</command>
-
+
<command number="3" name="Protocol Version" source="PC">
<interface type="loader" name="ProtocolVersion"/>
<documentation>
The Protocol Version command is sent by the PC to request the application protocol version information from the loader. The ME responds with two bytes holding the major and the minor version respectively.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ProtocolVersionIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ProtocolVersionIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="PVLength">Protocol version length</value>
+ <value type="uint32" name="PVLength">Protocol version length</value>
<value type="buffer" name="ProtocolVersionOut" length="PVLength">Protocol version identifier</value>
</output>
</command>
-
+
<command number="5" name="System Supported Command groups" source="PC">
<interface type="loader" name="SupportedCommandGroups"/>
<documentation>
The Loader returns a list of implemented command groups and whether they are permitted to execute in the current Loader state.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="CommandGroupsIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="CommandGroupsIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="CommandGroupsOutLength">Supported Groups length</value>
- <value type="buffer" name="CommandGroupsOut" length="CommandGroupsOutLength">Each byte of the string represents a supported command group.</value>
+ <value type="uint32" name="CommandGroupsOutLength">Supported Groups length</value>
+ <value type="buffer" name="CommandGroupsOut" length="CommandGroupsOutLength">Each byte of the string represents a supported command group.</value>
</output>
</command>
@@ -132,44 +131,44 @@
This command is sent by the PC to request a Platform Property, by sending a PropertyID in the data field. The ME responds with the Property value.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="GetPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
- <value type="buffer" name="GetPropertyOut" length="GetPropertyOutLength"/>
- </output>
+ <value type="uint32" name="GetPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
+ <value type="buffer" name="GetPropertyOut" length="GetPropertyOutLength"/>
+ </output>
</command>
<command number="8" name="Get Memory Property" source="PC">
<interface type="loader" name="GetMemoryProperty"/>
<documentation>
- This command is sent by the PC to request a Memory Property. The ME responds with the Memory Property value.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetMemPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="GetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
- <value type="buffer" name="GetMemPropertyOut" length="GetMemPropertyOutLength"/>
- </output>
- </command>
-
- <command number="9" name="Set Memory Property" source="PC">
- <interface type="loader" name="SetMemoryProperty"/>
- <documentation>
- This command is sent by the PC to set a Memory Property.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SetMemPropertyIn" length="CmdData_p-&gt;Payload.Size">The MemoryPropertyPayload buffer holds the Memory Propertiy ID and the Memory Property value. The size of the MemoryPropertyValue depends on the PropertyID</value>
- </input>
- <output>
- <value type="uint32" name="SetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
- <value type="buffer" name="SetMemPropertyOut" length="SetMemPropertyOutLength"/>
- </output>
- </command>
+ This command is sent by the PC to request a Memory Property. The ME responds with the Memory Property value.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetMemPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="GetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
+ <value type="buffer" name="GetMemPropertyOut" length="GetMemPropertyOutLength"/>
+ </output>
+ </command>
+
+ <command number="9" name="Set Memory Property" source="PC">
+ <interface type="loader" name="SetMemoryProperty"/>
+ <documentation>
+ This command is sent by the PC to set a Memory Property.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SetMemPropertyIn" length="CmdData_p-&gt;Payload.Size">The MemoryPropertyPayload buffer holds the Memory Propertiy ID and the Memory Property value. The size of the MemoryPropertyValue depends on the PropertyID</value>
+ </input>
+ <output>
+ <value type="uint32" name="SetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
+ <value type="buffer" name="SetMemPropertyOut" length="SetMemPropertyOutLength"/>
+ </output>
+ </command>
<command number="15" name="Read Security Data" source="PC">
<interface type="loader" name="ReadSecurityData"/>
@@ -177,93 +176,92 @@
This command is used in a Flashless bridge configuration. It returns the Static data and all dinamic variables cretaed during the signing process.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SecurityDataIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SecurityDataIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="SecurityDataOutLength"/>
- <value type="buffer" name="SecurityDataOut" length="SecurityDataOutLength"/>
- </output>
- </command>
-
- <command number="17" name="Loader on Loader" source="PC">
- <interface type="loader" name="LoaderOnLoader"/>
- <documentation>
- This command is used to transfer a new Loader to the ME. The data should hold either Header or Payload.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="LOLIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="LOLOutLength"/>
- <value type="buffer" name="LOLOut" length="LOLOutLength"/>
- </output>
- </command>
-
- <command number="19" name="Reset" source="PC">
- <interface type="loader" name="Reset"/>
- <documentation>
- The Reset 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.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ResetIn" length="CmdData_p-&gt;Payload.Size">The ResetTimeout value is in ms.</value>
- </input>
- <output>
- <value type="uint32" name="ResetOutLength"/>
- <value type="buffer" name="ResetOut" length="ResetOutLength"/>
- </output>
- </command>
+ <value type="uint32" name="SecurityDataOutLength"/>
+ <value type="buffer" name="SecurityDataOut" length="SecurityDataOutLength"/>
+ </output>
+ </command>
+
+ <command number="17" name="Loader on Loader" source="PC">
+ <interface type="loader" name="LoaderOnLoader"/>
+ <documentation>
+ This command is used to transfer a new Loader to the ME. The data should hold either Header or Payload.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="LOLIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="LOLOutLength"/>
+ <value type="buffer" name="LOLOut" length="LOLOutLength"/>
+ </output>
+ </command>
+
+ <command number="19" name="Reset" source="PC">
+ <interface type="loader" name="Reset"/>
+ <documentation>
+ The Reset 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.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ResetIn" length="CmdData_p-&gt;Payload.Size">The ResetTimeout value is in ms.</value>
+ </input>
+ <output>
+ <value type="uint32" name="ResetOutLength"/>
+ <value type="buffer" name="ResetOut" length="ResetOutLength"/>
+ </output>
+ </command>
<command number="20" name="Simlock Authentication Request" source="PC">
<interface type="loader" name="SimlockAuthenticationRequest"/>
<documentation>
- This command is sent by the PC to set the SIM Lock Keys.
- </documentation>
+ This command is sent by the PC to set the SIM Lock Keys.
+ </documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SIMLockAuthReqIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
- </input>
- <output>
- <value type="uint32" name="SIMLockAuthReqOutLength"/>
- <value type="buffer" name="SIMLockAuthReqOut" length="SIMLockAuthReqOutLength"/>
- </output>
- </command>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SIMLockAuthReqIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
+ </input>
+ <output>
+ <value type="uint32" name="SIMLockAuthReqOutLength"/>
+ <value type="buffer" name="SIMLockAuthReqOut" length="SIMLockAuthReqOutLength"/>
+ </output>
+ </command>
+ </group>
-</group>
+ <group number="2" name="A2 Flash group">
+ <documentation>
+ A2 Flash Commands group (0x02)
+ </documentation>
+ <interface type="loader" name="A2_Flash"/>
-<group number="2" name="A2 Flash group">
- <documentation>
- A2 Flash Commands group (0x02)
- </documentation>
- <interface type="loader" name="A2_Flash"/>
-
<command number="1" name="Verify Signed Header" flag="true1" source="PC">
<documentation>
</documentation>
<interface type="loader" name="VerifySignedHeader"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="VerifyHeaderIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="VerifyHeaderOutLength"/>
- <value type="buffer" name="VerifyHeaderOut" length="VerifyHeaderOutLength"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="VerifyHeaderIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="VerifyHeaderOutLength"/>
+ <value type="buffer" name="VerifyHeaderOut" length="VerifyHeaderOutLength"/>
</output>
</command>
<command number="2" name="Software Block Address" flag="true1" source="PC">
- <documentation>
+ <documentation>
</documentation>
<interface type="loader" name="SoftwareBlockAddress"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SoftBlockAddIn" length="CmdData_p-&gt;Payload.Size">There are two parameters in the input buffer: Start address and Block size, both 4 bytes long.</value>
- </input>
- <output>
- <value type="uint32" name="SoftBlockAddOutLength"/>
- <value type="buffer" name="SoftBlockAddOut" length="SoftBlockAddOutLength"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SoftBlockAddIn" length="CmdData_p-&gt;Payload.Size">There are two parameters in the input buffer: Start address and Block size, both 4 bytes long.</value>
+ </input>
+ <output>
+ <value type="uint32" name="SoftBlockAddOutLength"/>
+ <value type="buffer" name="SoftBlockAddOut" length="SoftBlockAddOutLength"/>
</output>
</command>
@@ -272,44 +270,43 @@
</documentation>
<interface type="loader" name="ProgramFlash"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ProgramFlashIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="ProgramFlashOutLength"/>
- <value type="buffer" name="ProgramFlashOut" length="ProgramFlashOutLength"/>
- </output>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ProgramFlashIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="ProgramFlashOutLength"/>
+ <value type="buffer" name="ProgramFlashOut" length="ProgramFlashOutLength"/>
+ </output>
</command>
<command number="4" name="Verify Software Flash" flag="true1" source="PC">
<documentation>
</documentation>
<interface type="loader" name="VerifySoftwareFlash"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="VerifySoftwareFlashIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="VerifySoftwareFlashOutLength"/>
- <value type="buffer" name="VerifySoftwareFlashOut" length="VerifySoftwareFlashOutLength"/>
- </output>
- </command>
-
- <command number="5" name="Dump Flash Image" flag="true1" source="PC">
- <documentation>
- This command is used to readp from the flash. The input parameters buffer holds: Logical Unit number = 4 bits, Start address = 28 bits and End address = 4 bytes.
- </documentation>
- <interface type="loader" name="DumpFlashImage"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="DumpFlashImageIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="DumpFlashImageOutLength"/>
- <value type="buffer" name="DumpFlashImageOut" length="DumpFlashImageOutLength"/>
- </output>
- </command>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="VerifySoftwareFlashIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="VerifySoftwareFlashOutLength"/>
+ <value type="buffer" name="VerifySoftwareFlashOut" length="VerifySoftwareFlashOutLength"/>
+ </output>
+ </command>
+ <command number="5" name="Dump Flash Image" flag="true1" source="PC">
+ <documentation>
+ This command is used to readp from the flash. The input parameters buffer holds: Logical Unit number = 4 bits, Start address = 28 bits and End address = 4 bytes.
+ </documentation>
+ <interface type="loader" name="DumpFlashImage"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="DumpFlashImageIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="DumpFlashImageOutLength"/>
+ <value type="buffer" name="DumpFlashImageOut" length="DumpFlashImageOutLength"/>
+ </output>
+ </command>
</group>
<group number="3" name="A2 GDFS group">
@@ -323,21 +320,20 @@
</documentation>
<interface type="loader" name="GetGDFSProperty"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetGDFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetGDFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="GetGDFSPropertyOutLength"/>
- <value type="buffer" name="GetGDFSPropertyOut" length="GetGDFSPropertyOutLength"/>
+ <value type="uint32" name="GetGDFSPropertyOutLength"/>
+ <value type="buffer" name="GetGDFSPropertyOut" length="GetGDFSPropertyOutLength"/>
</output>
</command>
-
</group>
<group number="4" name="File system group">
<documentation>
- A2 File system commands Group (0x04)
- </documentation>
+ A2 File system commands Group (0x04)
+ </documentation>
<interface type="loader" name="A2_File_System"/>
<command number="1" name="Get File System Property" flag="true1" source="PC">
@@ -345,63 +341,62 @@
</documentation>
<interface type="loader" name="GetFileSystemProperty"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="GetFSPropertyOutLength"/>
- <value type="buffer" name="GetFSPropertyOut" length="GetFSPropertyOutLength"/>
- </output>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="GetFSPropertyOutLength"/>
+ <value type="buffer" name="GetFSPropertyOut" length="GetFSPropertyOutLength"/>
+ </output>
</command>
-
</group>
<group number="5" name="Signature group">
<documentation>
- A2 Signature Commands Group (0x05)
- </documentation>
+ A2 Signature Commands Group (0x05)
+ </documentation>
<interface type="loader" name="A2_Signature"/>
<command number="1" name="Set Control Keys" flag="true1" source="PC">
<documentation>
- This command is used to write the SIM Lock control keys.
+ This command is used to write the SIM Lock control keys.
</documentation>
<interface type="loader" name="SetControlKeys"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SetControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
- </input>
- <output>
- <value type="uint32" name="SetControlKeysOutLength"/>
- <value type="buffer" name="SetControlKeysOut" length="SetControlKeysOutLength"/>
- </output>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SetControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
+ </input>
+ <output>
+ <value type="uint32" name="SetControlKeysOutLength"/>
+ <value type="buffer" name="SetControlKeysOut" length="SetControlKeysOutLength"/>
+ </output>
</command>
<command number="2" name="Set Platform Property" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="SetPlatformProperty"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SetPlatformPropertyIn" length="CmdData_p-&gt;Payload.Size">The SetPlatformPropertyIn buffer holds the Platform Property ID and the Platform property value. The size of the Platform Property ID is 4 bytes and the size of the Platform Property Value depends on the PropertyID</value>
- </input>
- <output>
- <value type="uint32" name="SetPlatformPropertyOutLength"/>
- <value type="buffer" name="SetPlatformPropertyOut" length="SetPlatformPropertyOutLength"/>
- </output>
- </command>
-
- <command number="3" name="Write and Lock OTP" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="SetPlatformProperty"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SetPlatformPropertyIn" length="CmdData_p-&gt;Payload.Size">The SetPlatformPropertyIn buffer holds the Platform Property ID and the Platform property value. The size of the Platform Property ID is 4 bytes and the size of the Platform Property Value depends on the PropertyID</value>
+ </input>
+ <output>
+ <value type="uint32" name="SetPlatformPropertyOutLength"/>
+ <value type="buffer" name="SetPlatformPropertyOut" length="SetPlatformPropertyOutLength"/>
+ </output>
+ </command>
+
+ <command number="3" name="Write and Lock OTP" flag="true1" source="PC">
<documentation>
</documentation>
<interface type="loader" name="WriteAndLockOTP"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteAndLockOTPIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteAndLockOTPIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="WriteAndLockOTPOutLength"/>
- <value type="buffer" name="WriteAndLockOTPOut" length="WriteAndLockOTPOutLength"/>
+ <value type="uint32" name="WriteAndLockOTPOutLength"/>
+ <value type="buffer" name="WriteAndLockOTPOut" length="WriteAndLockOTPOutLength"/>
</output>
</command>
@@ -410,156 +405,155 @@
</documentation>
<interface type="loader" name="WriteDefaultData"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteDefaultDataIn" length="CmdData_p-&gt;Payload.Size">The WriteDefaultDataIn buffer holds the Unit number,the Unit size and Unit data</value>
- </input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteDefaultDataIn" length="CmdData_p-&gt;Payload.Size">The WriteDefaultDataIn buffer holds the Unit number,the Unit size and Unit data</value>
+ </input>
<output>
- <value type="uint32" name="WriteDefaultDataOutLength"/>
- <value type="buffer" name="WriteDefaultDataOut" length="WriteDefaultDataOutLength"/>
+ <value type="uint32" name="WriteDefaultDataOutLength"/>
+ <value type="buffer" name="WriteDefaultDataOut" length="WriteDefaultDataOutLength"/>
</output>
</command>
<command number="5" name="Write Full Signature" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="WriteFullSignature"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteFullSignIn" length="CmdData_p-&gt;Payload.Size"/>
+ <documentation>
+ </documentation>
+ <interface type="loader" name="WriteFullSignature"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteFullSignIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="WriteFullSignOutLength"/>
- <value type="buffer" name="WriteFullSignOut" length="WriteFullSignOutLength"/>
+ <value type="uint32" name="WriteFullSignOutLength"/>
+ <value type="buffer" name="WriteFullSignOut" length="WriteFullSignOutLength"/>
</output>
</command>
- <command number="6" name="Write CID" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="WriteCID"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteCIDIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="WriteCIDOutLength"/>
- <value type="buffer" name="WriteCIDOut" length="WriteCIDOutLength"/>
- </output>
+ <command number="6" name="Write CID" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="WriteCID"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteCIDIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="WriteCIDOutLength"/>
+ <value type="buffer" name="WriteCIDOut" length="WriteCIDOutLength"/>
+ </output>
</command>
<command number="7" name="Write Test Signature" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="WriteTestSignature"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteTestSignIn" length="CmdData_p-&gt;Payload.Size"/>
+ <documentation>
+ </documentation>
+ <interface type="loader" name="WriteTestSignature"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteTestSignIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="WriteTestSignOutLength"/>
- <value type="buffer" name="WriteTestSignOut" length="WriteTestSignOutLength"/>
+ <value type="uint32" name="WriteTestSignOutLength"/>
+ <value type="buffer" name="WriteTestSignOut" length="WriteTestSignOutLength"/>
</output>
</command>
- <command number="8" name="Erase Security Data" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="EraseSecurityData"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="EraseSecDataIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="EraseSecDataOutLength"/>
- <value type="buffer" name="EraseSecDataOut" length="EraseSecDataOutLength"/>
- </output>
- </command>
-
- <command number="9" name="Key Sharing Stage 1 Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="KeySharingStage1Request"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="KeySharStage1ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage1ReqIn buffer holds the Version (1 byte), the ID (4 bytes) and Random Value (24 bytes)</value>
- </input>
- <output>
- <value type="uint32" name="KeySharStage1ReqOutLength"/>
- <value type="buffer" name="KeySharStage1ReqOut" length="KeySharStage1ReqOutLength"/>
- </output>
- </command>
-
- <command number="10" name="Key Sharing Stage 2 Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="KeySharingStage2Request"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="KeySharStage2ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage2ReqIn buffer holds the ID (4 bytes), the Cipher (1 byte), the CertificateLength (4 bytes) and Certificate (CertificateLength)</value>
- </input>
- <output>
- <value type="uint32" name="KeySharStage2ReqOutLength"/>
- <value type="buffer" name="KeySharStage2ReqOut" length="KeySharStage2ReqOutLength"/>
- </output>
- </command>
-
- <command number="11" name="Key Sharing Stage 3 Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="KeySharingStage3Request"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="KeySharStage3ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage3ReqIn buffer holds the ID (4 bytes), C2 (16 bytes) and MAC (20 bytes).</value>
- </input>
- <output>
- <value type="uint32" name="KeySharStage3ReqOutLength"/>
- <value type="buffer" name="KeySharStage3ReqOut" length="KeySharStage3ReqOutLength"/>
- </output>
- </command>
-
- <command number="12" name="DRM Secure Storage Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="DRMSecureStorageRequest"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="DRMSecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="DRMSecStorReqOutLength"/>
- <value type="buffer" name="DRMSecStorReqOut" length="DRMSecStorReqOutLength"/>
- </output>
- </command>
-
- <command number="14" name="Verify Control Keys" flag="true1" source="PC">
- <documentation>
- This command is used to compare received SIM Lock keys against the SIM Lock keys stored in the ME.
- </documentation>
- <interface type="loader" name="VerifyControlKeys"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="VerifyControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
- </input>
- <output>
- <value type="uint32" name="VerifyControlKeysOutLength"/>
- <value type="buffer" name="VerifyControlKeysOut" length="VerifyControlKeysOutLength"/>
- </output>
+ <command number="8" name="Erase Security Data" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="EraseSecurityData"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="EraseSecDataIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="EraseSecDataOutLength"/>
+ <value type="buffer" name="EraseSecDataOut" length="EraseSecDataOutLength"/>
+ </output>
+ </command>
+
+ <command number="9" name="Key Sharing Stage 1 Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="KeySharingStage1Request"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="KeySharStage1ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage1ReqIn buffer holds the Version (1 byte), the ID (4 bytes) and Random Value (24 bytes)</value>
+ </input>
+ <output>
+ <value type="uint32" name="KeySharStage1ReqOutLength"/>
+ <value type="buffer" name="KeySharStage1ReqOut" length="KeySharStage1ReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="10" name="Key Sharing Stage 2 Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="KeySharingStage2Request"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="KeySharStage2ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage2ReqIn buffer holds the ID (4 bytes), the Cipher (1 byte), the CertificateLength (4 bytes) and Certificate (CertificateLength)</value>
+ </input>
+ <output>
+ <value type="uint32" name="KeySharStage2ReqOutLength"/>
+ <value type="buffer" name="KeySharStage2ReqOut" length="KeySharStage2ReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="11" name="Key Sharing Stage 3 Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="KeySharingStage3Request"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="KeySharStage3ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage3ReqIn buffer holds the ID (4 bytes), C2 (16 bytes) and MAC (20 bytes).</value>
+ </input>
+ <output>
+ <value type="uint32" name="KeySharStage3ReqOutLength"/>
+ <value type="buffer" name="KeySharStage3ReqOut" length="KeySharStage3ReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="12" name="DRM Secure Storage Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="DRMSecureStorageRequest"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="DRMSecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="DRMSecStorReqOutLength"/>
+ <value type="buffer" name="DRMSecStorReqOut" length="DRMSecStorReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="14" name="Verify Control Keys" flag="true1" source="PC">
+ <documentation>
+ This command is used to compare received SIM Lock keys against the SIM Lock keys stored in the ME.
+ </documentation>
+ <interface type="loader" name="VerifyControlKeys"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="VerifyControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
+ </input>
+ <output>
+ <value type="uint32" name="VerifyControlKeysOutLength"/>
+ <value type="buffer" name="VerifyControlKeysOut" length="VerifyControlKeysOutLength"/>
+ </output>
</command>
<command number="16" name="Secure Storage Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="SecureStorageRequest"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="SecStorReqOutLength"/>
- <value type="buffer" name="SecStorReqOut" length="SecStorReqOutLength"/>
- </output>
- </command>
-
+ <documentation>
+ </documentation>
+ <interface type="loader" name="SecureStorageRequest"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="SecStorReqOutLength"/>
+ <value type="buffer" name="SecStorReqOut" length="SecStorReqOutLength"/>
+ </output>
+ </command>
</group>
<group number="7" name="Reset group">
@@ -575,11 +569,11 @@
</documentation>
<input>
<value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="InitRequestIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
+ <value type="buffer" name="InitRequestIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
<output>
- <value type="uint32" name="InitRequestOutLength"/>
- <value type="buffer" name="InitRequestOut" length="InitRequestOutLength"/>
+ <value type="uint32" name="InitRequestOutLength"/>
+ <value type="buffer" name="InitRequestOut" length="InitRequestOutLength"/>
</output>
</command>
@@ -589,16 +583,15 @@
</documentation>
<input>
<value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="UpdateRequestIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
+ <value type="buffer" name="UpdateRequestIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
<output>
- <value type="uint32" name="UpdateRequestOutLength"/>
- <value type="buffer" name="UpdateRequestOut" length="UpdateRequestOutLength"/>
+ <value type="uint32" name="UpdateRequestOutLength"/>
+ <value type="buffer" name="UpdateRequestOut" length="UpdateRequestOutLength"/>
</output>
</command>
-
</group>
-
+
<group number="16" name="Control massage">
<documentation>
A2 Control massage (0x10)
@@ -611,11 +604,11 @@
<documentation>
</documentation>
<input>
- <value type="uint32" name="LoaderStartedInLength"/>
- <value type="buffer" name="LoaderStartedIn" length="LoaderStartedInLength"/>
+ <value type="uint32" name="LoaderStartedInLength"/>
+ <value type="buffer" name="LoaderStartedIn" length="LoaderStartedInLength"/>
</input>
<output>
- <value type="buffer" name="LoaderStartedOut" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="buffer" name="LoaderStartedOut" length="CmdData_p-&gt;Payload.Size"/>
</output>
</command>
@@ -631,7 +624,6 @@
<value type="buffer" name="LoaderNotStartedOut" length="CmdData_p-&gt;Payload.Size"/>
</output>
</command>
-
</group>
-
+
</commandspec>
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl b/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl
index fbc00fc..db730d7 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl
@@ -205,9 +205,9 @@ CommandPermissionList_t * GetAuditData(CommandData_t * CmdData_p)
boolean A1_RD = FALSE;
boolean A1_Product = FALSE;
boolean A1_Service = FALSE;
-
+
uint8 A1_depandancy = 0x00;
-
+
uint32 AuthenticationVector = 0; */
int CounterList = 0;
@@ -228,7 +228,7 @@ ErrorCode_e CommandAudit(CommandData_t * CmdData_p)
{
ErrorCode_e ReturnValue = E_GENERAL_FATAL_ERROR;
CommandPermissionList_t* CmdPermission_p = NULL;
-
+
CmdPermission_p = GetAuditData(CmdData_p);
if(NULL == CmdPermission_p)
{
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl b/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl
index e351827..5e7842a 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl
@@ -167,14 +167,14 @@ void disable_interrupt(void)
#ifndef WIN32
/* todo implement this */
//#warning This is disable_interrupt
-#endif
+#endif
}
void enable_interrupt(void)
{
#ifndef WIN32
/* todo implement this */
//#warning This is enable_interrupt
-#endif
+#endif
}
ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
@@ -194,13 +194,13 @@ ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
// ResponseStatus = (ErrorCode_e)get_uint16(&amp;Data_p);
}
-#ifdef CFG_ENABLE_AUDIT_CMD
+#ifdef CFG_ENABLE_AUDIT_CMD
if(COMMAND_TYPE == CmdData_p-&gt;Type)
{
ErrorCode_e AuditResponse = CommandAudit(CmdData_p);
CommandData_t CmdData = {0};
uint32 PLSize = sizeof(ErrorCode_e);
-
+
if (E_SUCCESS != AuditResponse)
{
memset((uint8*)&amp;CmdData, 0x00, sizeof(CommandData_t));
@@ -217,10 +217,10 @@ ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
A_(printf("command_marshal.c (%d): ** memory allocation failed! **\n",__LINE__);)
return E_ALLOCATE_FAILED;
}
-
+
Data_p = CmdData.Payload.Data_p;
put_uint32(&amp;Data_p, AuditResponse);
-
+
Status = Do_R15_Command_Send(GlobalCommunication_p, &amp;CmdData);
if (NULL != CmdData.Payload.Data_p)
{
@@ -240,12 +240,12 @@ ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
}
}
#endif
-
+
switch(COMMAND(response, CmdData_p-&gt;ApplicationNr, CmdData_p-&gt;CommandNr))
{
<apply-templates select="group" mode="unmarshal"/>
default:
- {
+ {
Status = Do_CustomCEH_Call(CmdData_p);
if (E_SUCCESS != Status)
{
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 138c902..7435367 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml
@@ -12,11 +12,11 @@
<value number="0" name="E_SUCCESS" fatal="false" short="Operation successful."> Operation finished successfully.</value>
<value number="1" name="E_GENERAL_FATAL_ERROR" fatal="true" short="General Failure."> Unknown error.</value>
<value number="2" name="E_ALLOCATE_FAILED" fatal="true" short="Failed to allocate memory."> Try to reset the loader and if problem still exist, report it.</value>
-
+
<value number="51" name="E_INVALID_INPUT_PARAMETERS" fatal="false" short="The expected value into the function was incorrect."> Check the input parameters in the command that you try to execute. Repeat operation. Report if problem is not solved.</value>
<value number="52" name="E_INVALID_CURRDATE_STRING_LENGTH" fatal="false" short="Indicate that the currdate string array variable has invalid length."> Try to reset the loader and if problem still exist, report this error.</value>
<value number="53" name="E_UNALIGNED_DATA" fatal="false" short="Indicate that a variable is not aligned."> Try to reset the loader and if still exist the problem, report this error.</value>
-
+
<!--
* IO Fatal 100-150
* IO non-fatal 151-199
@@ -190,7 +190,7 @@
<value number="989" name="E_FAILED_TO_FIND_ELF_SECTION" fatal="false" short="Can not find elf section."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="990" name="E_MAX_NUMBER_OF_MOUNTED_VOLUMES_EXCEEDED" fatal="false" short="Unable to mount volume due to exceeding the maximum number of allowed volumes.">First check the defined number of volumes in the flasharchive. If it is lower than maximum allowed volumes repeat the operation or reset loader. Report if problem still exist </value>
<value number="991" name="E_NO_MOUNTED_DEVICES_ARE_FOUND" fatal="false" short="Information message that no mounted devices are found."> This message can be issued in case when is detected that loader is trying to unmount zero mounted devices.</value>
-
+
<!--
* Command Auditing and execution Fatal 1000-1050
* Command Auditing and execution non-fatal 1051-1099
@@ -203,7 +203,7 @@
<value number="1052" name="E_OVERLOAD_COMMAND_TABLE" fatal="false" short="Too many commands are registered."> It is not allowed more than 5 commands to be registered.</value>
<value number="1053" name="E_COMMAND_ALREADY_REGISTERED" fatal="false" short="Command has already registered in execution queue.">It is not allowed the command to be registerd more than once in execution queue</value>
<value number="1054" name="E_AUDITING_FAILED" fatal="false" short=" Command auditing failed."> You should be authenticate with appropriate permission level in order to execute this command.</value>
-
+
<!--
* Timers Fatal 1200-1250
* Timers non-fatal 1251-1299
@@ -263,9 +263,9 @@
<value number="1393" name="E_CSPSA_RESULT_E_ALREADY_EXISTS" fatal="false" short="Parameter storage area with same name was already registered."> Loader internal problem. Report this issue.</value>
<value number="1394" name="E_CSPSA_RESULT_E_OUT_OF_MEMORY" fatal="false" short="There was not enough memory to perform the operation."> Loader internal problem. Report this issue.</value>
<value number="1395" name="E_CSPSA_RESULT_E_BAD_PARAMETER" fatal="false" short="Error because of bad input parameter.">Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
-
+
<value number="1399" name="E_GD_NO_DATA_TO_READ" fatal="false" short="GD: No data to read."> Write something to GD before attempting to read from it. Report this problem if you are shore that GD is not empty.</value>
-
+
<!--
* Block device Fatal 1400-1450
* Block device non-fatal 1451-1499
@@ -297,7 +297,7 @@
<value number="1475" name="E_BDM_PRE_FLASH_FINISHED" fatal="false" short="BDM: No more preflash blocks can be fetched."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1476" name="E_BDM_PRE_FLASH_TERMINATE_FAILED" fatal="false" short="BDM: Termination of preflash failed."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1477" name="E_BDM_OUT_OF_MEM" fatal="false" short="BDM: Could not allocate enough memory."> Internal error. Reset loader. Report if problem still exist.</value>
-
+
<value number="1481" name="E_BDM_XSR_CRITICAL_ERROR" fatal="false" short="BDM XSR: Critical error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1482" name="E_BDM_XSR_INVALID_PARAMS" fatal="false" short="BDM XSR: Invalid parameters."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
<value number="1483" name="E_BDM_XSR_PARTITION_NOT_OPENED" fatal="false" short="BDM XSR: Could not open partition."> Internal error. Reset loader. Report if problem still exist.</value>
@@ -310,7 +310,7 @@
<value number="1490" name="E_BDM_XSR_DEVICE_ERROR" fatal="false" short="BDM XSR: Device error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1491" name="E_BDM_XSR_GOODBLOCK" fatal="false" short="BDM XSR: Good block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
<value number="1492" name="E_BDM_XSR_BADBLOCK" fatal="false" short="BDM XSR: Bad block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
-
+
<!--
* Boot area Fatal 1500-1550
* Boot area non-fatal 1551-1619
@@ -368,7 +368,7 @@
<value number="1607" name="E_BAM_ONLD_DEVICE_ERROR" fatal="false" short="BAM ONLD: Device error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1608" name="E_BAM_ONLD_GOODBLOCK" fatal="false" short="BAM ONLD: Good block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
<value number="1609" name="E_BAM_ONLD_BADBLOCK" fatal="false" short="BAM ONLD: Bad block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
-
+
<!--
* Cops data Fatal 1620-1650
* Cops data non-fatal 1651-1699
@@ -399,7 +399,7 @@
<value number="1674" name="E_COPS_ARGUMENT_ERROR" fatal="false" short="COPS: Argument error!"> Verify the input parameters. Repeat operation. Report if problem still exist.</value>
<value number="1698" name="E_COPS_VERIFY_FAILED" fatal="false" short="COPS: Failed to verify internal data.">Reset loader. Report if problem still exist.</value>
<value number="1699" name="E_COPS_UNDEFINED_ERROR" fatal="false" short="COPS: Undefined error."> Internal error. Reset loader. Report if problem still exist.</value>
-
+
<!--
* PD NAND Fatal 1700-1750
* PD NAND non-fatal 1751-1799
@@ -413,11 +413,10 @@
<value number="1757" name="E_PD_NAND_RESULT_READING_ERASED_PAGE" fatal="false" short="PD NAND: Attempting to read erased page."> Repeat operation. Report if problem still exist.</value>
<value number="1758" name="E_PD_NAND_RESULT_NUMBER_OF_ITEMS" fatal="false" short="PD NAND: Number of valid states of this type."> Repeat operation. Report if problem still exist.</value>
<value number="1759" name="E_PD_NAND_RESULT_UNDEFINED" fatal="false" short="PD NAND: Represents an undefined value of this type."> Repeat operation. Report if problem still exist.</value>
-
+
<!--
* Trim Area non-fatal 1851-1899
-->
-
<value number="1851" name="E_GD_TA_BASE" fatal="false" short="GD/TA: TA base."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1852" name="E_GD_TA_UNKNOWN_PARTITION" fatal="false" short="GD/TA: Unknown partition."> Check input parameters. Repeat operation with the correct input parameters. Report if problem still exist.</value>
<value number="1853" name="E_GD_TA_UNKNOWN_CONFIG" fatal="false" short="GD/TA: Unknown configuration."> Possible wrong or missing configuration in flash archive. Check the archive. Flash the correct archive. If problem still exist report the problem.</value>
@@ -433,7 +432,7 @@
<value number="1863" name="E_GD_UNKNOWN_UNIT_NAME" fatal="false" short="GD: Unknown unit name."> Check input parameters. Requested unit is not supported. Repeat operation with the correct input parameters. Report if problem still exist.</value>
<value number="1864" name="E_GD_LAST" fatal="false" short="GD: Last enumeration (last valid + 1)."> Reset loader. If problem doesn't solved report it.</value>
-
+
<!--
* Loader utilities Fatal 1900-1950
* Loader utilities non-fatal 1951-1999
@@ -456,7 +455,7 @@
<value number="1966" name="E_DEVICE_TYPE" fatal="false" short="Device type to long."> Check manifest file from flash archive. Repeat operation with correct flash archive. Report if problem still exist.</value>
<value number="1967" name="E_NUMBER_OF_TARGET_DEVICES" fatal="false" short="Number of target devices to big.">Internal error. Reset the loader. Report if problem still exist.</value>
<value number="1968" name="E_DESCRIPTION_TOO_LONG" fatal="false" short="Description field too long.">Internal error. Reset the loader. Report if problem still exist.</value>
-
+
<!--
* Loader ADBG Fatal 2000-2050
* Loader ADBG non-fatal 2051-2099
@@ -471,7 +470,7 @@
<value number="2007" name="E_INT_FUNCTION_LIST_EMPTY" fatal="true" short="There isn't any interface function in interface group."> Use List Interface command to see if there's any available internal function.</value>
<value number="2008" name="E_PRECONDITION_IS_ALREADY_SET" fatal="true" short="Request for setting precondition that is already set."> Precondition is already set. If you want to change it, recover precondition, and than set it again.</value>
<value number="2009" name="E_PRECONDITION_IS_NOT_SET" fatal="true" short="Request to recover condition that is not changed."> You cannot recover condition that is not set before. There's no need of any further activities in order to resolve this problem. Loader will work fine.</value>
-
+
<!--
* OTP applications Fatal 2100-2150
* OTP applications non-fatal 2151-2199
@@ -482,7 +481,7 @@
<value number="2103" name="E_INVALID_CID_VALUE" fatal="true" short="Trying to write invalid CID in OTP."> The value for CID must be in the range from 19 to 16384.0 value is also alowed CID value</value>
<value number="2104" name="E_INIT_OTP_LD_FAILED" fatal="true" short="Failed to initialize OTD logical driver."> Internal error. Reset loader. Report if problem still exist</value>
<value number="2105" name="E_OTP_AREA_LOCKED" fatal="true" short="Requested OTP area is already locked."> It is not allowed to write in already locked OTP area</value>
-
+
<!--
* Security applications Fatal 2200-2250
* Security applications non-fatal 2251-2299
@@ -497,7 +496,7 @@
<value number="2258" name="E_SEC_APP_PATCH_REINSTALLED" fatal="true" short="Operation successful."> ROM Patch in Flash is successfuly reinstalled.</value>
<value number="2259" name="E_SEC_APP_ROOTKEY_EXISTS" fatal="true" short="RootKey is already installed.">.Please make sure that version of Root key is the same with already installed</value>
<value number="2260" name="E_SEC_APP_ROOTKEY_REINSTALLED" fatal="true" short="Operation successful."> Root Key is successfuly reinstalled.</value>
-
+
<!--
* Trim Area Fatal 2300-2350
* Trim Area non-fatal 2351-2499
@@ -514,22 +513,21 @@
<value number="2360" name="E_TA_INSUFFICIANT_SPACE" fatal="false" short="TA: Not enough space to flush the Trim Area."> Internal error. Reset loader. Report if problem still exist</value>
<value number="2361" name="E_TA_UNKNOWN_PARTITION" fatal="false" short="TA: Unknown partition."> Check input parameters. Repeat operation with the correct input parameters. Report if problem still exist.</value>
<value number="2362" name="E_TA_FAIL" fatal="false" short="TA: Fail."> Internal error. Reset loader. Report if problem still exist.</value>
-
+
<value number="2460" name="E_TA_MEDIA_ERROR" fatal="false" short="TA: Media error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="2461" name="E_TA_NOT_CONFIGURED" fatal="false" short="TA: Error occurs during configuration."> Possible wrong or missing configuration in flash archive. Check the archive. Flash the correct archive. If problem still exist report the problem.</value>
-
+
<!--
* Recovery applications Fatal 2500-2550
* Recovery applications non-fatal 2551-2599
-->
<value number="2500" name="E_REQUEST_DENIED" fatal="true" short="Request for change operation denied."> Init request is twice called and state is changed. Should be sent Update request then can be used Init request again.</value>
<value number="2501" name="E_UNDEFINED_CHANGE_OPERATION" fatal="true" short="Requested change operation is not supported."> Use the implemented change operation.</value>
-
+
<!--
* PD CFI Flash Fatal 2600-2650
* PD CFI Flash non-fatal 2651-2699
-->
-
<value number="2651" name="E_PD_CFI_IN_PROGRESS" fatal="false" short="PD CFI: The operation is in progress. Additional poll calls must be done."></value>
<value number="2652" name="E_PD_CFI_UNKNOWN_REQUEST" fatal="false" short="PD CFI: Type not recognized."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="2653" name="E_PD_CFI_HARDWARE_ERROR" fatal="false" short="PD CFI: Operation could not be completed because of a hardware malfunction."> It is possible that part of the operation has been carried out.</value>
@@ -571,6 +569,27 @@
<value number="2851" name="E_CR_NOT_RUNNING" fatal="false" short="Communication Relay is not running.">Communication relay is set in error state or it is not configured properly. Check the relay state. If error occured restart the loader, otherwise try reconfiguring the relay.</value>
<!--
+ * SDIO Driver SDIO_BSC_Result_t - Error codes for all functions (offset 2900)
+ * SDIO Driver Fatal 2900-2924
+ * SDIO Driver Non-Fatal 2925-2949
+ -->
+ <value number="2901" name="E_SDIO_BSC_RESULT_FAILED" fatal="true" short="General Error.">It is possible to failed to initialize the communication device.Reset loader.Report if problem still exist</value>
+ <value number="2902" name="E_SDIO_BSC_RESULT_FAILED_INVALIDARGS" fatal="true" short="Invalid arguments.">.Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
+ <value number="2903" name="E_SDIO_BSC_RESULT_FAILED_NOTSUPPORTED" fatal="true" short="Implementation is removed."> Implementation it is not supported anymore.</value>
+ <value number="2904" name="E_SDIO_BSC_RESULT_FAILED_SDIOERR" fatal="true" short="SDIO internal error.">Buffer with unaligned length is requested to be transfered or device driver is confiured to use unsupported frame size.</value>
+ <value number="2905" name="E_SDIO_BSC_RESULT_FAILED_BUSY" fatal="true" short="Communication device is busy.">Current transfer is not finished.</value>
+
+ <!--
+ * SDIO Driver SDIO_BSC_Error_t - Error codes for error callbacks (offset 2950)
+ * SDIO Driver Error Callback Fatal 2950-2974
+ * SDIO Driver Error Callback Non-Fatal 2975-2999
+ -->
+ <value number="2951" name="E_SDIO_BSC_ERROR_TIMEOUT" fatal="true" short="Timeout error.">Incorrect number of bits received.</value>
+ <value number="2952" name="E_SDIO_BSC_ERROR_BREAK" fatal="true" short="Break received.">.Reset loader.Report if problem still exist.</value>
+ <value number="2953" name="E_SDIO_BSC_ERROR_RECEIVE" fatal="true" short="Receive buffer is not provided.">Reset loader.Report if problem still exist.</value>
+ <value number="2954" name="E_SDIO_BSC_ERROR_TRANSMIT" fatal="true" short="Transmit buffer is not provided.">Reset loader.Report if problem still exist.</value>
+
+ <!--
* Security Library Fatal 4000-4050
* Security Library non-fatal 4051-4250
-->
@@ -634,7 +653,7 @@
<value number="4308" name="E_INVALID_A01_FORMAT" fatal="true" short="Something wrong with the A01 file containing the flash image.">Verify that the flash image is valid, otherwise report the problem. </value>
<value number="4309" name="E_A01_BUFFER_FULL" fatal="true" short="Buffer holding the data from the A01 file is full.">Reset loader. Report if problem still exist.</value>
<value number="4350" name="E_CONFIG_FILE_NOT_SPECIFIED" fatal="false" short="Configuration file for the emulator is not specified."> The loader will start with the default settings.</value>
-
+
<!--
* R13 and lower versions
* Error codes translation
@@ -854,7 +873,7 @@
<value number="5329" name="A2_E_READ_FILE" fatal="true" short="Failed to read a file from the file system.">.</value>
<value number="61797" name="A2_E_CORE_SUPERV" fatal="true"></value>
<value number="66166" name="A2_E_MEM_ALLOC" fatal="true"></value>
-
+
<!--
* GDFS Error codes
-->
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
index 614aaa9..c5f409b 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
@@ -7,7 +7,11 @@
/**
* @addtogroup ldr_communication_serv
* @{
- * @addtogroup a2_family
+ * @addtogroup a2_family A2 protocol family
+ * The A2 family include only one protocol, A2 protocol, used for
+ * communication between the ME and PC tool. This module includes
+ * A2 transport layer and A2 network layer for handling A2 protocol.
+ *
* @{
*/
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
index 75306a9..86e2990 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
@@ -57,7 +57,6 @@
extern Communication_t *GlobalCommunication_p;
extern Communication_t DebugCommunication;
-
/*******************************************************************************
* Declaration of functions
******************************************************************************/
@@ -73,13 +72,17 @@ extern "C"
* and communication device descriptor, a new instance of the
* communication module is created and bound to use the provided devices.
*
- * @param [in,out] Communication_p Communication module context.
+ * @param [in] Object_p Instance which will use initialized communication.
+ * @param [in,out] Communication_pp Communication module context.
* @param [in] Family Initial protocol family.
* @param [in] HashDevice_p The device to use for checksum
* calculations and verifications.
- * @param [in] *CommunicationDevice_p The device to use for network
+ * @param [in] CommunicationDevice_p The device to use for network
* transmission.
* @param [in] CommandCallback_p Collback function for command handling.
+ * @param [in] Buffers_p Pointer to buffer handling functions.
+ * @param [in] Timers_p Pointer to timers handling functions.
+ * @param [in] Queue_p Pointer to queue handling functions.
*
* @retval E_SUCCESS If the module instance is successfully
* initialized. A protocol family dependant error
@@ -203,7 +206,7 @@ extern "C"
LCM_API ErrorCode_e Do_Communication_SetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t *CommunicationDevice_p);
/*
- * Cancek Receiving new packets
+ * Cancel Receiving new packets
*
* @param [in] Communication_p Communication module context.
* @param [in] PacketsBeforeReceiverStop Number of packets to be send before stopping the receiver.
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h
index 3b686cc..74f4721 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h
@@ -44,7 +44,7 @@ typedef enum {
typedef void (*CommunicationCallback_t)(const void *Data_p, const uint32 Length, void *Param_p);
typedef void (*HashCallback_t)(void *Data_p, const uint32 Length, uint8 *Hash_p, void *Param_p);
-typedef boolean(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
+typedef ErrorCode_e(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
typedef ErrorCode_e(*DeviceWrite_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
typedef ErrorCode_e(*DeviceCancel_fn)(void *Param_p);
typedef void (*HashDeviceCancel_fn)(void *Object_p, void **Param_p);
@@ -122,8 +122,8 @@ typedef struct {
defined timer. */
ReadTime_t ReadTime_Fn; /**< Pointer to function for read time from
specified timer. */
- GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read curent
- sytem time. */
+ GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read current
+ system time. */
void *Object_p; /**< Pointer for instancing. It is used in
the PC application, but in the loaders
is always NULL */
@@ -165,7 +165,7 @@ typedef struct {
then all interrupt
enabled. */
RFifoDestroy_t RFifoDestroy_Fn; /**< Pointer to function
- for Fifo destroing.
+ for Fifo destroying.
First all interrupts
are disabled,
function executed and
@@ -219,9 +219,9 @@ typedef struct {
executed and then all
interrupt enabled. */
void *Object_p; /**<Pointer for instancing.
- It is used in the PC
- application, but in the
- loaders is always NULL.*/
+ It is used in the PC
+ application, but in the
+ loaders is always NULL.*/
} QueueInterface_t;
/**
@@ -247,9 +247,10 @@ typedef struct {
communication device. */
DeviceWrite_fn Write; /**< Pointer to function for write data thru the
communication device. */
- DeviceCancel_fn Cancel; /**< Pointer to function for caneling current
- communcation with communiation device. */
+ DeviceCancel_fn Cancel; /**< Pointer to function for canceling current
+ communication with communication device. */
void *Context_p; /**< Pointer to Device description data. */
+ void *Object_p; /**< Pointer to Object associated with the device. */
} CommunicationDevice_t;
/**
@@ -288,7 +289,7 @@ typedef struct ExecutionContext_s {
/** Communication context.*/
typedef struct {
void *Inbound_p; /**< Pointer to structure for
- handling incomming
+ handling incoming
packets.*/
void *Outbound_p; /**< Pointer to structure for
handling outgoing
@@ -309,7 +310,7 @@ typedef struct {
FunctionInterface_t *Functions_p; /**< Pointer to interface
functions for buffers,
timers and queue.*/
- Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to calback
+ Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to callback
function for handling
commands received thru
the LCM.*/
@@ -329,7 +330,7 @@ typedef struct FamilyDescriptor_s {
ErrorCode_e(*FamilyInit_fn)(Communication_t *Communication_p);
/**< Pointer to Interface function for protocol family de-initialization. */
ErrorCode_e(*FamilyShutdown_fn)(Communication_t *Communication_p);
- /**< Pointer to Pooling function in curren protocol family. */
+ /**< Pointer to Pooling function in current protocol family. */
ErrorCode_e(*Process_fn)(Communication_t *Communication_p);
/**< Pointer to function for sending packets.*/
ErrorCode_e(*Send_fn)(Communication_t *Communication_p, void *InputData_p);
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c
index 83f155e..e5aad13 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c
@@ -56,14 +56,18 @@ ErrorCode_e A2_Family_Init(Communication_t *Communication_p)
Communication_p->CurrentFamilyHash = HASH_CRC16;
if (NULL != Communication_p->BackupCommBuffer_p) {
- if (Communication_p->BackupCommBufferSize <= A2_HEADER_LENGTH) {
+ if (Communication_p->BackupCommBufferSize < A2_HEADER_LENGTH) {
memcpy(A2_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
A2_NETWORK(Communication_p)->Inbound.ReqData = A2_HEADER_LENGTH - Communication_p->BackupCommBufferSize;
A2_NETWORK(Communication_p)->Inbound.ReqBuffOffset = Communication_p->BackupCommBufferSize;
A2_NETWORK(Communication_p)->Inbound.RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
} else {
+ /* Copy content of backup buffer into scratch buffer */
memcpy(A2_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, A2_HEADER_LENGTH);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + A2_HEADER_LENGTH, Communication_p->BackupCommBufferSize - A2_HEADER_LENGTH);
+ /* Update the size of the backup buffer */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - A2_HEADER_LENGTH;
A2_NETWORK(Communication_p)->Inbound.RecBackupData = A2_HEADER_LENGTH;
}
@@ -86,7 +90,7 @@ ErrorExit:
/*
- * A2 family protocols sutdown.
+ * A2 family protocols shutdown.
*
* @param [in] Communication_p Communication module context.
*
@@ -131,10 +135,10 @@ ErrorExit:
}
/*
- * A2 Cancel Transmition.
+ * A2 Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -145,12 +149,12 @@ ErrorCode_e A2_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBef
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- A2_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ A2_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
A2_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c
index 342cb1b..99ac27e 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c
@@ -21,7 +21,7 @@
#include "r_r15_network_layer.h"
#include "r_communication_service.h"
#include "r_basicdefinitions.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
#ifdef CFG_ENABLE_A2_FAMILY
#include "r_a2_family.h"
@@ -60,7 +60,7 @@ static FamilyDescriptor_t ProtocolFamilies[] = {
A2_Transport_Send,
NULL,
NULL,
- A2_CancelReceiver
+ A2_CancelReceiver
#else
NULL,
NULL,
@@ -104,7 +104,7 @@ static FamilyDescriptor_t ProtocolFamilies[] = {
#define MAX_FAMILY (sizeof(ProtocolFamilies) / sizeof(ProtocolFamilies[0]))
/*******************************************************************************
- * Delaration of internal functions
+ * Declaration of internal functions
******************************************************************************/
static BuffersInterface_t *CreateBufferInterfaceHelpper(BuffersInterface_t *Buffers_p);
@@ -120,23 +120,27 @@ FamilyDescriptor_t *GetFamily(Family_t Family);
* Definition of external functions
******************************************************************************/
-/*
+/**
* Initialize an instance of the communication module.
*
* Given the initial family, already initialized hash device descriptor
* and communication device descriptor, a new instance of the
* communication module is created and bound to use the provided devices.
*
- * @param [in,out] Communication_p Communication module context.
+ * @param [in] Object_p Instance which will use initialized communication.
+ * @param [in,out] Communication_pp Communication module context.
* @param [in] Family Initial protocol family.
* @param [in] HashDevice_p The device to use for checksum
* calculations and verifications.
- * @param [in] *CommunicationDevice_p The device to use for network
+ * @param [in] CommunicationDevice_p The device to use for network
* transmission.
- * @param [in] CommandCallback_p Collback function for command handling.
+ * @param [in] CommandCallback_p Callback function for command handling.
+ * @param [in] Buffers_p Pointer to buffer handling functions.
+ * @param [in] Timers_p Pointer to timers handling functions.
+ * @param [in] Queue_p Pointer to queue handling functions.
*
* @retval E_SUCCESS If the module instance is successfully
- * initialized. A protocol family dependant error
+ * initialized. A protocol family dependent error
* code otherwise.
*/
ErrorCode_e Do_Communication_Initialize(void *Object_p, Communication_t **Communication_pp, 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)
@@ -188,6 +192,8 @@ ErrorCode_e Do_Communication_Initialize(void *Object_p, Communication_t **Commun
Communication_p->CurrentFamilyHash = HASH_NONE;
Communication_p->BackupCommBufferSize = 0;
+ CommunicationDevice_p->Object_p = Communication_p;
+
ReturnValue = Do_Communication_SetFamily(Communication_p, Family, CommandCallback_p);
C_(printf("#---------------------------------------------------------\n");)
@@ -208,7 +214,7 @@ ErrorExit:
* @param [in,out] Communication_pp Communication module context.
*
* @retval E_SUCCESS If the module instance is successfully
- * shut down. A protocol family dependant error
+ * shut down. A protocol family dependent error
* code otherwise.
*/
ErrorCode_e Do_Communication_Shutdown(Communication_t **Communication_pp)
@@ -261,7 +267,7 @@ ErrorExit:
* @param [in] CEHCallback Callback that will handle the commands.
*
* @retval E_SUCCESS If the family is successfully changed. A
- * protocol family dependant error code otherwise.
+ * protocol family dependent error code otherwise.
*/
ErrorCode_e Do_Communication_SetFamily(Communication_t *Communication_p, Family_t Family, Do_CEH_Call_t CEHCallback)
{
@@ -271,7 +277,7 @@ ErrorCode_e Do_Communication_SetFamily(Communication_t *Communication_p, Family_
VERIFY(NULL != Family_p, E_INVALID_INPUT_PARAMETERS);
if (NULL != Communication_p->Family_p) {
- (void)Communication_p->CommunicationDevice_p->Cancel(Communication_p);
+ (void)Communication_p->CommunicationDevice_p->Cancel(Communication_p->CommunicationDevice_p);
ReturnValue = Communication_p->Family_p->FamilyShutdown_fn(Communication_p);
VERIFY(E_SUCCESS == ReturnValue, ReturnValue);
@@ -298,7 +304,7 @@ ErrorExit:
*
*
* @retval E_SUCCESS If all packets are successfully handled. A
- * protocol family dependant error code otherwise.
+ * protocol family dependent error code otherwise.
*/
ErrorCode_e Do_Communication_Poll(Communication_t *Communication_p)
{
@@ -316,7 +322,7 @@ ErrorExit:
* Function for sending packet.
*
* @param [in] Communication_p Communication module context.
- * @param [in] InputData_p Pointer to the data for tranmission.
+ * @param [in] InputData_p Pointer to the data for transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication
@@ -397,7 +403,7 @@ ErrorExit:
* device for the given LCM context.
*
* @retval E_SUCCESS After successful execution.
- * @retval E_INVALID_INPUT_PARAMTERS In case when communicaiton is not Singleton
+ * @retval E_INVALID_INPUT_PARAMTERS In case when communication is not Singleton
* and Communication_p is NULL pointer.
*/
ErrorCode_e Do_Communication_GetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t** CommunicationDevice_pp)
@@ -422,7 +428,7 @@ ErrorExit:
* device to be set for the given LCM context.
*
* @retval E_SUCCESS After successful execution.
- * @retval E_INVALID_INPUT_PARAMTERS In case when communicaiton is not Singleton
+ * @retval E_INVALID_INPUT_PARAMTERS In case when communication is not Singleton
* and Communication_p is NULL pointer.
*/
ErrorCode_e Do_Communication_SetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t* CommunicationDevice_p)
@@ -437,7 +443,7 @@ ErrorExit:
}
/*
- * Cancek Receiving new packets
+ * Cancel Receiving new packets
*
* @param [in] Communication_p Communication module context.
* @param [in] PacketsBeforeReceiverStop Number of packets to be send before stopping the receiver.
@@ -451,7 +457,7 @@ ErrorCode_e Do_Communication_Cancel_Receiver(Communication_t *Communication_p, u
VERIFY(NULL != Communication_p->Family_p, ReturnValue);
- ReturnValue = Communication_p->Family_p->CancelReceiver_fn(Communication_p, PacketsBeforeReceiverStop);
+ ReturnValue = Communication_p->Family_p->CancelReceiver_fn(Communication_p, PacketsBeforeReceiverStop);
ErrorExit:
return ReturnValue;
@@ -463,7 +469,7 @@ void Do_CommunicationInternalErrorHandler(const ErrorCode_e IntError)
IDENTIFIER_NOT_USED(IntError);
#endif
A_(printf("# Error Code: 0x%X !\n", IntError);)
- A_(printf("# Loader stoped!\n");)
+ A_(printf("# Loader stopped!\n");)
A_(printf("#---------------------------------------------------------\n");)
/* coverity[no_escape] */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c
index 29c678d..4b42f60 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c
@@ -17,7 +17,7 @@
#include "r_time_utilities.h"
#include "r_serialization.h"
#include "r_debug_macro.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* File scope types, constants and variables
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c
index ec4c468..762d5cb 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c
@@ -52,14 +52,18 @@ ErrorCode_e Protrom_Family_Init(Communication_t *Communication_p)
PROTROM_NETWORK(Communication_p)->Inbound.StopTransfer = FALSE;
if (NULL != Communication_p->BackupCommBuffer_p) {
- if (Communication_p->BackupCommBufferSize <= PROTROM_HEADER_LENGTH) {
+ if (Communication_p->BackupCommBufferSize < PROTROM_HEADER_LENGTH) {
memcpy(PROTROM_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
PROTROM_NETWORK(Communication_p)->Inbound.ReqData = PROTROM_HEADER_LENGTH - Communication_p->BackupCommBufferSize;
PROTROM_NETWORK(Communication_p)->Inbound.ReqBuffOffset = Communication_p->BackupCommBufferSize;
PROTROM_NETWORK(Communication_p)->Inbound.RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
} else {
+ /* Copy content of backup buffer into scratch buffer */
memcpy(PROTROM_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, PROTROM_HEADER_LENGTH);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + PROTROM_HEADER_LENGTH, Communication_p->BackupCommBufferSize - PROTROM_HEADER_LENGTH);
+ /* Update the size of the backup buffer */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - PROTROM_HEADER_LENGTH;
PROTROM_NETWORK(Communication_p)->Inbound.RecBackupData = PROTROM_HEADER_LENGTH;
}
@@ -79,7 +83,7 @@ ErrorExit:
}
/*
- * Protrom family protocols sutdown.
+ * Protrom family protocols shutdown.
*
* @param [in] Communication_p Communication module context.
*
@@ -122,10 +126,10 @@ ErrorExit:
}
/*
- * Protrom Cancel Transmition.
+ * Protrom Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -134,16 +138,16 @@ ErrorCode_e Protrom_CancelReceiver(Communication_t *Communication_p, uint8 Packe
{
ErrorCode_e ReturnValue = E_SUCCESS;
- printf("Protrom_CancelReceiver called ...\n");
+ printf("Protrom_CancelReceiver called ...\n");
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- PROTROM_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ PROTROM_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
PROTROM_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
/** @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c
index bf9c24a..29be578 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c
@@ -57,16 +57,20 @@ ErrorCode_e R15_Family_Init(Communication_t *Communication_p)
R15_NETWORK(Communication_p)->Inbound.StopTransfer = FALSE;
if (NULL != Communication_p->BackupCommBuffer_p) {
- if (Communication_p->BackupCommBufferSize <= HEADER_LENGTH) {
+ if (Communication_p->BackupCommBufferSize < ALIGNED_HEADER_LENGTH) {
memcpy(R15_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
- R15_NETWORK(Communication_p)->Inbound.ReqData = HEADER_LENGTH - Communication_p->BackupCommBufferSize;
+ R15_NETWORK(Communication_p)->Inbound.ReqData = ALIGNED_HEADER_LENGTH - Communication_p->BackupCommBufferSize;
R15_NETWORK(Communication_p)->Inbound.ReqBuffOffset = Communication_p->BackupCommBufferSize;
R15_NETWORK(Communication_p)->Inbound.RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
} else {
- memcpy(R15_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, HEADER_LENGTH);
- Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - HEADER_LENGTH;
- R15_NETWORK(Communication_p)->Inbound.RecBackupData = HEADER_LENGTH;
+ /* Copy content of backup buffer into scratch buffer */
+ memcpy(R15_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, ALIGNED_HEADER_LENGTH);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + ALIGNED_HEADER_LENGTH, Communication_p->BackupCommBufferSize - ALIGNED_HEADER_LENGTH);
+ /* Update the size of the backup buffer */
+ Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - ALIGNED_HEADER_LENGTH;
+ R15_NETWORK(Communication_p)->Inbound.RecBackupData = ALIGNED_HEADER_LENGTH;
}
C_(printf("r15_family.c(%d) BackupBuffer=0x%x Size=%d\n", __LINE__, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);)
@@ -89,7 +93,7 @@ ErrorExit:
/*
- * R15 family protocols sutdown.
+ * R15 family protocols shutdown.
*
* @param [in] Communication_p Communication module context.
*
@@ -136,10 +140,10 @@ ErrorExit:
}
/*
- * R15 Cancel Transmition.
+ * R15 Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -150,12 +154,12 @@ ErrorCode_e R15_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBe
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- R15_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ R15_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
R15_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
/** @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c
index ee090c9..d27a8b8 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c
@@ -115,10 +115,10 @@ ErrorExit:
}
/*
- * Z family Cancel Transmition.
+ * Z family Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -129,12 +129,12 @@ ErrorCode_e Z_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBefo
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- Z_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ Z_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
Z_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
/** @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c b/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c
index 79845d6..eb0e2b4 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c
@@ -26,7 +26,7 @@
#include "r_adbg_module.h"
#include "r_adbg_command.h"
#include "r_communication_service.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* The test case functions declarations