diff options
Diffstat (limited to 'lcmodule/source/cnh1606344_ldr_communication_module/include')
9 files changed, 51 insertions, 301 deletions
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 c5f409b..867317e 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 @@ -20,7 +20,6 @@ ******************************************************************************/ #include "t_a2_family.h" #include "error_codes.h" -#include "t_communication_service.h" /******************************************************************************* * Declaration of functions @@ -53,8 +52,10 @@ ErrorCode_e A2_Family_Shutdown(Communication_t *Communication_p); /* * A2 Cancel Receiver. * - * @param [in] Communication_p Communication module context. - * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition. + * @param [in] Communication_p Communication module context. + * @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. 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 643e067..e012feb 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 @@ -19,7 +19,7 @@ /******************************************************************************* * Includes ******************************************************************************/ -#include "c_system.h" +#include "c_system_v2.h" #include "error_codes.h" #include "t_communication_service.h" @@ -81,13 +81,13 @@ extern "C" * calculations and verifications. * @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. */ LCM_API 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); @@ -102,7 +102,7 @@ extern "C" * @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. */ LCM_API ErrorCode_e Do_Communication_Shutdown(Communication_t **Communication_pp); @@ -118,8 +118,8 @@ extern "C" * @param [in] Communication_p Communication module context. * * - * @retval E_SUCCESS If all packets are successfully handled. A - * protocol family dependant error code otherwise. + * @retval E_SUCCESS If all packets are successfully handled. + * A protocol family dependent error code otherwise. */ LCM_API ErrorCode_e Do_Communication_Poll(Communication_t *Communication_p); @@ -132,8 +132,8 @@ extern "C" * @param [in] Family New protocol family identifier. * @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. + * @retval E_SUCCESS If the family is successfully changed. + * A protocol family dependent error code otherwise. */ LCM_API ErrorCode_e Do_Communication_SetFamily(Communication_t *Communication_p, Family_t Family, Do_CEH_Call_t CEHCallback); @@ -141,7 +141,7 @@ extern "C" * 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 @@ -186,7 +186,7 @@ extern "C" * 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. */ LCM_API ErrorCode_e Do_Communication_GetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t **CommunicationDevice_pp); @@ -202,7 +202,7 @@ extern "C" * 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. */ LCM_API ErrorCode_e Do_Communication_SetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t *CommunicationDevice_p); @@ -210,11 +210,11 @@ extern "C" /* * Cancel Receiving new packets * - * @param [in] Communication_p Communication module context. + * @param [in] Communication_p Communication module context. * @param [in] PacketsBeforeReceiverStop Number of packets to be send before stopping the receiver. * - * @retval E_SUCCESS If all packets are successfully handled. A - * protocol family dependant error code otherwise. + * @retval E_SUCCESS If all packets are successfully handled. + * A protocol family dependent error code otherwise. */ LCM_API ErrorCode_e Do_Communication_Cancel_Receiver(Communication_t *Communication_p, uint8 PacketsBeforeReceiverStop); @@ -225,7 +225,7 @@ extern "C" * * @retval char LCM_CurrentVersion[] After successful execution. */ - LCM_API char *Do_Communication_GetVersion(); + LCM_API char *Do_Communication_GetVersion(void); #ifdef __cplusplus }; diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_measurement_tool.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_measurement_tool.h deleted file mode 100644 index 25884b8..0000000 --- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_measurement_tool.h +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Copyright (C) ST-Ericsson SA 2011 - * License terms: 3-clause BSD license - ******************************************************************************/ -#ifndef R_MEASUREMENT_TOOL_H_ -#define R_MEASUREMENT_TOOL_H_ -/** - * @addtogroup ldr_communication_module - * @{ - * @addtogroup measurement_serv Measurement services - * Measurement functions is tool for performance measurement. Can be used - * for flashing performance, communication performance and i.t.c. - * - * @{ - * - */ - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "t_basicdefinitions.h" -#include "t_measurement_tool.h" -#include "error_codes.h" - -/******************************************************************************* - * Declaration of functions - ******************************************************************************/ - -#define MP(x, y, z) Do_Measurement_AddMeasurementData( x, Do_Timer_ReadTime(NULL,x->TimerId), y, z); -#define MFINISH(x) Do_Measurement_CompleteResults( x); -/** - * Initialization of measurement module. - * - * @param [in] MeasurementData_p Pointer to curren measurement data block. - * - * @retval E_SUCCESS If initialization is done. - */ -ErrorCode_e Do_Measurment_Init(Measurement_t *MeasurementData_p); - -/** - * This function create general measurement data block. - * - * @param [in] Communication_p Communication module context. - * @param [in] MeasurementData_pp Pointer to the created measurement data block. - * @param [in] Type Type of measurement. - * - * @retval E_SUCCESS After successful execution. - * @retval E_ALLOCATE_FAILED If failed to allocate session measurement - * data block. - */ -ErrorCode_e Do_Measurement_CreateMeasurementData(Communication_t *Communication_p, Measurement_t **MeasurementData_pp, uint32 Type); - -/** - * This function collect all data from measurement buffer. - * - * @param [in] Communication_p Communication module context. - * @param [in, out] Data_pp Point to pointer that should be initialized to point - * on outgoing buffer. - * - * @return Number of characters successfully readied from measurement - * buffer. - */ -uint32 Do_Measurement_GetMeasurementData(Communication_t *Communication_p, uint8 **Data_pp); - -/** - * This function create measurement data block for bulk session. - * - * @param [in] Communication_p Communication module context. - * @param [in] SessionMeasurement_pp Pointer to the created session - * measurement data block. - * @param [in] PreviousSessionDataBlock_p Pointer to the previouse session - * measurement data block. - * @param [in] ChunkNr Number of chunks in this session. - * @param [in] Session Session number. - * - * @retval E_SUCCESS After successful execution. - * @retval E_ALLOCATE_FAILED If failed to allocate session measurement - * data block. - */ -ErrorCode_e Do_Measurement_CreateSessionMeasurementData(Communication_t *Communication_p, - SessionMeasurement_t **SessionMeasurement_pp, - SessionMeasurement_t *PreviousSessionDataBlock_p, - uint32 ChunkNr, uint32 Session); - -/** - * This function create measurement data block for measure chunks transfer. - * - * @param [in] Communication_p Communication module context. - * @param [in] ChunkMeasurement_pp Pointer to the created chunk - * measurement data block. - * @param [in] PreviousChunkDataBlock_p Pointer to the previouse chunk - * measurement data block. - * @param [in] ChunkId Chunk ID. - * - * @retval E_SUCCESS After successful execution. - * @retval E_ALLOCATE_FAILED If failed to allocate session measurement - * data block. - */ -ErrorCode_e Do_Measurement_CreateChunkMeasurementData(Communication_t *Communication_p, - ChunkMeasurement_t **ChunkMeasurement_pp, - ChunkMeasurement_t *PreviousChunkDataBlock_p, - uint32 ChunkId); -/** - * This function destroy measurement data block for bulk session. - * - * @param [in] MeasurementData_pp Pointer to the measurement data block. - * - * @retval E_SUCCESS After successful execution. - */ -ErrorCode_e Do_Measurement_DestroySessionMeasurementData(SessionMeasurement_t **MeasurementData_pp); - -/** - * This function destroy measurement data block for bulk chunks. - * - * @param [in] MeasurementData_pp Pointer to the main measurement data block. - * - * @retval E_SUCCESS After successful execution. - */ -ErrorCode_e Do_Measurement_DestroyChunkMeasurementData(ChunkMeasurement_t **MeasurementData_pp); - -/** - * This function destroy general measurement data block. - * - * @param [in] MeasurementData_pp Pointer to the main measurement data block. - * - * @retval E_SUCCESS After successful execution. - */ -ErrorCode_e Do_Measurement_DestroyMeasurementData(Measurement_t **MeasurementData_pp); - -/** - * This function make zero reference for all measured data. - * - * @param [in] MeasurementData_p Pointer to the main measurement data block. - * - * @retval E_SUCCESS After successful execution. - */ -ErrorCode_e Do_Measurement_ZeroReferenceMeasurementData(Measurement_t *MeasurementData_p); - -/** - * This function add measured time in specified measurement data block. - * - * @param [in] MeasurementData_p Pointer to the main measurement data block. - * @param [in] Time Measured time. - * @param [in] ChunkID Chunk ID - * @param [in] Parameter Parameter in the measurement data block. - * - * @retval E_SUCCESS After successful execution. - */ -ErrorCode_e Do_Measurement_AddMeasurementData(Measurement_t *MeasurementData_p, uint32 Time, uint32 ChunkID, MeasurementParameter_t Parameter); - -/** - * - */ -ErrorCode_e Do_Measurement_CompleteResults(Measurement_t *Measurement_p); - -/** @} */ -/** @} */ -#endif /* R_MEASUREMENT_TOOL_H_ */ diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_protrom_family.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_protrom_family.h index a5498c6..670590d 100644 --- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_protrom_family.h +++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_protrom_family.h @@ -21,7 +21,6 @@ ******************************************************************************/ #include "t_protrom_protocol.h" #include "error_codes.h" -#include "t_communication_service.h" /******************************************************************************* * Declaration of functions @@ -41,7 +40,7 @@ ErrorCode_e Protrom_Family_Init(Communication_t *Communication_p); /** - * Protrom family protocols sutdown. + * Protrom family protocols shutdown. * * @param [in] Communication_p Communication module context. * @@ -51,10 +50,12 @@ ErrorCode_e Protrom_Family_Init(Communication_t *Communication_p); ErrorCode_e Protrom_Family_Shutdown(Communication_t *Communication_p); /* - * 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] Communication_p Communication module context. + * @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. diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_r15_family.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_r15_family.h index 7e6d2f6..9731e3d 100644 --- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_r15_family.h +++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_r15_family.h @@ -11,7 +11,7 @@ * The R15 protocol family include two protocols COMMAND and BULK. Command * protocol is used for sending commands between the ME and PC tool in both * direction. This module include R15 transport layer and R15 network layer - * for handling R15 prtocols. + * for handling R15 protocols. * * @{ * @@ -22,7 +22,6 @@ ******************************************************************************/ #include "t_r15_family.h" #include "error_codes.h" -#include "t_communication_service.h" /******************************************************************************* * Declaration of functions @@ -43,7 +42,7 @@ ErrorCode_e R15_Family_Init(Communication_t *Communication_p); /** - * R15 family protocols sutdown. + * R15 family protocols shutdown. * * @param [in] Communication_p Communication module context. * @@ -53,10 +52,12 @@ ErrorCode_e R15_Family_Init(Communication_t *Communication_p); ErrorCode_e R15_Family_Shutdown(Communication_t *Communication_p); /* - * 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] Communication_p Communication module context. + * @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. diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_z_family.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_z_family.h index 8bb577f..6cc84a3 100644 --- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_z_family.h +++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_z_family.h @@ -22,8 +22,6 @@ ******************************************************************************/ #include "t_z_protocol.h" #include "error_codes.h" -#include "t_communication_service.h" -#include "t_z_network.h" /******************************************************************************* * Declaration of functions @@ -57,10 +55,12 @@ ErrorCode_e Z_Family_Init(Communication_t *Communication_p); ErrorCode_e Z_Family_Shutdown(Communication_t *Communication_p); /* - * 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] Communication_p Communication module context. + * @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. 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 74f4721..268788a 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 @@ -13,7 +13,6 @@ /******************************************************************************* * Includes ******************************************************************************/ -#include "c_system.h" #include "t_basicdefinitions.h" #include "error_codes.h" #include "t_security_algorithms.h" @@ -21,12 +20,6 @@ #include "t_queue.h" #include "t_time_utilities.h" -#ifndef CFG_ENABLE_LOADER_TYPE -#ifdef WIN32 -#include <windows.h> -#endif -#endif - /******************************************************************************* * Types, constants and external variables @@ -47,6 +40,7 @@ typedef void (*HashCallback_t)(void *Data_p, const uint32 Length, uint8 *Hash_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 ErrorCode_e(*DeviceSetTimeouts_fn)(void *Timeouts_p, void *Param_p); typedef void (*HashDeviceCancel_fn)(void *Object_p, void **Param_p); typedef void (*DeviceCalculate_fn)(void *Object_p, HashType_e Type, void *Data_p, const uint32 Length, uint8 *Hash_p, HashCallback_t Callback_fn, void *Param_p); @@ -243,14 +237,16 @@ typedef struct { * Structure contain all functions for communication device manipulating. */ typedef struct { - DeviceRead_fn Read; /**< Pointer to function for read data from - communication device. */ - DeviceWrite_fn Write; /**< Pointer to function for write data thru the - communication 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. */ + DeviceRead_fn Read; /**< Pointer to function for read data from + communication device. */ + DeviceWrite_fn Write; /**< Pointer to function for write data thru the + communication device. */ + DeviceCancel_fn Cancel; /**< Pointer to function for canceling current + communication with communication device. */ + DeviceSetTimeouts_fn SetTimeouts; /**< Pointer to function for setting timeouts + for the communication device*/ + void *Context_p; /**< Pointer to Device description data. */ + void *Object_p; /**< Pointer to Object associated with the device. */ } CommunicationDevice_t; /** @@ -338,7 +334,7 @@ typedef struct FamilyDescriptor_s { ErrorCode_e(*SetProtocolTimeouts_fn)(Communication_t *Communication_p, void *TimeoutData_p); /**< Pointer to function for getting communication timeouts from current protocol family. */ ErrorCode_e(*GetProtocolTimeouts_fn)(Communication_t *Communication_p, void *TimeoutData_p); - /**< Pointer to function for stopping the transmition pool after sending the specified number of packets. */ + /**< Pointer to function for stopping the transmission pool after sending the specified number of packets. */ ErrorCode_e(*CancelReceiver_fn)(Communication_t *Communication_p, uint8 PacketsBeforeTransferStop); } FamilyDescriptor_t; diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_measurement_tool.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_measurement_tool.h deleted file mode 100644 index bdc2022..0000000 --- a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_measurement_tool.h +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (C) ST-Ericsson SA 2011 - * License terms: 3-clause BSD license - ******************************************************************************/ -#ifndef T_MEASUREMENT_TOOL_H_ -#define T_MEASUREMENT_TOOL_H_ - -/** - * @addtogroup ldr_communication_serv - * @{ - * @addtogroup measurement_serv - * @{ - * - */ - -/******************************************************************************* - * Includes - ******************************************************************************/ - -#include "t_basicdefinitions.h" -#include "t_time_utilities.h" - -/** */ -typedef enum { - FLASH_VIA_BULK_TRANSFER, -} MeasurementType_t; - -/** Type of parameters for measurement. */ -typedef enum { - START_SESSION_TIME, - END_SESSION_TIME, - RECEIVED_CHUNK_TIME , - START_FLASH_CHUNK_TIME, - END_FLASH_CHUNK_TIME, - START_COMMAND_TIME, - END_COMMAND_TIME, -} MeasurementParameter_t; - -/** Structure for Chunk Data measurement */ -typedef struct ChunkMeasurement_s { - struct ChunkMeasurement_s *PreviousDataBlock_p; - uint32 ChunkId; - uint32 ReceivedChunkTime; - uint32 StartFlashChunkTime; - uint32 EndFlashChunkTime; - struct ChunkMeasurement_s *NextDataBlock_p; -} ChunkMeasurement_t; - -/** structure for Session measurement */ -typedef struct SessionMeasurement_s { - struct SessionMeasurement_s *PreviousDataBlock_p; - uint32 SessionId; - uint32 OpenSessionTime; - uint32 CloseSessionTime; - uint32 ChunkNr; - ChunkMeasurement_t *ChunkMeasurement_p; - struct SessionMeasurement_s *NextDataBlock_p; -} SessionMeasurement_t; - -/** structure for fllash file procedure measurement */ -typedef struct ProcesFileMeasurement_s { - struct ProcesFileMeasurement_s *PreviousBlock_p; - uint32 OpenTime; - uint32 CloseTime; - struct ProcesFileMeasurement_s *NextBlock_p; -} ProcesFileMeasurement_t; - -/** Measurement data context structure*/ -typedef struct { - uint32 SessionNr; - SessionMeasurement_t *SessionMeasurement_p; - ProcesFileMeasurement_t *ProcesFileMeasurement_p; -} MeasurementDataContext_t; - -/** Structure for global data measurement */ -typedef struct { - uint32 Type; - uint32 TimerId; - uint32 StartCommandTime; - uint32 EndCommandTime; - MeasurementDataContext_t *MeasurementData_p; - Timer_t Timer; - uint32 ResultLength; - uint8 *Result_p; -} Measurement_t; - -/** @} */ -/** @} */ -#endif /* T_MEASUREMENT_TOOL_H_ */ diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_r15_family.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_r15_family.h index 66575f5..eb82411 100644 --- a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_r15_family.h +++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_r15_family.h @@ -18,12 +18,11 @@ ******************************************************************************/ #include "t_r15_transport_layer.h" -#include "t_r15_network_layer.h" -/** Strucure with timeouts for R15 protocols. */ +/** Structure with timeouts for R15 protocols. */ typedef struct { uint32 TCACK ; /**< Time for command packet acknowledge. */ - uint32 TBCR; /**< Time for bulk command packet to be recieved.*/ + uint32 TBCR; /**< Time for bulk command packet to be received.*/ uint32 TBDR; /**< Time for bulk data packet to be received. */ } R15_Timeouts_t; |