amiro-blt / Target / Source / net.h @ 1446566f
History | View | Annotate | Download (3.401 KB)
1 | 69661903 | Thomas Schöpping | /************************************************************************************//** |
---|---|---|---|
2 | * \file Source\net.h
|
||
3 | * \brief Bootloader TCP/IP network communication interface header file.
|
||
4 | * \ingroup Core
|
||
5 | * \internal
|
||
6 | *----------------------------------------------------------------------------------------
|
||
7 | * C O P Y R I G H T
|
||
8 | *----------------------------------------------------------------------------------------
|
||
9 | * Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
|
||
10 | *
|
||
11 | *----------------------------------------------------------------------------------------
|
||
12 | * L I C E N S E
|
||
13 | *----------------------------------------------------------------------------------------
|
||
14 | * This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
|
||
15 | * modify it under the terms of the GNU General Public License as published by the Free
|
||
16 | * Software Foundation, either version 3 of the License, or (at your option) any later
|
||
17 | * version.
|
||
18 | *
|
||
19 | * OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||
20 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||
21 | * PURPOSE. See the GNU General Public License for more details.
|
||
22 | *
|
||
23 | * You should have received a copy of the GNU General Public License along with OpenBLT.
|
||
24 | * If not, see <http://www.gnu.org/licenses/>.
|
||
25 | *
|
||
26 | * A special exception to the GPL is included to allow you to distribute a combined work
|
||
27 | * that includes OpenBLT without being obliged to provide the source code for any
|
||
28 | * proprietary components. The exception text is included at the bottom of the license
|
||
29 | * file <license.html>.
|
||
30 | *
|
||
31 | * \endinternal
|
||
32 | ****************************************************************************************/
|
||
33 | #ifndef NET_H
|
||
34 | #define NET_H
|
||
35 | |||
36 | #if (BOOT_COM_NET_ENABLE > 0) |
||
37 | /****************************************************************************************
|
||
38 | * Macro definitions
|
||
39 | ****************************************************************************************/
|
||
40 | #ifndef UIP_APPCALL
|
||
41 | #define UIP_APPCALL NetApp
|
||
42 | #endif /* UIP_APPCALL */ |
||
43 | |||
44 | |||
45 | /****************************************************************************************
|
||
46 | * Type definitions
|
||
47 | ****************************************************************************************/
|
||
48 | /** \brief Define the uip_tcp_appstate_t datatype. This is the state of our tcp/ip
|
||
49 | * application, and the memory required for this state is allocated together
|
||
50 | * with each TCP connection. One application state for each TCP connection.
|
||
51 | */
|
||
52 | typedef struct net_state |
||
53 | { |
||
54 | blt_int32u dto_counter; |
||
55 | blt_int8u dto_data[BOOT_COM_NET_TX_MAX_DATA + 4]; /* +4 for counter overhead */ |
||
56 | blt_int16u dto_len; |
||
57 | } uip_tcp_appstate_t; |
||
58 | |||
59 | |||
60 | /****************************************************************************************
|
||
61 | * Function prototypes
|
||
62 | ****************************************************************************************/
|
||
63 | void NetInit(void); |
||
64 | void NetApp(void); |
||
65 | void NetTransmitPacket(blt_int8u *data, blt_int8u len);
|
||
66 | blt_bool NetReceivePacket(blt_int8u *data); |
||
67 | #else /* BOOT_COM_NET_ENABLE > 0 */ |
||
68 | |||
69 | typedef struct net_state |
||
70 | { |
||
71 | blt_int8u unused; |
||
72 | } uip_tcp_appstate_t; |
||
73 | |||
74 | #define UIP_APPCALL();
|
||
75 | |||
76 | #endif /* BOOT_COM_NET_ENABLE > 0 */ |
||
77 | |||
78 | |||
79 | #endif /* NET_H */ |
||
80 | /*********************************** end of net.h **************************************/
|