📄 mn_callback.lst
字号:
C51 COMPILER V8.02 MN_CALLBACK 08/27/2007 11:39:17 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE MN_CALLBACK
OBJECT MODULE PLACED IN mn_callback.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE mn_callback.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND
line level source
1 //-----------------------------------------------------------------------------
2 // mn_callback.c
3 //-----------------------------------------------------------------------------
4 // Copyright 2006 Silicon Laboratories, Inc.
5 //
6 // Description:
7 // This file callback functions from the TCP/IP stack.
8 // These functions may be edited by the user.
9 //
10 // Callback functions include:
11 // 1. callback_app_process_packet
12 // 2. callback_app_server_idle
13 // 3. callback_app_recv_idle
14 // 4. callback_app_server_process_packet
15 // 5. callback_socket_closed (only when TCP is included in the stack)
16 // 6. callback_socket_empty (only when TCP is included in the stack)
17 //
18 // Generated by TCP/IP Configuration Wizard Version 3.1.
19 //
20
21 #include "mn_userconst.h" // TCP/IP Library Constants
22 #include "mn_stackconst.h" // TCP/IP Library Constants
23 #include "mn_errs.h" // Library Error Codes
24 #include "mn_defs.h" // Library Type definitions
25 #include "mn_funcs.h" // Library Function Prototypes
26 #include <c8051F120.h> // Device-specific SFR Definitions
27
28
29 //------------------------------------------------------------------------------
30 // Callback Functions
31 //------------------------------------------------------------------------------
32
33 //------------------------------------------------------------------------------
34 // callback_app_process_packet
35 //------------------------------------------------------------------------------
36 //
37 // This function is called after any TCP or UDP packet is received.
38 //
39 // Parameters:
40 // socket_ptr - pointer to the socket that contains the data.
41 //// Return Values:
42 // NEED_IGNORE_PACKET <-94> - The library will not ACK the TCP packet.
43 //
44 // Any other value - The library will ACK the TCP packet.
45 //
46 // Note: The return value is ignored if a UDP packet was received.
47 //
48 SCHAR callback_app_process_packet(PSOCKET_INFO socket_ptr)
49 { //while(1);
50 1 socket_ptr = socket_ptr; // This statment prevents compiler warning.
51 1 return (1);
52 1 }
53
54 //------------------------------------------------------------------------------
55 // callback_app_server_idle
C51 COMPILER V8.02 MN_CALLBACK 08/27/2007 11:39:17 PAGE 2
56 //------------------------------------------------------------------------------
57 //
58 // This function is called periodically and when both the receive and transmit
59 // buffers are empty. This function should only be used for low priority tasks.
60 // Any high priority tasks should be placed in an interrupt service routine.
61 //
62 // Parameters:
63 // psocket_ptr - pointer to a socket that can be filled with data.
64 //
65 // Return Values:
66 // NEED_TO_SEND <-114> - The library will immediately send the data stored in
67 // the socket.
68 //
69 // NEED_TO_EXIT <-102> - The mn_server() routine will exit immediately, returning
70 // control to the main() routine.
71 //
72 // FALSE <0> - The mn_server() routine will continue to function normally.
73 //
74 // Note: The socket pointer may be re-assigned to a different socket.
75 // (e.g. *psocket_ptr = new_socket_ptr; )
76 //
77 SCHAR callback_app_server_idle(PSOCKET_INFO *psocket_ptr)
78 {
79 1 while(1);
80 1 // Put your code here.
81 1
82 1 // If the link goes invalid, exit mn_server().
83 1 if(link_lost)
84 1 return (NEED_TO_EXIT);
85 1
86 1 psocket_ptr = psocket_ptr; // This statment prevents compiler warning.
87 1 return (0);
88 1 }
89
90 //------------------------------------------------------------------------------
91 // callback_app_recv_idle
92 //------------------------------------------------------------------------------
93 //
94 // This function is called repeatedly while the server is waiting for data.
95 // This function should only be used for low priority tasks. Any high priority
96 // tasks should be placed in an interrupt service routine.
97 //
98 // Parameters:
99 // none
100 //
101 // Return Values:
102 // NEED_TO_EXIT <-102> - The server will immedialtely stop waiting for data and
103 // will advance to the next state.
104 //
105 // Any other value - The server will continue to wait for data.
106 //
107 SCHAR callback_app_recv_idle(void)
108 {
109 1 // while(1);
110 1 // Put your code here.
111 1 return (0);
112 1 }
113
114 //------------------------------------------------------------------------------
115 // callback_app_server_process_packet
116 //------------------------------------------------------------------------------
117 //
C51 COMPILER V8.02 MN_CALLBACK 08/27/2007 11:39:17 PAGE 3
118 // This function is called after any TCP or UDP packet that is not HTTP or FTP
119 // received. HTTP and FTP packets are automatically handled by the server.
120 //
121 // Parameters:
122 // socket_ptr - pointer to the socket that contains the data.
123 //
124 // Return Values:
125 // NEED_TO_EXIT <-102> - The mn_server() routine will exit immediately, returning
126 // control to the main() routine.
127 //
128 // Any other value - The server will discard the packet.
129 //
130 SCHAR callback_app_server_process_packet(PSOCKET_INFO socket_ptr)
131 {
132 1 while(1);
133 1 socket_ptr = socket_ptr; // This statment prevents compiler warning.
134 1
135 1 return (0);
136 1 }
137
138
139 //------------------------------------------------------------------------------
140 // callback_socket_closed
141 //------------------------------------------------------------------------------
142 //
143 // This function is called after a TCP socket is closed.
144 //
145 // Parameters:
146 // socket_no - number of the socket that was closed.
147 //
148 // Return Values:
149 //
150 // N/A
151 //
152 void callback_socket_closed(SCHAR socket_no)
153 {
154 1
155 1 socket_no = socket_no;
156 1 }
157
158 //------------------------------------------------------------------------------
159 // callback_socket_empty
160 //------------------------------------------------------------------------------
161 //
162 // This function is called after all data in a TCP socket is sent.
163 //
164 // Parameters:
165 // socket_ptr - pointer to the socket that is empty.
166 //
167 // Return Values:
168 //
169 // N/A
170 //
171 void callback_socket_empty(PSOCKET_INFO socket_ptr)
172 {
173 1 while(1);
174 1 socket_ptr = socket_ptr;
175 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 35 ----
C51 COMPILER V8.02 MN_CALLBACK 08/27/2007 11:39:17 PAGE 4
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 6
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -