diff options
Diffstat (limited to 'lcmodule/source/cnh1605204_ldr_transport_layer/include')
19 files changed, 1396 insertions, 0 deletions
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h new file mode 100644 index 0000000..6a94bae --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _R_A2_PROTOCOL_H_ +#define _R_A2_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup a2_family + * @{ + * @addtogroup a2_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_a2_protocol.h" +#include "t_a2_network.h" +#include "error_codes.h" +#include "t_communication_service.h" + +#if (defined(WIN32) || defined(__CYGWIN__)) + +#ifdef LCM_EXPORTS +#define LCM_API __declspec(dllexport) // export DLL information +#else //LCM_EXPORTS +#define LCM_API __declspec(dllimport) // import DLL information +#endif // LCM_EXPORTS + +#elif defined(__linux__) + +#ifdef LCM_EXPORTS +#define LCM_API __attribute__((visibility("default"))) +#else //LCM_EXPORTS +#define LCM_API +#endif // LCM_EXPORTS + +#elif defined(CFG_ENABLE_LOADER_TYPE) + +#define LCM_API + +#endif // WIN32 + +/*********************************************************************** + * Declaration of functions + **********************************************************************/ + + +#ifdef __cplusplus +extern "C" +{ +#endif // #ifdef __cplusplus + /** + * Sends command packet with A2 protocol. + * + * @param [in] Communication_p Communication module context. + * @param [in] CmdData_p Pointer to the command data. + * + * @retval E_SUCCESS After successful execution. + * @retval E_INVALID_INPUT_PARAMETERS If CmdData_p is NULL. + */ + LCM_API ErrorCode_e Do_A2_Command_Send(Communication_t *Communication_p, A2_CommandData_t *CmdData_p); +#ifdef __cplusplus +}; +#endif // #ifdef __cplusplus + +/** + * Decode received command. + * + * @param [in] Communication_p Communication module context. + * @param [in] Packet_p Pointer to the received buffer. + * + * @retval E_SUCCESS After successful execution. + * @retval E_INVALID_INPUT_PARAMETERS if Packet_p is NULL. + */ +ErrorCode_e A2_Command_Process(Communication_t *Communication_p, A2_PacketMeta_t *Packet_p); + +/** @} */ +/** @} */ +/** @} */ +#endif /* _R_A2_PROTOCOL_H_*/ diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h new file mode 100755 index 0000000..6124d58 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _R_A2_SPEEDFLASH_H_ +#define _R_A2_SPEEDFLASH_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup a2_family + * @{ + * @addtogroup a2_speedflash + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_a2_protocol.h" +#include "t_a2_network.h" +#include "error_codes.h" +#include "t_communication_service.h" + +#if (defined(WIN32) || defined(__CYGWIN__)) + +#ifdef LCM_EXPORTS +#define LCM_API __declspec(dllexport) // export DLL information +#else //LCM_EXPORTS +#define LCM_API __declspec(dllimport) // import DLL information +#endif // LCM_EXPORTS + +#elif defined(__linux__) + +#ifdef LCM_EXPORTS +#define LCM_API __attribute__((visibility("default"))) +#else //LCM_EXPORTS +#define LCM_API +#endif // LCM_EXPORTS + +#elif defined(CFG_ENABLE_LOADER_TYPE) + +#define LCM_API + +#endif // WIN32 + +/*********************************************************************** + * Declaration of functions + **********************************************************************/ + + +#ifdef __cplusplus +extern "C" +{ +#endif // #ifdef __cplusplus + /** + * Set the LCM in A2 Speedflash Mode. + * + * @param [in] Communication_p Communication module context. + * @param [in] State State of the speedflash (TRUE - on, FALSE - off). + * + * @retval E_SUCCESS After successful execution. + * @retval + */ + LCM_API void Do_A2_Speedflash_Start(Communication_t *Communication_p); + + LCM_API void Do_A2_Speedflash_SetLastBlock(Communication_t *Communication_p); + + /** + * Writes A2 speedflash sub-block on the comm device. + * + * @param [in] Communication_p Communication module context. + * @param [in] Buffer Buffer containing the data of the sub-block. + * @param [in] BufferSize Size of the speedflash sub-blocks. + * + * @retval E_SUCCESS After successful execution. + * @retval + */ + LCM_API ErrorCode_e Do_A2_Speedflash_WriteBlock(Communication_t *Communication_p, const void *Buffer, const uint32 BufferSize); +#ifdef __cplusplus +}; +#endif // #ifdef __cplusplus + +ErrorCode_e A2_Speedflash_Poll(Communication_t *Communication_p); + +/** @} */ +/** @} */ +/** @} */ +#endif /* _R_A2_SPEEDFLASH_H_ */ 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 new file mode 100644 index 0000000..bb082e7 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_R_A2_TRANSPORT_LAYER_H +#define INCLUSION_GUARD_R_A2_TRANSPORT_LAYER_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup a2_family + * @{ + * @addtogroup ldr_transport_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_a2_transport.h" +#include "t_communication_service.h" +#include "error_codes.h" + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * Handles all registered TL processes. + * + * @param [in] Communication_p The communication context + * structure to receive information + * about this module instance. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e A2_Transport_Poll(Communication_t *Communication_p); + +/* + * Function for sending packet. + * + * @param [in] Communication_p The communication context + * structure to receive information + * about this module instance. + * @param [in] InputData_p Pointer to the input data. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication + * buffer. + */ +ErrorCode_e A2_Transport_Send(Communication_t *Communication_p, void *InputDataIn_p); + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_R_A2_TRANSPORT_LAYER_H + 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 new file mode 100644 index 0000000..e3dd83c --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_bulk_protocol.h @@ -0,0 +1,198 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _R_BULK_PROTOCOL_H_ +#define _R_BULK_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup bulk_protocol Bulk Protocol + * Functionalities for handling bulk protocol. Receiving/Sending bulk + * commands and state machines for receivin and sending bulk data chunks. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "c_system.h" +#include "t_bulk_protocol.h" +#include "t_r15_transport_layer.h" +#include "t_r15_network_layer.h" +#include "error_codes.h" +#include "r_communication_service.h" +#ifdef CFG_ENABLE_LOADER_TYPE +#include "t_security_algorithms.h" +#endif + +#if (defined(WIN32) || defined(__CYGWIN__)) + +#ifdef LCM_EXPORTS +#define LCM_API __declspec(dllexport) // export DLL information +#else //LCM_EXPORTS +#define LCM_API __declspec(dllimport) // import DLL information +#endif // LCM_EXPORTS + +#elif defined(__linux__) + +#ifdef LCM_EXPORTS +#define LCM_API __attribute__((visibility("default"))) +#else //LCM_EXPORTS +#define LCM_API +#endif // LCM_EXPORTS + +#elif defined(CFG_ENABLE_LOADER_TYPE) + +#define LCM_API + +#endif //#ifdef CFG_ENABLE_LOADER_TYPE + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * State machine for bulk transfer from ME to PC. + * + * @param [in] Communication_p Communication module context. + * @param [in] BulkVector_p Pointer to the received buffer. + * + * @retval E_SUCCESS After successful execution. + * @retval E_INVALID_INPUT_PARAMETERS If Packet_p is NULL. + */ +ErrorCode_e R15_Bulk_Process_Write(Communication_t *Communication_p, TL_BulkVectorList_t *BulkVector_p); +/** + * Decoding received bulk command. + * + * @param [in] Communication_p Communication module context. + * @param [in] Packet_p Pointer to the received buffer. + * + * @retval E_SUCCESS After successful execution. + * @retval E_INVALID_INPUT_PARAMETERS If Packet_p is NULL. + */ +ErrorCode_e R15_Bulk_Process(Communication_t *Communication_p, PacketMeta_t *Packet_p); + +#ifdef CFG_ENABLE_LOADER_TYPE +/** + * Generate bulk Session ID. Allowed bulk session ID is from 1 to 65535. + * + * @param [in] Communication_p Communication module context. + * + * @retval Session ID Next free session ID. + */ +uint16 Do_R15_Bulk_GenerateBulkSessionID(Communication_t *Communication_p); +#endif //#ifdef CFG_ENABLE_LOADER_TYPE + +#ifdef __cplusplus +extern "C" +{ +#endif // #ifdef __cplusplus + /** + * Opens Bulk session. + * + * @param [in] Communication_p Communication module context. + * @param [in] SessionId Session ID. + * @param [in] Mode Type of operation(Read or Write). + * (send or receive) over the bulk protocol. + * + * @return Vector ID Vector ID of the newly opened session. + * @retval BULK_ERROR If the session can not be opened. + */ + LCM_API uint32 Do_R15_Bulk_OpenSession(const Communication_t *const Communication_p, const uint16 SessionId, const TL_SessionMode_t Mode); + + /** + * Creates Bulk Vector. + * + * @param [in] Communication_p Communication module context. + * @param [in] BulkVector Index of Bulk Vector. + * @param [in] Length Data Length in bytes. + * @param [in] BuffSize Requested size of each Buffer. + * @param [in] CreatedBulkVector_p Already created bulk vector which + * need to be updated with correct + * information. + * + * @return Vector ID The ID of the Vector that has been created. + * @retval BULK_ERROR If creation of vector failed. + */ + LCM_API TL_BulkVectorList_t *Do_R15_Bulk_CreateVector(const Communication_t *const Communication_p, const uint32 BulkVector, uint32 Length, const uint32 BuffSize, TL_BulkVectorList_t *CreatedBulkVector_p); + + /** + * Frees Bulk Vector. + * + * @param [in] Communication_p Communication module context. + * @param [in] BulkVector_p Pointer to the Bulk Vector. + * @param [in] ReqReleaseBuffer Defines if complete buffers with metadata will + * be released or only only the metadata will be cleared. + * + * @retval E_SUCCESS After successful execution. + * @retval BULK_ERROR Error while destroying vector. + */ + LCM_API uint32 Do_R15_Bulk_DestroyVector(const Communication_t *const Communication_p, TL_BulkVectorList_t *BulkVector_p, boolean ReqReleaseBuffer); + + /** + * Start specified bulk session. + * + * @param [in] Communication_p Communication module context. + * @param [in] BulkVector_p Pointer to the Bulk Vector. + * @param [in] Offset Sets the offset from where data + * read/write should be performed. + * + * @retval E_INVALID_BULK_MODE Invalid bulk mode. + * @retval E_FAILED_TO_START_BULK_SESSION Either the session is + * invalid or the BulkVector is invalid. + * @retval E_SUCCESS After successful execution. + */ + LCM_API ErrorCode_e Do_R15_Bulk_StartSession(Communication_t *Communication_p, TL_BulkVectorList_t *BulkVector_p, const uint64 Offset); + + /** + * Get status of bulk transfer. + * + * @param [in] BulkVector_p Pointer to the Bulk Vector. + * + * @retval BULK_SESSION_IDLE Idle state of bulk protocol. + * @retval BULK_SESSION_OPEN Opened bulk protocol and ready for + * transmitting. + * @retval BULK_SESSION_PROCESSING Processing bulk transfer. + * @retval BULK_SESSION_FINISHED Bulk transfer finished. + */ + LCM_API TL_BulkSessionState_t Do_R15_Bulk_GetStatusSession(const TL_BulkVectorList_t *BulkVector_p); + + /** + * Close specified Bulk session. + * + * @param [in] Communication_p Communication module context. + * @param [in] BulkVector_p Pointer to the Bulk Vector. + * for the session you want to close. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_CLOSE_BULK_SESSION If the BulkVector is not valid. + */ + LCM_API ErrorCode_e Do_R15_Bulk_CloseSession(Communication_t *Communication_p, TL_BulkVectorList_t *BulkVector_p); + +#ifndef CFG_ENABLE_LOADER_TYPE + /** + * Sets pointers to callback functions regarding the bulk transfer. + * + * @param [in] Communication_p Communication module context. + * @param [in] BulkCommandCallback_p Pointer to the callback function + for handling a received command. + * @param [in] BulkDataCallback_p Pointer to the callback function + for handling a received data. + * @param [in] EndOfDump_p Pointer to the callback function + for handling a finished bulk transfer. + */ + LCM_API void Do_R15_Bulk_SetCallbacks(Communication_t *Communication_p, void *BulkCommandCallback_p, void *BulkDataCallback_p, void *EndOfDump_p); +#endif + +#ifdef __cplusplus +}; +#endif // #ifdef __cplusplus + +/** @} */ +/** @} */ +/** @} */ +#endif /* _R_BULK_PROTOCOL_H_*/ diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h new file mode 100644 index 0000000..dce0711 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_command_protocol.h @@ -0,0 +1,94 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _R_COMMAND_PROTOCOL_H_ +#define _R_COMMAND_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup command_protocol Command Protocol + * Functionalities for handling command protocol. Receiving/Sending + * commands with command protocol. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_command_protocol.h" +#include "t_r15_network_layer.h" +#include "error_codes.h" +#include "t_communication_service.h" + +#if (defined(WIN32) || defined(__CYGWIN__)) + +#ifdef LCM_EXPORTS +#define LCM_API __declspec(dllexport) // export DLL information +#else //LCM_EXPORTS +#define LCM_API __declspec(dllimport) // import DLL information +#endif // LCM_EXPORTS + +#elif defined(__linux__) + +#ifdef LCM_EXPORTS +#define LCM_API __attribute__((visibility("default"))) +#else //LCM_EXPORTS +#define LCM_API +#endif // LCM_EXPORTS + +#elif defined(CFG_ENABLE_LOADER_TYPE) + +#define LCM_API + +#endif // WIN32 + +/*********************************************************************** + * Declaration of functions + **********************************************************************/ + +#ifdef __cplusplus +extern "C" +{ +#endif // #ifdef __cplusplus + /** + * Reset the Session counters. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + */ + LCM_API ErrorCode_e Do_R15_Command_ResetSessionCounters(const Communication_t *const Communication_p); + + /** + * Sends command packet with command protocol. + * + * @param [in] Communication_p Communication module context. + * @param [in] CmdData_p Pointer to the command data. + * + * @retval E_SUCCESS After successful execution. + * @retval E_INVALID_INPUT_PARAMETERS If CmdData_p is NULL. + */ + LCM_API ErrorCode_e Do_R15_Command_Send(Communication_t *Communication_p, CommandData_t *CmdData_p); +#ifdef __cplusplus +}; +#endif // #ifdef __cplusplus + +/** + * Decode received command. + * + * @param [in] Communication_p Communication module context. + * @param [in] Packet_p Pointer to the received buffer. + * + * @retval E_SUCCESS After successful execution. + * @retval E_INVALID_INPUT_PARAMETERS if Packet_p is NULL. + */ +ErrorCode_e R15_Command_Process(Communication_t *Communication_p, PacketMeta_t *Packet_p); + +/** @} */ +/** @} */ +/** @} */ +#endif /* _R_COMMAND_PROTOCOL_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 new file mode 100644 index 0000000..2dac437 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_protocol.h @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _INCLUSION_GUARD_R_PROTROM_PROTOCOL_H_ +#define _INCLUSION_GUARD_R_PROTROM_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup protrom_protocol PROTROM protocol + * Functionalities for handling PROTROM commands. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_protrom_protocol.h" +#include "error_codes.h" +#include "t_communication_service.h" +#include "t_r15_network_layer.h" + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * Decode received command, and execute. + * + * @param [in] Communication_p Communication module context. + * @param [in] Packet_p Pointer to the received buffer. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e Protrom_Process(const Communication_t *const Communication_p, Protrom_Packet_t *Packet_p); + +/** @} */ +/** @} */ +/** @} */ +#endif //_INCLUSION_GUARD_R_PROTROM_PROTOCOL_H_ 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 new file mode 100644 index 0000000..ad47f6e --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_protrom_transport.h @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_R_PROTROM_TRANSPORT_LAYER_H +#define INCLUSION_GUARD_R_PROTROM_TRANSPORT_LAYER_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup ldr_protrom_transport_layer PROTROM Transport Layer + * PROTROM functionalities for sending PROTROM packets and + * polling receiver and transmiter. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_protrom_transport.h" +#include "t_communication_service.h" +#include "error_codes.h" + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * Handles all registered TL processes for PROTROM protocol family. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e Protrom_Transport_Poll(Communication_t *Communication_p); + +/** + * Function for sending packet in PROTROM protocol family. + * + * @param [in] Communication_p Communication module context. + * @param [in] InputDataIn_p Pointer to the input data. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication + * buffer. + */ +ErrorCode_e Protrom_Transport_Send(Communication_t *Communication_p, void *InputDataIn_p); + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_R_PROTROM_TRANSPORT_LAYER_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 new file mode 100644 index 0000000..904eb8b --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_r15_transport_layer.h @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _INCLUSION_GUARD_R_R15_TRANSPORT_LAYER_H_ +#define _INCLUSION_GUARD_R_R15_TRANSPORT_LAYER_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup ldr_r15_transport_layer R15 Transport layer + * R15 functionalities for sending R15 packets and + * polling receiver and transmiter. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_r15_transport_layer.h" +#include "t_communication_service.h" +#include "error_codes.h" + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * Initializes the transport layer for R15 protocol family. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_INIT_TL Unsuccessful initialization. + * @retval E_ALLOCATE_FAILED Failed to allocate memory space. + */ +ErrorCode_e R15_Transport_Initialize(const Communication_t *const Communication_p); + +/** + * Shut Down the transport layer for R15 protocol family. + * + * @param [in] Communication_p Communication module context. + + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e R15_Transport_Shutdown(const Communication_t *const Communication_p); + +/** + * Handles all registered TL processes for R15 protocol family. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + */ +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. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication + * buffer. + */ +ErrorCode_e R15_Transport_Send(Communication_t *Communication_p, void *InputDataIn_p); + +/** + * Function for setting the timeouts in the R15 protocol family. + * + * @param [in] Communication_p Communication module context. + * @param [in] TimeoutData_p Pointer to the input data with all timeouts. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e R15_SetProtocolTimeouts(Communication_t *Communication_p, void *TimeoutData_p); + +/** + * Function for getting the timeouts in the R15 protocol family. + * + * @param [in] Communication_p Communication module context. + * @param [out] TimeoutData_p Return all defined timeouts. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e R15_GetProtocolTimeouts(Communication_t *Communication_p, void *TimeoutData_p); + + +/** @} */ +/** @} */ +/** @} */ +#endif // _INCLUSION_GUARD_R_R15_TRANSPORT_LAYER_H_ + 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 new file mode 100644 index 0000000..f4e9055 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_protocol.h @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_R_Z_PROTOCOL_H +#define INCLUSION_GUARD_R_Z_PROTOCOL_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup z_family + * @{ + * @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 + * and executing. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_z_protocol.h" +#include "error_codes.h" +#include "t_communication_service.h" +#include "t_z_network.h" + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * Decode received command, and execute. + * + * @param [in] Communication_p Communication module context. + * @param [in] Packet_p Pointer to the received buffer. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e Z_Family_Process(const Communication_t *const Communication_p, const void *const Packet_p); + +/** @} */ +/** @} */ +/** @} */ +#endif //INCLUSION_GUARD_R_Z_PROTOCOL_H 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 new file mode 100644 index 0000000..6de0225 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_z_transport.h @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_R_Z_TRANSPORT_LAYER_H +#define INCLUSION_GUARD_R_Z_TRANSPORT_LAYER_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup z_family + * @{ + * @addtogroup ldr_z_transport_layer Z Transport layer + * TI functionalities for sending Z packets, Initialization and + * polling receiver and transmiter. + * + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_communication_service.h" +#include "error_codes.h" + +/******************************************************************************* + * Declaration of functions + ******************************************************************************/ + +/** + * Initializes the transport layer for Z protocol family. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_INIT_TL unsuccessful initialization. + * @retval E_ALLOCATE_FAILED failed to allocate memory space. + */ +ErrorCode_e Z_Transport_Initialize(const Communication_t *const Communication_p); + +/** + * Shut Down the transport layer for Z protocol family. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e Z_Transport_Shutdown(const Communication_t *const Communication_p); + +/** + * Handles all registered TL processes for Z protocol family. + * + * @param [in] Communication_p Communication module context. + * + * @retval E_SUCCESS After successful execution. + */ +ErrorCode_e Z_Transport_Poll(Communication_t *Communication_p); + +/** + * Function for sending packet in Z protocol family. + * + * @param [in] Communication_p Communication module context. + * @param [in] InputData_p Pointer to the input data. + * + * @retval E_SUCCESS After successful execution. + * @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication + * buffer. + */ +ErrorCode_e Z_Transport_Send(Communication_t *Communication_p, void *InputData_p); + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_R_Z_TRANSPORT_LAYER_H + diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_protocol.h new file mode 100644 index 0000000..23add7e --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_protocol.h @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_A2_PROTOCOL_H +#define INCLUSION_GUARD_T_A2_PROTOCOL_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup a2_family + * @{ + * @addtogroup a2_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_command_protocol.h" // only for Buffer_t + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +typedef enum { + A2_COMMAND, /**< Command type of the packet.*/ + A2_GENERAL_RESPONSE, /**< General response type of the packet.*/ + A2_CONTROL_MESSAGE, /**< Control message protocol packet. */ + A2_SPEEDFLASH_GR /**< Speedflash GR packet. */ +} A2_CommandType_t; + +/** + * Holds information for the command received from the transport layer. + */ +typedef struct A2_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. */ + uint8 DestAddress; /**< Destination address ACC = 0x01, APP = 0x02 */ + A2_CommandType_t Type; /**< Command type. */ + Buffer_t Payload; /**< Holds the data received with the command.*/ +} A2_CommandData_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_A2_PROTOCOL_H diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_speedflash.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_speedflash.h new file mode 100755 index 0000000..0795d7f --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_speedflash.h @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _INCLUSION_GUARD_T_A2_SPEEDFLASH_H_ +#define _INCLUSION_GUARD_T_A2_SPEEDFLASH_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup A2_family + * @{ + * + */ + +/******************************************************************************* + * Types, constants + ******************************************************************************/ +#define A2_SPEEDFLASH_REQ_SIZE 2 + +typedef enum { + A2_SPEEDFLASH_START, + A2_SPEEDFLASH_ACTIVE, + A2_SPEEDFLASH_INACTIVE +} A2_SpeedflashState_t; + +typedef enum { + A2_SPEEDFLASH_READ_REQ, + A2_SPEEDFLASH_WAIT_READ_REQ, + A2_SPEEDFLASH_WRITE_BLOCK, + A2_SPEEDFLASH_WAIT_WRITE_BLOCK +} A2_SpeedflashInboundState_t; + +/** + * A2 speedflash context. + * Context structures for A2 speedflash protocol. + */ +typedef struct { + A2_SpeedflashState_t State; + boolean LastBlock; + void *Outbound_p; + uint32 OutboundSize; + uint8 Scratch[A2_SPEEDFLASH_REQ_SIZE]; + A2_SpeedflashInboundState_t InboundState; +} A2_SpeedflashContext_t; + + +/** @} */ +/** @} */ +#endif // _INCLUSION_GUARD_T_A2_SPEEDFLASH_H_ + diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_transport.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_transport.h new file mode 100644 index 0000000..eb18598 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_a2_transport.h @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_A2_TRANSPORT_H +#define INCLUSION_GUARD_T_A2_TRANSPORT_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup a2_family + * @{ + * @addtogroup ldr_transport_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "t_a2_network.h" + +/******************************************************************************* + * Types, constants and external variables + ******************************************************************************/ +/** Callback function type for the A2 protocol handler */ +typedef ErrorCode_e(* A2_Callback_fn)(void *Param_p, uint8 PDU, int PayloadLength, void *Payload_p, Communication_t *Communication_p); + +/** Structure for transfer input parameters in "loader protocols" protocol family */ +typedef struct { + A2_Header_t *Header_p; /**< Pointer to A2 header data. */ + void *Payload_p; /**< Pointer to payload data.*/ + uint32 Time; /**< Used time for retransmission.*/ + HandleFunction_t TimerCallBackFn_p; /**< Timer callback function for + retransmission.*/ +} A2_SendData_LP_t; + +/** A2 Transport context */ +typedef struct { + A2_Callback_fn Callback; +} A2_TransportContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_A2_TRANSPORT_H + 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 new file mode 100644 index 0000000..fabc1a4 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_bulk_protocol.h @@ -0,0 +1,155 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_BULK_PROTOCOL_H_ +#define _T_BULK_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup bulk_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "t_r15_network_layer.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** Maximum bulk processes used in transport layer. */ +#define MAX_BULK_TL_PROCESSES 16 + +/** Mask for selecting the TYPE bits in type/flags field */ +#define MASK_BULK_COMMAND_SELECT (0x07) + +/** Defined bulk error in 32 bits format. */ +#define BULK_ERROR 0xffffffff +/** Defined bulk error in 64 bits format. */ +#define BULK_ERROR_64 0xffffffffffffffff + +/** Defined Callback functions used for bulk transfer in the LCM on PC side. */ +typedef void (*BulkCommandReqCallback_t)(void *Object_p, uint16 *Session_p, uint32 *ChunkSize_p, uint64 *Offset_p, uint32 *Length_p, boolean ACK_Read); +typedef void(*BulkDataReqCallback_t)(void *Object_p, uint16 *Session_p, uint32 *ChunkSize_p, uint64 *Offset_p, uint32 *Length_p, uint64 *TotalLength_p, uint32 *TransferedLength_p); +typedef void(*BulkDataEndOfDump_t)(void *Object_p); + + +/** Defined bulk commands. */ +typedef enum { + CMD_BULK_STATUS = 0x00, /**< Status packet type command. */ + CMD_BULK_READ = 0x01, /**< Read packet type command. */ + CMD_BULK_DATA = 0x02, /**< Data packet type command. */ + CMD_BULK_WRITE = 0x03 /**< Write packet type command. */ +} TL_BulkCmmands_t; + +/** Defined bulk session ID status. */ +typedef enum { + BULK_SESSION_INVALID = 0x00, /**< Received packet with invalid session ID.*/ + BULK_SESSION_NEW = 0x01, /**< Received packet with new session ID.*/ + BULK_SESSION_CURRENT = 0x02 /**< Received packet with current session ID.*/ +} TL_BulkSessionID_Status_t; + +/** States of bulk protocol. */ +TYPEDEF_ENUM { + BULK_IDLE_STATE = 0, /**< Idle state. */ + SEND_READ_REQUEST = 1, /**< Send read request command to PC. */ + WAIT_CHUNKS = 2, /**< Wait to receive all expected chunks. */ + SEND_BULK_ACK = 3, /**< Send bulk acknowledge to PC. */ + WAIT_BULK_ACK_TIMEOUT = 4, /**< Wait timeout for confirmation of bulk + ack command. */ + SEND_WRITE_REQUEST = 5, /**< Send write request command. */ + WAIT_READ_REQUEST = 6, /**< Wait read request from PC. */ + SENDING_CHUNKS = 7, /**< Send chunks to PC. */ + WAIT_BULK_ACK = 8, /**< Wait bulk acknowledge to PC. */ + WRITE_BULK_FINISH = 9, /**< Bulk acknowledge has been received, + finish the write bulk process. */ + WAIT_WRITE_REQUEST = 10 /**< Wait bulk request command. */ +} ENUM8(TL_BulkProtocolState_t); + +/** Defined bulk process states. */ +TYPEDEF_ENUM { + BULK_SESSION_IDLE = 0x00, /**< Bulk transfer is closed and ready + 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. */ +} ENUM8(TL_BulkSessionState_t); + +/** Bulk session Mode. */ +typedef enum { + BULK_RECEIVE = 1, /**< Receiving Mode. */ + BULK_SEND = 2, /**< Transmitting Mode. */ + BULK_RS = 3, /**< Receiving and transmitting Mode. */ +} TL_SessionMode_t; + +/** + * Status of received chunks in the current session. + */ +typedef enum { + /**< Chunks are being received in order in current session. */ + VECTOR_NOT_COMPLETE = 0, + /**< All chunks for the current session have been received. */ + VECTOR_COMPLETE = 1, + /**< Missing chunk(s) in the current session. */ + VECTOR_MISSING_CHUNK = 2, +} TL_BulkVectorStatus_t; + +/** + * Bulk Vector Entry parameters + */ +typedef struct { + PacketMeta_t *Buffer_p; /**< Pointer to reserved buffer meta info. */ + uint8 *Payload_p; /**< Pointer to payload data in reserved + buffer. */ + uint8 *Hash_p; /**< Pointer to calculated payload hash. */ +} TL_BulkVectorEntry_t; + +/** + * This type defines Bulk Vector parameters + */ +typedef struct { + /**< Bulk session status. */ + TL_BulkSessionState_t Status; + /**< Requested bulk process(Read or Write). */ + TL_SessionMode_t Mode; + /**< State of bulk protocol state machine. */ + TL_BulkProtocolState_t State; + /**< Current bulk session ID. */ + uint16 SessionId; + /**< Length of the file transfered with bulk transfer. */ + uint64 TotalLength; + /**< Length of payload data transfered with bulk transfer. */ + uint32 Length; + /**< Number of used buffers for bulk transfer. */ + uint32 Buffers; + /**< requested size of payload. */ + uint32 ChunkSize; + /**< Offset in the cuurent opened file.*/ + uint64 Offset; + /**< Length of payload data transfered with bulk transfer. */ + uint32 TransferedLength; + /**< Callback function pointer for bulk command handling.*/ + void *BulkCommandCallback_p; + /**< Callback function pointer for bulk data command handling.*/ + void *BulkDataCallback_p; + /**< Array with information for used buffers. */ + TL_BulkVectorEntry_t Entries[MAX_BULK_TL_PROCESSES]; +} TL_BulkVectorList_t; + +/** Structure for current bulk transfer handling. */ +typedef struct { + uint32 TimerKey; /**< Timer Id for current used timer. */ + TL_BulkVectorList_t *BulkVector_p; /**< Current used bulk vector for bulk + transfer.*/ +} BulkHandle_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*_T_BULK_PROTOCOL_H_*/ 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 new file mode 100644 index 0000000..2ca51c6 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_command_protocol.h @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_COMMAND_PROTOCOL_H_ +#define _T_COMMAND_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup command_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "error_codes.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** + * The command type. COMMAND and GENERAL_RESPONSE can be used to + * indicate what type of commands to send. The _ACK command types are + * used internally to provide end-to-end reliability. + */ +typedef enum { + COMMAND_TYPE, /**< Command type of the packet.*/ + COMMAND_ACK, /**< Acknwoledge type of the packet.*/ + GENERAL_RESPONSE, /**< General response type of the packet.*/ + GENERAL_RESPONSE_ACK /**< General response acknwoledge type of the packet.*/ +} CommandType_t; + + +/** + * Used for storing input and output Payload data. + */ +typedef struct Buffer_s { + uint32 Size; /**< Size of the buffer in bytes.*/ + uint8 *Data_p; /**< Data buffer. */ +} Buffer_t; + +/** + * Used for storing the status of the general response send by the + * command and for storing the data that should be send with the + * general response. + */ +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 */ +} Result_t; + +/** + * Holds information for the command received from the transport layer. + */ +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.*/ + CommandType_t Type; /**< Command type. */ + Buffer_t Payload; /**< Holds the data received with the command.*/ +} CommandData_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*_T_COMMAND_PROTOCOL_H_*/ 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 new file mode 100644 index 0000000..2bc544b --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_protocol.h @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_PROTROM_PROTOCOL_H +#define INCLUSION_GUARD_T_PROTROM_PROTOCOL_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup protrom_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_protrom_header.h" +#include "t_protrom_network.h" +#include "t_protrom_transport.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** Protrom Family context. */ +typedef struct { + Protrom_TransportContext_t Transport; + Protrom_NetworkContext_t Network; +} Protrom_FamilyContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_PROTROM_PROTOCOL_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 new file mode 100644 index 0000000..20eef29 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_protrom_transport.h @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_PROTROM_TRANSPORT_H +#define INCLUSION_GUARD_T_PROTROM_TRANSPORT_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup ldr_protrom_transport_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "t_protrom_network.h" + +/******************************************************************************* + * Types, constants and external variables + ******************************************************************************/ +/** Callback function type for the Protrom protocol handler. */ +typedef ErrorCode_e(* Protrom_Callback_fn)(void *Param_p, uint8 PDU, int PayloadLength, void *Payload_p, Communication_t *Communication_p); + +/** Structure for transfer input parameters in PROTROM protocol family */ +typedef struct { + Protrom_Header_t *Header_p; /**< Pointer to the PROTROM header structure.*/ + void *Payload_p; /**< Pointer to the payload data.*/ +} Protrom_SendData_LP_t; + +/** Protorm Transport context */ +typedef struct { + /**< Callback function pointer for PROTROM protocol handler. */ + Protrom_Callback_fn Callback; +} Protrom_TransportContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_PROTROM_TRANSPORT_H + 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 new file mode 100644 index 0000000..7778607 --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_r15_transport_layer.h @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _INCLUSION_GUARD_T_R15_TRANSPORT_LAYER_H_ +#define _INCLUSION_GUARD_T_R15_TRANSPORT_LAYER_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup ldr_r15_transport_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "t_time_utilities.h" +#include "t_r15_network_layer.h" +#include "t_bulk_protocol.h" + +/******************************************************************************* + * Types, constants and external variables + ******************************************************************************/ + +/** Structure for transfer input parameters in R15 prototcol family. */ +typedef struct { + R15_Header_t *Header_p; /**< Pointer to R15 header data. */ + void *ExtendedHeader_p; /**< Pointer to Extended header data.*/ + void *Payload_p; /**< Pointer to payload data.*/ + uint32 Time; /**< Used tim for retransmission.*/ + HandleFunction_t TimerCallBackFn_p; /**< Timer call back function for + retransmission.*/ +} SendData_LP_t; + +/** R15 Transport context. */ +typedef struct { + /**< Session/State for Incoming packet. */ + uint16 SessionStateIn; + /**< Session/State for Outgoing packet. */ + uint16 SessionStateOut; + /**< Bulk Session counter. */ + uint16 BulkSessionCounter; + /**< Bulk Vector List. */ + TL_BulkVectorList_t BulkVectorList[MAX_BULK_TL_PROCESSES]; + /**< Bulk handle for the Current bulk transfer. */ + BulkHandle_t BulkHandle; + /**< Bulk vector for previous current bulk transfer. */ + TL_BulkVectorList_t PreviousBulkVector; + /**< Callback function pointer for bulk command handling.*/ + void *BulkCommandCallback_p; + /**< Callback function pointer for bulk data command handling.*/ + void *BulkDataCallback_p; + /**< Callback function pointer for handling end of bulk transfer.*/ + void *EndOfDump_p; + /**< Length of payload data transfered with bulk transfer. */ + uint32 Length; + /**< Offset in the cuurent opened file.*/ + uint64 Offset; + /**< requested size of payload. */ + uint32 ChunkSize; + /**< Current bulk session ID. */ + uint16 Session; +} R15_TransportContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // _INCLUSION_GUARD_T_R15_TRANSPORT_LAYER_H_ + diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_z_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_z_protocol.h new file mode 100644 index 0000000..ea4e07a --- /dev/null +++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/t_z_protocol.h @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_Z_PROTOCOL_H +#define INCLUSION_GUARD_T_Z_PROTOCOL_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup z_family + * @{ + * @addtogroup z_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_z_network.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** Z protocol family context. */ +typedef struct { + Z_NetworkContext_t Network; /**< Network context.*/ +} Z_FamilyContext_t; + + +/** Structure for transfer input parameters in Z protocol family */ +typedef struct { + uint8 *Data_p; /**< Pointer to the TI data.*/ + uint8 Size; /**< Size of the data for transfer. */ +} Z_SendingContent_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_Z_PROTOCOL_H |