blob: c8450e53fe5006cffc81dba0247d6cc24d4dc16f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/*******************************************************************************
* Copyright (C) ST-Ericsson SA 2011
* License terms: 3-clause BSD license
******************************************************************************/
#ifndef R_Z_NETWORK_H_
#define R_Z_NETWORK_H_
/**
* @addtogroup ldr_communication_serv
* @{
* @addtogroup z_family
* @{
* @addtogroup ldr_z_network_layer Z network layer
* Z network layer support receiving and sending bytes from
* Z protocol.
*
* @{
*/
/*******************************************************************************
* Includes
******************************************************************************/
#include "error_codes.h"
#include "t_basicdefinitions.h"
#include "t_z_network.h"
#include "t_communication_service.h"
#include "t_z_protocol.h"
/*******************************************************************************
* Declaration of functions
******************************************************************************/
/**
* Initializes the Z family network layer.
*
* @param [in] Communication_p Communication module context.
*
* @retval E_SUCCESS After successful execution.
* @retval E_FAILED_TO_INIT_COM_DEVICE Failed to initialize the communication
* device.
*/
ErrorCode_e Z_Network_Initialize(Communication_t *Communication_p);
/**
* Shut down the Z family network layer.
*
* @param [in] Communication_p Communication module context.
*
* @retval E_SUCCESS After successful execution.
*/
ErrorCode_e Z_Network_Shutdown(const Communication_t *const Communication_p);
/**
* Handler for received packets in Z protcol family.
*
* This callback function handles the received packets.
*
* @param [in] Data_p Pointer to the received data.
* @param [in] Length Length of the received data.
* @param [in] Param_p Extra parameters.
*
* @return none.
*/
void Z_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Param_p);
/**
* Handler function that is called after successful transmission of a packet.
*
* If new packet is ready for transmitting it starts
* the transmission of the packet.
*
* @param [in] Data_p Pointer to the data for transmitting.
* @param [in] Length Length of the received data.
* @param [in] Param_p Extra parameters.
*
* @return none.
*/
void Z_Network_WriteCallback(const void *Data_p, const uint32 Length, void *Param_p);
/**
* Handler for receiving new data in Z protcol family.
*
* This function checks if new data has been received.
*
* @param [in] Communication_p Communication module context.
*
* @return none.
*/
void Z_Network_ReceiverHandler(Communication_t *Communication_p);
/**
* Handler for sending new data in Z protcol family.
*
* This function checks if new data has been transmited.
*
* @param [in] Communication_p Communication module context.
* @param [in] SendingContent_p Pointer to the sending context.
*
* @return none.
*/
ErrorCode_e Z_Network_TransmiterHandler(Communication_t *Communication_p, Z_SendingContent_t *SendingContent_p);
/** @} */
/** @} */
/** @} */
#endif /*R_Z_NETWORK_H_*/
|