summaryrefslogtreecommitdiff
path: root/lcmodule/source/cnh1605204_ldr_transport_layer
diff options
context:
space:
mode:
Diffstat (limited to 'lcmodule/source/cnh1605204_ldr_transport_layer')
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h4
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h4
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_protocol.h3
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_transport.h3
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_r15_transport_layer.h9
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_protocol.h2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_transport.h2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/t_bulk_protocol.h4
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/t_command_protocol.h8
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_protocol.h1
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_transport.h1
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/t_r15_transport_layer.h3
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_transport.c2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c24
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/command_protocol.c2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/r15_transport_layer.c42
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/test_cases/ADbg_cnh1605204.c10
18 files changed, 82 insertions, 44 deletions
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h
index 7d90384..bdabd8f 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h
@@ -17,9 +17,7 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "t_a2_transport.h"
-#include "t_communication_service.h"
-#include "error_codes.h"
+#include "error_codes.h"
/*******************************************************************************
* Declaration of functions
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h
index fa3f4ee..7943354 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h
@@ -11,7 +11,7 @@
* @{
* @addtogroup bulk_protocol Bulk Protocol
* Functionalities for handling bulk protocol. Receiving/Sending bulk
- * commands and state machines for receivin and sending bulk data chunks.
+ * commands and state machines for receiving and sending bulk data chunks.
*
* @{
*/
@@ -19,7 +19,7 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "c_system.h"
+#include "c_system_v2.h"
#include "t_bulk_protocol.h"
#include "t_r15_transport_layer.h"
#include "t_r15_network_layer.h"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_protocol.h
index 2dac437..e057a17 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_protocol.h
@@ -18,10 +18,7 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "t_protrom_protocol.h"
#include "error_codes.h"
-#include "t_communication_service.h"
-#include "t_r15_network_layer.h"
/*******************************************************************************
* Declaration of functions
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_transport.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_transport.h
index ad47f6e..3a5e21e 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_transport.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_transport.h
@@ -11,7 +11,7 @@
* @{
* @addtogroup ldr_protrom_transport_layer PROTROM Transport Layer
* PROTROM functionalities for sending PROTROM packets and
- * polling receiver and transmiter.
+ * polling receiver and transmitter.
*
* @{
*/
@@ -19,7 +19,6 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "t_protrom_transport.h"
#include "t_communication_service.h"
#include "error_codes.h"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_r15_transport_layer.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_r15_transport_layer.h
index 904eb8b..bd832b0 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_r15_transport_layer.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_r15_transport_layer.h
@@ -11,7 +11,7 @@
* @{
* @addtogroup ldr_r15_transport_layer R15 Transport layer
* R15 functionalities for sending R15 packets and
- * polling receiver and transmiter.
+ * polling receiver and transmitter.
*
* @{
*/
@@ -19,9 +19,8 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "t_r15_transport_layer.h"
#include "t_communication_service.h"
-#include "error_codes.h"
+#include "error_codes.h"
/*******************************************************************************
* Declaration of functions
@@ -60,9 +59,9 @@ ErrorCode_e R15_Transport_Poll(Communication_t *Communication_p);
* Function for sending packet in R15 protocol family.
*
* @param [in] Communication_p Communication module context.
- * @param [in] InputDataIn_p Pointer to the input data.
+ * @param [in] InputDataIn_p Pointer to the input data.
*
- * @retval E_SUCCESS After successful execution.
+ * @retval E_SUCCESS After successful execution.
* @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication
* buffer.
*/
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_protocol.h
index f4e9055..755899c 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_protocol.h
@@ -11,7 +11,7 @@
* @{
* @addtogroup z_protocol Z Protocol
* Functionalities for handling Z commands. All Z commands are not decoded
- * in this layer, it is resent to teh application layer for decoding
+ * in this layer, it is resent to the application layer for decoding
* and executing.
*
* @{
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_transport.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_transport.h
index 6de0225..6169022 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_transport.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_transport.h
@@ -11,7 +11,7 @@
* @{
* @addtogroup ldr_z_transport_layer Z Transport layer
* TI functionalities for sending Z packets, Initialization and
- * polling receiver and transmiter.
+ * polling receiver and transmitter.
*
* @{
*/
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_bulk_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_bulk_protocol.h
index 38ca8b4..95c4dbd 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_bulk_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_bulk_protocol.h
@@ -64,14 +64,14 @@ TYPEDEF_ENUM {
WAIT_TX_DONE = 9, /**< Wait all chunks to be sent. */
WRITE_BULK_FINISH = 10, /**< Bulk acknowledge has been received,
finish the write bulk process. */
- WAIT_WRITE_REQUEST = 11, /**< Wait bulk request command. */
+ WAIT_WRITE_REQUEST = 11, /**< Wait bulk request command. */
CANCEL_BULK = 12
} ENUM8(TL_BulkProtocolState_t);
/** Defined bulk process states. */
TYPEDEF_ENUM {
BULK_SESSION_IDLE = 0x00, /**< Bulk transfer is closed and ready
- for starting. */
+ for starting. */
BULK_SESSION_OPEN = 0x01, /**< Bulk transfer is opened. */
BULK_SESSION_PROCESSING = 0x02, /**< Processing the bulk transfer. */
BULK_SESSION_FINISHED = 0x04, /**< Bulk transfer is finished. */
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_command_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_command_protocol.h
index 2ca51c6..5896727 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_command_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_command_protocol.h
@@ -30,9 +30,9 @@
*/
typedef enum {
COMMAND_TYPE, /**< Command type of the packet.*/
- COMMAND_ACK, /**< Acknwoledge type of the packet.*/
+ COMMAND_ACK, /**< Acknowledge type of the packet.*/
GENERAL_RESPONSE, /**< General response type of the packet.*/
- GENERAL_RESPONSE_ACK /**< General response acknwoledge type of the packet.*/
+ GENERAL_RESPONSE_ACK /**< General response acknowledge type of the packet.*/
} CommandType_t;
@@ -52,7 +52,7 @@ typedef struct Buffer_s {
typedef struct Result_s {
ErrorCode_e Status; /**< Status send by the general response. */
Buffer_t *Response_p; /**< Buffer holding data that should be
- returned trough the general response */
+ returned trough the general response */
} Result_t;
/**
@@ -62,7 +62,7 @@ typedef struct CommandData_s {
uint8 CommandNr; /**< Number of the command. */
uint8 ApplicationNr;/**< Number of the application (command) group. */
uint16 SessionNr; /**< Number of the session in which this command
- was received.*/
+ was received.*/
CommandType_t Type; /**< Command type. */
Buffer_t Payload; /**< Holds the data received with the command.*/
} CommandData_t;
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_protocol.h
index 2bc544b..8813b87 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_protocol.h
@@ -16,7 +16,6 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "t_protrom_header.h"
#include "t_protrom_network.h"
#include "t_protrom_transport.h"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_transport.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_transport.h
index 20eef29..25ef644 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_transport.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_transport.h
@@ -17,7 +17,6 @@
* Includes
******************************************************************************/
#include "t_basicdefinitions.h"
-#include "t_protrom_network.h"
/*******************************************************************************
* Types, constants and external variables
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_r15_transport_layer.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_r15_transport_layer.h
index 75007b8..80bef19 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_r15_transport_layer.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_r15_transport_layer.h
@@ -32,7 +32,7 @@ typedef struct {
void *Payload_p; /**< Pointer to payload data.*/
uint32 Time; /**< Used time for retransmission.*/
HandleFunction_t TimerCallBackFn_p; /**< Timer call back function for
- retransmission.*/
+ retransmission.*/
} SendData_LP_t;
/** R15 Transport context. */
@@ -55,6 +55,7 @@ typedef struct {
void *BulkDataCallback_p;
/** Callback function pointer for handling end of bulk transfer.*/
void *EndOfDump_p;
+ /** Callback function pointer for handling releasing of bulk buffers.*/
void *BulkBufferRelease_p;
} R15_TransportContext_t;
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_transport.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_transport.c
index cee9aa3..9ae5f18 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_transport.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_transport.c
@@ -14,7 +14,7 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "c_system.h"
+#include "c_system_v2.h"
#include "r_a2_network.h"
#include "r_a2_transport.h"
#include <stdlib.h>
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c
index feff254..4e4a1fb 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c
@@ -14,7 +14,7 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "c_system.h"
+#include "c_system_v2.h"
#include "r_basicdefinitions.h"
#include <stdlib.h>
#include <stdio.h>
@@ -908,7 +908,7 @@ ErrorCode_e R15_Bulk_Process_Write(Communication_t *Communication_p, TL_BulkVect
}
#endif
- C_(printf("bulk_protocol.c(%d) Sent chunk (%d) session (%d)\n", __LINE__, ChunkId, BulkVector_p->SessionId);)
+ C_(printf("bulk_protocol.c(%d) Sent chunk (%d) session (%d)\n", __LINE__, BulkVector_p->SendingChunkId, BulkVector_p->SessionId);)
}
break;
@@ -955,12 +955,12 @@ ErrorCode_e R15_Bulk_Process_Write(Communication_t *Communication_p, TL_BulkVect
}
#endif
- C_(printf("bulk_protocol.c(%d) Sent chunk (%d) session (%d)\n", __LINE__, ChunkId, BulkVector_p->SessionId);)
+ C_(printf("bulk_protocol.c(%d) Sent chunk (%d) session (%d)\n", __LINE__, BulkVector_p->SendingChunkId, BulkVector_p->SessionId);)
}
}
#ifdef CFG_ENABLE_MEASUREMENT_TOOL
- ReturnValue = MP(Measurement_p, ChunkId, RECEIVED_CHUNK_TIME);
+ ReturnValue = MP(Measurement_p, BulkVector_p->SendingChunkId, RECEIVED_CHUNK_TIME);
#endif
break;
@@ -979,7 +979,7 @@ ErrorCode_e R15_Bulk_Process_Write(Communication_t *Communication_p, TL_BulkVect
pcbf(Communication_p->Object_p, BulkVector_p->SessionId, BulkVector_p->ChunkSize, BulkVector_p->Offset, BulkVector_p->Length, TRUE);
// close the current bulk session
- (void)Do_R15_Bulk_CloseSession(Communication_p, BulkVector_p); //TODO: da se hendla return vrednosta!
+ (void)Do_R15_Bulk_CloseSession(Communication_p, BulkVector_p); //TODO: return value should be handled
BulkExtendedHeader_t *PendingHeader_p = R15_TRANSPORT(Communication_p)->BulkHandle.PendingBulkHeader_p;
@@ -1030,7 +1030,7 @@ ErrorCode_e R15_Bulk_Process_Write(Communication_t *Communication_p, TL_BulkVect
#ifndef CFG_ENABLE_LOADER_TYPE
ErrExit:
-#endif
+#endif //CFG_ENABLE_LOADER_TYPE
Do_CriticalSection_Leave(R15_TRANSPORT(Communication_p)->BulkHandle.BulkTransferCS);
return ReturnValue;
@@ -1302,9 +1302,9 @@ static uint32 R15_Bulk_GetChunkId(const PacketMeta_t *const Packet_p)
{
BulkExtendedHeader_t BulkExtendedHeader = {0};
+ //lint -e(413,826)
R15_DeserializeBulkExtendedHeader(&BulkExtendedHeader, Packet_p->ExtendedHeader_p);
- //lint -e(413,826)
return BulkExtendedHeader.AcksChunk;
}
@@ -1457,7 +1457,7 @@ static ErrorCode_e R15_Bulk_ReadRequestHandler(Communication_t *Communication_p,
pcbf(Communication_p->Object_p, BulkVector_p->SessionId, BulkVector_p->ChunkSize, BulkVector_p->Offset, BulkVector_p->Length, TRUE);
// close the current bulk session
- (void)Do_R15_Bulk_CloseSession(Communication_p, BulkVector_p); //TODO: da se hendla return vrednosta!
+ (void)Do_R15_Bulk_CloseSession(Communication_p, BulkVector_p); //TODO: return value should be handled
// set bulk parameters for new bulk session
ACK_Read = FALSE;
@@ -1494,7 +1494,7 @@ static ErrorCode_e R15_Bulk_ReadRequestHandler(Communication_t *Communication_p,
/* Try to release the timer for the bulk session acknowledge */
if (R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey > 0) {
- (void)TIMER(Communication_p, TimerRelease_Fn)(OBJECT_TIMER(Communication_p), R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey); // LCM MB bug fix: Timer should be released on request for retransmission
+ (void)TIMER(Communication_p, TimerRelease_Fn)(OBJECT_TIMER(Communication_p), R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey); // LCM bug fix: Timer should be released on request for retransmission
R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey = 0;
}
@@ -1510,7 +1510,7 @@ static ErrorCode_e R15_Bulk_ReadRequestHandler(Communication_t *Communication_p,
pcbf = (BulkCommandReqCallback_t)R15_TRANSPORT(Communication_p)->BulkCommandCallback_p;
pcbf(Communication_p->Object_p, BulkVector_p->SessionId, BulkVector_p->ChunkSize, BulkVector_p->Offset, BulkVector_p->Length, TRUE);
- (void)Do_R15_Bulk_CloseSession(Communication_p, BulkVector_p); //TODO: da se hendla return vrednosta!
+ (void)Do_R15_Bulk_CloseSession(Communication_p, BulkVector_p); //TODO: return value should be handled
} else {
/* Clean the previous saved data if there is any */
BUFFER_FREE(R15_TRANSPORT(Communication_p)->BulkHandle.PendingBulkHeader_p);
@@ -1532,7 +1532,7 @@ static ErrorCode_e R15_Bulk_ReadRequestHandler(Communication_t *Communication_p,
/* Try to release the timer for the bulk session acknowledge */
if (R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey > 0) {
- (void)TIMER(Communication_p, TimerRelease_Fn)(OBJECT_TIMER(Communication_p), R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey); // LCM MB bug fix: Timer should be released on request for retransmission
+ (void)TIMER(Communication_p, TimerRelease_Fn)(OBJECT_TIMER(Communication_p), R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey); // LCM bug fix: Timer should be released on request for retransmission
R15_TRANSPORT(Communication_p)->BulkHandle.TimerKey = 0;
}
}
@@ -1602,7 +1602,7 @@ static ErrorCode_e R15_Bulk_DataRequestHandler(Communication_t *Communication_p,
BulkVector_p->TransferedLength += BulkVector_p->ChunkSize;
pcbf = (BulkDataReqCallback_t)R15_TRANSPORT(Communication_p)->BulkDataCallback_p;
pcbf(Communication_p->Object_p, BulkVector_p->SessionId, ExtendedHeader.ChunkSize, BulkVector_p->Offset, BulkVector_p->Length, BulkVector_p->TotalLength, BulkVector_p->TransferedLength);
- C_(printf("S(%d) L(%d) CS(%d)\n", BulkVector_p->SessionId, BulkVector_p->Length, BulkVector_p->ChunkSize);)
+ C_(printf("S(%d) L(%d) CS(%d)\n", BulkVector_p->SessionId, BulkVector_p->Length, ExtendedHeader.ChunkSize);)
}
}
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/command_protocol.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/command_protocol.c
index 08b4819..311ca2b 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/command_protocol.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/command_protocol.c
@@ -54,7 +54,7 @@ static ErrorCode_e DispatchCommand(Communication_t *Communication_p, PacketMeta_
*/
ErrorCode_e Do_R15_Command_ResetSessionCounters(const Communication_t *const Communication_p)
{
- /* Iintialize the session counters */
+ /* Initialize the session counters */
R15_TRANSPORT(Communication_p)->SessionStateIn = 0;
R15_TRANSPORT(Communication_p)->SessionStateOut = 0;
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c
index 6ea08d4..8f9ba0f 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
-#include "c_system.h"
+#include "c_system_v2.h"
#include "t_basicdefinitions.h"
#include "r_debug.h"
#include "r_debug_macro.h"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/r15_transport_layer.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/r15_transport_layer.c
index 893412f..dcc5a3a 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/r15_transport_layer.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/r15_transport_layer.c
@@ -14,7 +14,7 @@
/*******************************************************************************
* Includes
******************************************************************************/
-#include "c_system.h"
+#include "c_system_v2.h"
#include "r_r15_transport_layer.h"
#include <stdlib.h>
#include <string.h>
@@ -37,7 +37,9 @@
******************************************************************************/
static Timer_t *TimerSet(PacketMeta_t *Packet_p, const SendData_LP_t *const InputData_p, Communication_t *Communication_p);
static void R15_Transport_OutHashCallback(const void *const Data_p, uint32 Length, const uint8 *const Hash_p, void *Param_p);
-
+#ifdef CFG_ENABLE_LOADER_TYPE
+static ErrorCode_e ConfigureDeviceTimeouts(Communication_t *Communication_p);
+#endif
/*******************************************************************************
* File scope types, constants and variables
******************************************************************************/
@@ -57,6 +59,7 @@ static void R15_Transport_OutHashCallback(const void *const Data_p, uint32 Lengt
*/
ErrorCode_e R15_Transport_Initialize(const Communication_t *const Communication_p)
{
+ ErrorCode_e ReturnValue = E_SUCCESS;
int VectorCounter;
/* Initialize the session counters for command protocol*/
@@ -67,9 +70,14 @@ ErrorCode_e R15_Transport_Initialize(const Communication_t *const Communication_
R15_TRANSPORT(Communication_p)->BulkSessionCounter = 0;
/* Initialize the default timeouts */
+#ifndef CFG_ENABLE_LOADER_TYPE
R15_TIMEOUTS(Communication_p)->TCACK = ACK_TIMEOUT_IN_MS;
R15_TIMEOUTS(Communication_p)->TBCR = BULK_COMMAND_RECEIVING_TIMEOUT;
R15_TIMEOUTS(Communication_p)->TBDR = BULK_DATA_RECEIVING_TIMEOUT;
+#else
+ ReturnValue = ConfigureDeviceTimeouts((Communication_t *)Communication_p);
+ VERIFY(E_SUCCESS == ReturnValue, ReturnValue);
+#endif
for (VectorCounter = 0; VectorCounter < MAX_BULK_TL_PROCESSES; VectorCounter++) {
R15_TRANSPORT(Communication_p)->BulkVectorList[VectorCounter].Status = BULK_SESSION_IDLE;
@@ -80,7 +88,10 @@ ErrorCode_e R15_Transport_Initialize(const Communication_t *const Communication_
R15_TRANSPORT(Communication_p)->BulkHandle.BulkTransferCS = Do_CriticalSection_Create();
R15_TRANSPORT(Communication_p)->BulkHandle.PendingBulkHeader_p = NULL;
- return E_SUCCESS;
+#ifdef CFG_ENABLE_LOADER_TYPE
+ErrorExit:
+#endif
+ return ReturnValue;
}
/*
@@ -314,6 +325,31 @@ static Timer_t *TimerSet(PacketMeta_t *Packet_p, const SendData_LP_t *const Inpu
return Timer_p;
}
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+/*
+ * Function for configuration of timeouts for communication device.
+ *
+ * @param [in] Communication_p Communication module context.
+ *
+ * @return E_SUCCESS If is successfully executed.
+ */
+static ErrorCode_e ConfigureDeviceTimeouts(Communication_t *Communication_p)
+{
+ ErrorCode_e ReturnValue = E_INVALID_INPUT_PARAMETERS;
+ R15_Timeouts_t NewTimeoutData = {0};
+
+ ReturnValue = Communication_p->CommunicationDevice_p->SetTimeouts((void *)&NewTimeoutData, (void *)Communication_p);
+ VERIFY(E_SUCCESS == ReturnValue, ReturnValue);
+
+ ReturnValue = R15_SetProtocolTimeouts(Communication_p, (void *)&NewTimeoutData);
+ VERIFY(E_SUCCESS == ReturnValue, ReturnValue);
+
+ErrorExit:
+ return ReturnValue;
+}
+#endif
+
/** @} */
/** @} */
/** @} */
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/test_cases/ADbg_cnh1605204.c b/lcmodule/source/cnh1605204_ldr_transport_layer/test_cases/ADbg_cnh1605204.c
index 8453acf..7c95361 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/test_cases/ADbg_cnh1605204.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/test_cases/ADbg_cnh1605204.c
@@ -25,7 +25,9 @@
#include "r_adbg_case.h"
#include "r_adbg_module.h"
#include "r_adbg_command.h"
+#ifndef CFG_ENABLE_LOADER_TYPE
#include "r_a2_protocol.h"
+#endif // CFG_ENABLE_LOADER_TYPE
#include "r_bulk_protocol.h"
#include "r_command_protocol.h"
#include "r_r15_transport_layer.h"
@@ -34,7 +36,9 @@
/*******************************************************************************
* The test case functions declarations
******************************************************************************/
+#ifndef CFG_ENABLE_LOADER_TYPE
static void ADbg_Do_A2_Command_Send(ADbg_Case_t *Case_p);
+#endif // CFG_ENABLE_LOADER_TYPE
static void ADbg_Do_R15_Bulk_OpenSession(ADbg_Case_t *Case_p);
static void ADbg_Do_R15_Bulk_CreateVector(ADbg_Case_t *Case_p);
@@ -58,9 +62,11 @@ static void ADbg_R15_GetProtocolTimeouts(ADbg_Case_t *Case_p);
/*******************************************************************************
* The test case definitions
******************************************************************************/
+#ifndef CFG_ENABLE_LOADER_TYPE
// A2_protocol
static uint8 Parameters1_1[4] = {3, WORDPTR, WORDPTR, WORD};
ADBG_CASE_DEFINE(Test_Do_A2_Command_Send, 1, 8, ADbg_Do_A2_Command_Send, Parameters1_1);
+#endif // CFG_ENABLE_LOADER_TYPE
// Bulk_protocol
static uint8 Parameters3_1[5] = {4, WORDPTR, SHORT, WORD, WORD};
@@ -107,7 +113,9 @@ ADBG_CASE_DEFINE(Test_R15_GetProtocolTimeouts, 18, 8, ADbg_R15_GetProtocolTimeou
******************************************************************************/
ADBG_SUITE_DEFINE_BEGIN(TestCase_CNH1605204, 0, 8)
+#ifndef CFG_ENABLE_LOADER_TYPE
ADBG_SUITE_ENTRY(Test_Do_A2_Command_Send)
+#endif // CFG_ENABLE_LOADER_TYPE
ADBG_SUITE_ENTRY(Test_Do_R15_Bulk_OpenSession)
ADBG_SUITE_ENTRY(Test_Do_R15_Bulk_CreateVector)
@@ -141,6 +149,7 @@ void Do_CNH1605204_Module_Test_Run(ADbg_MainModule_t *MainModule_p)
/*******************************************************************************
* Test cases
******************************************************************************/
+#ifndef CFG_ENABLE_LOADER_TYPE
/**
* This function will test function:
* CNH1605204_TestedFunction1.
@@ -171,6 +180,7 @@ static void ADbg_Do_A2_Command_Send(ADbg_Case_t *Case_p)
free(CmdData_p);
}
}
+#endif // CFG_ENABLE_LOADER_TYPE
/**
* This function will test function: