diff options
Diffstat (limited to 'lcmodule/source/cnh1605205_ldr_network_layer/include/t_z_network.h')
-rw-r--r-- | lcmodule/source/cnh1605205_ldr_network_layer/include/t_z_network.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_z_network.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_z_network.h new file mode 100644 index 0000000..4135873 --- /dev/null +++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_z_network.h @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef T_Z_NETWORK_H_ +#define T_Z_NETWORK_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup z_family + * @{ + * @addtogroup ldr_z_network_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_communication_service.h" +#include "t_z_header.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** Defined state of the receiver */ +typedef enum { + Z_RECEIVE_HEADER, /**< State for receiving Header.*/ + Z_RECEIVE_PAYLOAD, /**< State for receiving Payload.*/ + Z_RECEIVE_ERROR, /**< State for error handling.*/ + Z_RECEIVE_IDLE /**< Receiver idle state.*/ +} Z_InboundState_t; + +/** Defined state of the transmitter */ +typedef enum { + Z_SEND_IDLE, /**< Transmiter idle state.*/ + Z_SEND_PACKET, /**< Transmiter send packet. */ + Z_SENDING_PACKET /**< Transmiter is in process sending packet.*/ +} Z_OutboundState_t; + +/** Structure for handling incoming Z packets.*/ +typedef struct { + /**< State of the state machine for handling incoming Z packets. */ + Z_InboundState_t State; + /**< Number of requested data for receiving from communication device. */ + uint32 ReqData; + /**< Number of receivied data from communication device. */ + uint32 RecData; + /**< Temporary pointer to buffer for handling received data.*/ + uint8 *Target_p; + /** Number of packets before receiver is stoped. */ + uint8 PacketsBeforeReceiverStop; + /** Indicator for stopping the receiver. */ + boolean StopTransfer; + /**< Temporary buffer for receiving data. */ + uint8 Scratch[Z_HEADER_LENGTH]; +} Z_Inbound_t; + +/** Structure for handling outgoing Z packets.*/ +typedef struct { + /**< State of the state machine for handling outgoing Z packets. */ + Z_OutboundState_t State; + /**< Boolean value for controling re-entry in transmiter fucntion. */ + boolean InLoad; +} Z_Outbound_t; + + +/** Z Network context */ +typedef struct { + /**< Structure for handling incoming Z packets.*/ + Z_Inbound_t Inbound; + /**< Structure for handling outgoing Z packets.*/ + Z_Outbound_t Outbound; +} Z_NetworkContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*T_Z_LAYER_H_*/ |