Commit c9ce1fd2a77a955b388a91291055ac268daa2d6d
modifs
Showing
20 changed files
with
1135 additions
and
954 deletions
Show diff stats
Network/Makefile
@@ -18,8 +18,12 @@ all: $(LIB) | @@ -18,8 +18,12 @@ all: $(LIB) | ||
18 | $(LIB): sender.o sniffer.o tcpserver.o | 18 | $(LIB): sender.o sniffer.o tcpserver.o |
19 | rm -f $@ | 19 | rm -f $@ |
20 | $(CLIBS) $(LDIR)$@ $^ | 20 | $(CLIBS) $(LDIR)$@ $^ |
21 | +<<<<<<< HEAD | ||
21 | ranlib $(LDIR)$@ | 22 | ranlib $(LDIR)$@ |
22 | rm -f *.o | 23 | rm -f *.o |
24 | +======= | ||
25 | + ranlib $(LDIR)$@ | ||
26 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
23 | 27 | ||
24 | 28 | ||
25 | tcpserver.o: tcpserver.c | 29 | tcpserver.o: tcpserver.c |
Network/sender.c
@@ -9,10 +9,18 @@ | @@ -9,10 +9,18 @@ | ||
9 | #include <errno.h> | 9 | #include <errno.h> |
10 | 10 | ||
11 | 11 | ||
12 | +<<<<<<< HEAD | ||
12 | int initializeSocketUDP(char* service) | 13 | int initializeSocketUDP(char* service) |
13 | { | 14 | { |
14 | int sock_id; | 15 | int sock_id; |
15 | struct addrinfo precisions, *resultat=NULL, *origine; // On stocke dans précisions nos besoins pour le socket, dans resultat l'adresse qui respectera les requêtes | 16 | struct addrinfo precisions, *resultat=NULL, *origine; // On stocke dans précisions nos besoins pour le socket, dans resultat l'adresse qui respectera les requêtes |
17 | +======= | ||
18 | + | ||
19 | +int initializeSocketUDP(char* service) | ||
20 | +{ | ||
21 | + int sock_id; | ||
22 | + struct addrinfo precisions, *resultat=NULL, *origine; // On stocke dans précisions nos besoins pour le socket, dans resultat l'adresse qui respectera les reqêtes | ||
23 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
16 | 24 | ||
17 | memset(&precisions, 0, sizeof precisions); | 25 | memset(&precisions, 0, sizeof precisions); |
18 | precisions.ai_family = AF_UNSPEC; | 26 | precisions.ai_family = AF_UNSPEC; |
@@ -69,10 +77,16 @@ int sendUDPBroadcast(char* message, int port) | @@ -69,10 +77,16 @@ int sendUDPBroadcast(char* message, int port) | ||
69 | int sock_id=initializeSocketUDP( tmp_str ); | 77 | int sock_id=initializeSocketUDP( tmp_str ); |
70 | 78 | ||
71 | printf("Initialize via Broadcast %d\n", sock_id); | 79 | printf("Initialize via Broadcast %d\n", sock_id); |
80 | +<<<<<<< HEAD | ||
72 | 81 | ||
73 | int status; | 82 | int status; |
74 | if((status=sendto(sock_id, message, sizeof(message), 0, (struct sockaddr*) &addrUDP, sizeof(addrUDP))) < 0) { fprintf(stderr, "Erreur sendto %d\n", status); return(-1);} | 83 | if((status=sendto(sock_id, message, sizeof(message), 0, (struct sockaddr*) &addrUDP, sizeof(addrUDP))) < 0) { fprintf(stderr, "Erreur sendto %d\n", status); return(-1);} |
75 | 84 | ||
85 | +======= | ||
86 | + | ||
87 | + if(sendto(sock_id, message, sizeof(message), 0, (struct sockaddr*) &addrUDP, sizeof(addrUDP)) < 0) { fprintf(stderr, "Erreur sendto\n"); return(-1);} | ||
88 | + | ||
89 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
76 | close(sock_id); | 90 | close(sock_id); |
77 | return 0; | 91 | return 0; |
78 | } | 92 | } |
@@ -91,15 +105,27 @@ int sendUDPUnicast(char* address, char* message, int port) | @@ -91,15 +105,27 @@ int sendUDPUnicast(char* address, char* message, int port) | ||
91 | sprintf(tmp_str, "%d", port); | 105 | sprintf(tmp_str, "%d", port); |
92 | int sock_id=initializeSocketUDP( tmp_str ); | 106 | int sock_id=initializeSocketUDP( tmp_str ); |
93 | printf("Initialize via Unicast %d\n", sock_id); | 107 | printf("Initialize via Unicast %d\n", sock_id); |
108 | +<<<<<<< HEAD | ||
94 | 109 | ||
95 | if(sendto(sock_id, message, sizeof(message), 0, (struct sockaddr*) &addrUDP, sizeof(addrUDP)) < 0 ) { fprintf(stderr, "Error sendto %d\n", errno); return(-1); } | 110 | if(sendto(sock_id, message, sizeof(message), 0, (struct sockaddr*) &addrUDP, sizeof(addrUDP)) < 0 ) { fprintf(stderr, "Error sendto %d\n", errno); return(-1); } |
96 | 111 | ||
112 | +======= | ||
113 | + | ||
114 | + if(sendto(sock_id, message, sizeof(message), 0, (struct sockaddr*) &addrUDP, sizeof(addrUDP)) < 0 ) { fprintf(stderr, "Error sendto\n"); return(-1); } | ||
115 | + | ||
116 | + close(sock_id); | ||
117 | + return 0; | ||
118 | +} | ||
119 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
97 | 120 | ||
98 | close(sock_id); | 121 | close(sock_id); |
99 | return 0; | 122 | return 0; |
100 | } | 123 | } |
101 | 124 | ||
125 | +<<<<<<< HEAD | ||
102 | 126 | ||
127 | +======= | ||
128 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
103 | /* | 129 | /* |
104 | 130 | ||
105 | int main(void) | 131 | int main(void) |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +#include <stdio.h> | ||
2 | +#include <stdlib.h> | ||
3 | +#include <pthread.h> | ||
4 | + | ||
5 | + | ||
6 | +int lanceThread(void(* fonction) (void *), void* arg, int size) | ||
7 | +{ | ||
8 | + pthread_t thr_id; | ||
9 | + | ||
10 | + if(pthread_create(&thr_id, NULL, fonction, arg)!=0) { fprintf(stderr, "Le thread n'a pas pu être créé.\n"); return -1; } | ||
11 | + | ||
12 | + pthread_detach(thr_id); | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | +} | ||
17 | + | ||
18 | +int main(void) | ||
19 | +{ | ||
20 | + | ||
21 | +} |
1 | -/* | ||
2 | -* | ||
3 | -@file socket.c | ||
4 | -@brief setting chip register for socket | ||
5 | - last update : 2008. Jan | ||
6 | -* | ||
7 | -*/ | ||
8 | - | ||
9 | -#include "ethernet.h" | ||
10 | -#include "w5100.h" | ||
11 | -#include "socket.h" | ||
12 | - | ||
13 | -#ifdef __DEF_IINCHIP_DBG__ | ||
14 | -#include <stdio.h> | ||
15 | -#endif | ||
16 | - | ||
17 | -static uint16 local_port; | ||
18 | - | ||
19 | -/** | ||
20 | -@brief This Socket function initialize the channel in perticular mode, and set the port and wait for W5100 done it. | ||
21 | -@return 1 for success else 0. | ||
22 | -*/ | ||
23 | -uint8 socket( | ||
24 | - SOCKET s, /**< for socket number */ | ||
25 | - uint8 protocol, /**< for socket protocol */ | ||
26 | - uint16 port, /**< the source port for the socket */ | ||
27 | - uint8 flag /**< the option for the socket */ | ||
28 | - ) | ||
29 | -{ | ||
30 | - uint8 ret; | ||
31 | -#ifdef __DEF_IINCHIP_DBG__ | ||
32 | - printf("socket()\r\n"); | ||
33 | -#endif | ||
34 | - if ((protocol == Sn_MR_TCP) || (protocol == Sn_MR_UDP) || (protocol == Sn_MR_IPRAW) || (protocol == Sn_MR_MACRAW) || (protocol == Sn_MR_PPPOE)) | ||
35 | - { | ||
36 | - close(s); | ||
37 | - IINCHIP_WRITE(Sn_MR(s),protocol | flag); | ||
38 | - if (port != 0) { | ||
39 | - IINCHIP_WRITE(Sn_PORT0(s),(uint8)((port & 0xff00) >> 8)); | ||
40 | - IINCHIP_WRITE((Sn_PORT0(s) + 1),(uint8)(port & 0x00ff)); | ||
41 | - } else { | ||
42 | - local_port++; // if don't set the source port, set local_port number. | ||
43 | - IINCHIP_WRITE(Sn_PORT0(s),(uint8)((local_port & 0xff00) >> 8)); | ||
44 | - IINCHIP_WRITE((Sn_PORT0(s) + 1),(uint8)(local_port & 0x00ff)); | ||
45 | - } | ||
46 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_OPEN); // run sockinit Sn_CR | ||
47 | - | ||
48 | - /* +20071122[chungs]:wait to process the command... */ | ||
49 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
50 | - ; | ||
51 | - /* ------- */ | ||
52 | - ret = 1; | ||
53 | - } | ||
54 | - else | ||
55 | - { | ||
56 | - ret = 0; | ||
57 | - } | ||
58 | -#ifdef __DEF_IINCHIP_DBG__ | ||
59 | - printf("Sn_SR = %.2x , Protocol = %.2x\r\n", IINCHIP_READ(Sn_SR(s)), IINCHIP_READ(Sn_MR(s))); | ||
60 | -#endif | ||
61 | - return ret; | ||
62 | -} | ||
63 | - | ||
64 | - | ||
65 | -/** | ||
66 | -@brief This function close the socket and parameter is "s" which represent the socket number | ||
67 | -*/ | ||
68 | -void close(SOCKET s) | ||
69 | -{ | ||
70 | -#ifdef __DEF_IINCHIP_DBG__ | ||
71 | - printf("close()\r\n"); | ||
72 | -#endif | ||
73 | - | ||
74 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_CLOSE); | ||
75 | - | ||
76 | - /* +20071122[chungs]:wait to process the command... */ | ||
77 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
78 | - ; | ||
79 | - /* ------- */ | ||
80 | - | ||
81 | - /* +2008.01 [hwkim]: clear interrupt */ | ||
82 | - #ifdef __DEF_IINCHIP_INT__ | ||
83 | - /* m2008.01 [bj] : all clear */ | ||
84 | - putISR(s, 0x00); | ||
85 | - #else | ||
86 | - /* m2008.01 [bj] : all clear */ | ||
87 | - IINCHIP_WRITE(Sn_IR(s), 0xFF); | ||
88 | - #endif | ||
89 | -} | ||
90 | - | ||
91 | - | ||
92 | -/** | ||
93 | -@brief This function established the connection for the channel in passive (server) mode. This function waits for the request from the peer. | ||
94 | -@return 1 for success else 0. | ||
95 | -*/ | ||
96 | -uint8 listen( | ||
97 | - SOCKET s /**< the socket number */ | ||
98 | - ) | ||
99 | -{ | ||
100 | - uint8 ret; | ||
101 | -#ifdef __DEF_IINCHIP_DBG__ | ||
102 | - printf("listen()\r\n"); | ||
103 | -#endif | ||
104 | - if (IINCHIP_READ(Sn_SR(s)) == SOCK_INIT) | ||
105 | - { | ||
106 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_LISTEN); | ||
107 | - /* +20071122[chungs]:wait to process the command... */ | ||
108 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
109 | - ; | ||
110 | - /* ------- */ | ||
111 | - ret = 1; | ||
112 | - } | ||
113 | - else | ||
114 | - { | ||
115 | - ret = 0; | ||
116 | -#ifdef __DEF_IINCHIP_DBG__ | ||
117 | - printf("Fail[invalid ip,port]\r\n"); | ||
118 | -#endif | ||
119 | - } | ||
120 | - return ret; | ||
121 | -} | ||
122 | - | ||
123 | - | ||
124 | -/** | ||
125 | -@brief This function established the connection for the channel in Active (client) mode. | ||
126 | - This function waits for the until the connection is established. | ||
127 | - | ||
128 | -@return 1 for success else 0. | ||
129 | -*/ | ||
130 | -uint8 connect(SOCKET s, uint8 * addr, uint16 port) | ||
131 | -{ | ||
132 | - uint8 ret; | ||
133 | -#ifdef __DEF_IINCHIP_DBG__ | ||
134 | - printf("connect()\r\n"); | ||
135 | -#endif | ||
136 | - if | ||
137 | - ( | ||
138 | - ((addr[0] == 0xFF) && (addr[1] == 0xFF) && (addr[2] == 0xFF) && (addr[3] == 0xFF)) || | ||
139 | - ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && (addr[3] == 0x00)) || | ||
140 | - (port == 0x00) | ||
141 | - ) | ||
142 | - { | ||
143 | - ret = 0; | ||
144 | -#ifdef __DEF_IINCHIP_DBG__ | ||
145 | - printf("Fail[invalid ip,port]\r\n"); | ||
146 | -#endif | ||
147 | - } | ||
148 | - else | ||
149 | - { | ||
150 | - ret = 1; | ||
151 | - // set destination IP | ||
152 | - IINCHIP_WRITE(Sn_DIPR0(s),addr[0]); | ||
153 | - IINCHIP_WRITE((Sn_DIPR0(s) + 1),addr[1]); | ||
154 | - IINCHIP_WRITE((Sn_DIPR0(s) + 2),addr[2]); | ||
155 | - IINCHIP_WRITE((Sn_DIPR0(s) + 3),addr[3]); | ||
156 | - IINCHIP_WRITE(Sn_DPORT0(s),(uint8)((port & 0xff00) >> 8)); | ||
157 | - IINCHIP_WRITE((Sn_DPORT0(s) + 1),(uint8)(port & 0x00ff)); | ||
158 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_CONNECT); | ||
159 | - /* m2008.01 [bj] : wait for completion */ | ||
160 | - while ( IINCHIP_READ(Sn_CR(s)) ) ; | ||
161 | - | ||
162 | - } | ||
163 | - | ||
164 | - return ret; | ||
165 | -} | ||
166 | - | ||
167 | - | ||
168 | - | ||
169 | -/** | ||
170 | -@brief This function used for disconnect the socket and parameter is "s" which represent the socket number | ||
171 | -@return 1 for success else 0. | ||
172 | -*/ | ||
173 | -void disconnect(SOCKET s) | ||
174 | -{ | ||
175 | -#ifdef __DEF_IINCHIP_DBG__ | ||
176 | - printf("disconnect()\r\n"); | ||
177 | -#endif | ||
178 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_DISCON); | ||
179 | - | ||
180 | - /* +20071122[chungs]:wait to process the command... */ | ||
181 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
182 | - ; | ||
183 | - /* ------- */ | ||
184 | -} | ||
185 | - | ||
186 | - | ||
187 | -/** | ||
188 | -@brief This function used to send the data in TCP mode | ||
189 | -@return 1 for success else 0. | ||
190 | -*/ | ||
191 | -uint16 send( | ||
192 | - SOCKET s, /**< the socket index */ | ||
193 | - const uint8 * buf, /**< a pointer to data */ | ||
194 | - uint16 len /**< the data size to be send */ | ||
195 | - ) | ||
196 | -{ | ||
197 | - uint8 status=0; | ||
198 | - uint16 ret=0; | ||
199 | - uint16 freesize=0; | ||
200 | -#ifdef __DEF_IINCHIP_DBG__ | ||
201 | - printf("send()\r\n"); | ||
202 | -#endif | ||
203 | - | ||
204 | - if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size. | ||
205 | - else ret = len; | ||
206 | - | ||
207 | - // if freebuf is available, start. | ||
208 | - do | ||
209 | - { | ||
210 | - freesize = getSn_TX_FSR(s); | ||
211 | - status = IINCHIP_READ(Sn_SR(s)); | ||
212 | - if ((status != SOCK_ESTABLISHED) && (status != SOCK_CLOSE_WAIT)) | ||
213 | - { | ||
214 | - ret = 0; | ||
215 | - break; | ||
216 | - } | ||
217 | -#ifdef __DEF_IINCHIP_DBG__ | ||
218 | - printf("socket %d freesize(%d) empty or error\r\n", s, freesize); | ||
219 | -#endif | ||
220 | - } while (freesize < ret); | ||
221 | - | ||
222 | - // copy data | ||
223 | - send_data_processing(s, (uint8 *)buf, ret); | ||
224 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_SEND); | ||
225 | - | ||
226 | - /* +20071122[chungs]:wait to process the command... */ | ||
227 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
228 | - ; | ||
229 | - /* ------- */ | ||
230 | - | ||
231 | -/* +2008.01 bj */ | ||
232 | -#ifdef __DEF_IINCHIP_INT__ | ||
233 | - while ( (getISR(s) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
234 | -#else | ||
235 | - while ( (IINCHIP_READ(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
236 | -#endif | ||
237 | - { | ||
238 | - /* m2008.01 [bj] : reduce code */ | ||
239 | - if ( IINCHIP_READ(Sn_SR(s)) == SOCK_CLOSED ) | ||
240 | - { | ||
241 | -#ifdef __DEF_IINCHIP_DBG__ | ||
242 | - printf("SOCK_CLOSED.\r\n"); | ||
243 | -#endif | ||
244 | - close(s); | ||
245 | - return 0; | ||
246 | - } | ||
247 | - } | ||
248 | -/* +2008.01 bj */ | ||
249 | -#ifdef __DEF_IINCHIP_INT__ | ||
250 | - putISR(s, getISR(s) & (~Sn_IR_SEND_OK)); | ||
251 | -#else | ||
252 | - IINCHIP_WRITE(Sn_IR(s), Sn_IR_SEND_OK); | ||
253 | -#endif | ||
254 | - return ret; | ||
255 | -} | ||
256 | - | ||
257 | - | ||
258 | -/** | ||
259 | -@brief This function is an application I/F function which is used to receive the data in TCP mode. | ||
260 | - It continues to wait for data as much as the application wants to receive. | ||
261 | - | ||
262 | -@return received data size for success else -1. | ||
263 | -*/ | ||
264 | -uint16 recv( | ||
265 | - SOCKET s, /**< socket index */ | ||
266 | - uint8 * buf, /**< a pointer to copy the data to be received */ | ||
267 | - uint16 len /**< the data size to be read */ | ||
268 | - ) | ||
269 | -{ | ||
270 | - uint16 ret=0; | ||
271 | -#ifdef __DEF_IINCHIP_DBG__ | ||
272 | - printf("recv()\r\n"); | ||
273 | -#endif | ||
274 | - | ||
275 | - | ||
276 | - if ( len > 0 ) | ||
277 | - { | ||
278 | - recv_data_processing(s, buf, len); | ||
279 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_RECV); | ||
280 | - | ||
281 | - /* +20071122[chungs]:wait to process the command... */ | ||
282 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
283 | - ; | ||
284 | - /* ------- */ | ||
285 | - ret = len; | ||
286 | - } | ||
287 | - return ret; | ||
288 | -} | ||
289 | - | ||
290 | - | ||
291 | -/** | ||
292 | -@brief This function is an application I/F function which is used to send the data for other then TCP mode. | ||
293 | - Unlike TCP transmission, The peer's destination address and the port is needed. | ||
294 | - | ||
295 | -@return This function return send data size for success else -1. | ||
296 | -*/ | ||
297 | -uint16 sendto( | ||
298 | - SOCKET s, /**< socket index */ | ||
299 | - const uint8 * buf, /**< a pointer to the data */ | ||
300 | - uint16 len, /**< the data size to send */ | ||
301 | - uint8 * addr, /**< the peer's Destination IP address */ | ||
302 | - uint16 port /**< the peer's destination port number */ | ||
303 | - ) | ||
304 | -{ | ||
305 | -// uint8 status=0; | ||
306 | -// uint8 isr=0; | ||
307 | - uint16 ret=0; | ||
308 | - | ||
309 | -#ifdef __DEF_IINCHIP_DBG__ | ||
310 | - printf("sendto()\r\n"); | ||
311 | -#endif | ||
312 | - if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size. | ||
313 | - else ret = len; | ||
314 | - | ||
315 | - if | ||
316 | - ( | ||
317 | - ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && (addr[3] == 0x00)) || | ||
318 | - ((port == 0x00)) ||(ret == 0) | ||
319 | - ) | ||
320 | - { | ||
321 | - /* +2008.01 [bj] : added return value */ | ||
322 | - ret = 0; | ||
323 | -#ifdef __DEF_IINCHIP_DBG__ | ||
324 | - printf("%d Fail[%.2x.%.2x.%.2x.%.2x, %.d, %d]\r\n",s, addr[0], addr[1], addr[2], addr[3] , port, len); | ||
325 | - printf("Fail[invalid ip,port]\r\n"); | ||
326 | -#endif | ||
327 | - } | ||
328 | - else | ||
329 | - { | ||
330 | - IINCHIP_WRITE(Sn_DIPR0(s),addr[0]); | ||
331 | - IINCHIP_WRITE((Sn_DIPR0(s) + 1),addr[1]); | ||
332 | - IINCHIP_WRITE((Sn_DIPR0(s) + 2),addr[2]); | ||
333 | - IINCHIP_WRITE((Sn_DIPR0(s) + 3),addr[3]); | ||
334 | - IINCHIP_WRITE(Sn_DPORT0(s),(uint8)((port & 0xff00) >> 8)); | ||
335 | - IINCHIP_WRITE((Sn_DPORT0(s) + 1),(uint8)(port & 0x00ff)); | ||
336 | - | ||
337 | - // copy data | ||
338 | - send_data_processing(s, (uint8 *)buf, ret); | ||
339 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_SEND); | ||
340 | - | ||
341 | - /* +20071122[chungs]:wait to process the command... */ | ||
342 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
343 | - ; | ||
344 | - /* ------- */ | ||
345 | - | ||
346 | -/* +2008.01 bj */ | ||
347 | -#ifdef __DEF_IINCHIP_INT__ | ||
348 | - while ( (getISR(s) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
349 | -#else | ||
350 | - while ( (IINCHIP_READ(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
351 | -#endif | ||
352 | - { | ||
353 | -#ifdef __DEF_IINCHIP_INT__ | ||
354 | - if (getISR(s) & Sn_IR_TIMEOUT) | ||
355 | -#else | ||
356 | - if (IINCHIP_READ(Sn_IR(s)) & Sn_IR_TIMEOUT) | ||
357 | -#endif | ||
358 | - { | ||
359 | -#ifdef __DEF_IINCHIP_DBG__ | ||
360 | - printf("send fail.\r\n"); | ||
361 | -#endif | ||
362 | -/* +2008.01 [bj]: clear interrupt */ | ||
363 | -#ifdef __DEF_IINCHIP_INT__ | ||
364 | - putISR(s, getISR(s) & ~(Sn_IR_SEND_OK | Sn_IR_TIMEOUT)); /* clear SEND_OK & TIMEOUT */ | ||
365 | -#else | ||
366 | - IINCHIP_WRITE(Sn_IR(s), (Sn_IR_SEND_OK | Sn_IR_TIMEOUT)); /* clear SEND_OK & TIMEOUT */ | ||
367 | -#endif | ||
368 | - return 0; | ||
369 | - } | ||
370 | - } | ||
371 | - | ||
372 | -/* +2008.01 bj */ | ||
373 | -#ifdef __DEF_IINCHIP_INT__ | ||
374 | - putISR(s, getISR(s) & (~Sn_IR_SEND_OK)); | ||
375 | -#else | ||
376 | - IINCHIP_WRITE(Sn_IR(s), Sn_IR_SEND_OK); | ||
377 | -#endif | ||
378 | - | ||
379 | - } | ||
380 | - return ret; | ||
381 | -} | ||
382 | - | ||
383 | - | ||
384 | -/** | ||
385 | -@brief This function is an application I/F function which is used to receive the data in other then | ||
386 | - TCP mode. This function is used to receive UDP, IP_RAW and MAC_RAW mode, and handle the header as well. | ||
387 | - | ||
388 | -@return This function return received data size for success else -1. | ||
389 | -*/ | ||
390 | -uint16 recvfrom( | ||
391 | - SOCKET s, /**< the socket number */ | ||
392 | - uint8 * buf, /**< a pointer to copy the data to be received */ | ||
393 | - uint16 len, /**< the data size to read */ | ||
394 | - uint8 * addr, /**< a pointer to store the peer's IP address */ | ||
395 | - uint16 *port /**< a pointer to store the peer's port number. */ | ||
396 | - ) | ||
397 | -{ | ||
398 | - uint8 head[8]; | ||
399 | - uint16 data_len=0; | ||
400 | - uint16 ptr=0; | ||
401 | -#ifdef __DEF_IINCHIP_DBG__ | ||
402 | - printf("recvfrom()\r\n"); | ||
403 | -#endif | ||
404 | - | ||
405 | - if ( len > 0 ) | ||
406 | - { | ||
407 | - ptr = IINCHIP_READ(Sn_RX_RD0(s)); | ||
408 | - ptr = ((ptr & 0x00ff) << 8) + IINCHIP_READ(Sn_RX_RD0(s) + 1); | ||
409 | -#ifdef __DEF_IINCHIP_DBG__ | ||
410 | - printf("ISR_RX: rd_ptr : %.4x\r\n", ptr); | ||
411 | -#endif | ||
412 | - switch (IINCHIP_READ(Sn_MR(s)) & 0x07) | ||
413 | - { | ||
414 | - case Sn_MR_UDP : | ||
415 | - read_data(s, (uint8 *)ptr, head, 0x08); | ||
416 | - ptr += 8; | ||
417 | - // read peer's IP address, port number. | ||
418 | - addr[0] = head[0]; | ||
419 | - addr[1] = head[1]; | ||
420 | - addr[2] = head[2]; | ||
421 | - addr[3] = head[3]; | ||
422 | - *port = head[4]; | ||
423 | - *port = (*port << 8) + head[5]; | ||
424 | - data_len = head[6]; | ||
425 | - data_len = (data_len << 8) + head[7]; | ||
426 | - | ||
427 | -#ifdef __DEF_IINCHIP_DBG__ | ||
428 | - printf("UDP msg arrived\r\n"); | ||
429 | - printf("source Port : %d\r\n", *port); | ||
430 | - printf("source IP : %d.%d.%d.%d\r\n", addr[0], addr[1], addr[2], addr[3]); | ||
431 | -#endif | ||
432 | - | ||
433 | - read_data(s, (uint8 *)ptr, buf, data_len); // data copy. | ||
434 | - ptr += data_len; | ||
435 | - | ||
436 | - IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8)); | ||
437 | - IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff)); | ||
438 | - break; | ||
439 | - | ||
440 | - case Sn_MR_IPRAW : | ||
441 | - read_data(s, (uint8 *)ptr, head, 0x06); | ||
442 | - ptr += 6; | ||
443 | - | ||
444 | - addr[0] = head[0]; | ||
445 | - addr[1] = head[1]; | ||
446 | - addr[2] = head[2]; | ||
447 | - addr[3] = head[3]; | ||
448 | - data_len = head[4]; | ||
449 | - data_len = (data_len << 8) + head[5]; | ||
450 | - | ||
451 | -#ifdef __DEF_IINCHIP_DBG__ | ||
452 | - printf("IP RAW msg arrived\r\n"); | ||
453 | - printf("source IP : %d.%d.%d.%d\r\n", addr[0], addr[1], addr[2], addr[3]); | ||
454 | -#endif | ||
455 | - read_data(s, (uint8 *)ptr, buf, data_len); // data copy. | ||
456 | - ptr += data_len; | ||
457 | - | ||
458 | - IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8)); | ||
459 | - IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff)); | ||
460 | - break; | ||
461 | - case Sn_MR_MACRAW : | ||
462 | - read_data(s,(uint8*)ptr,head,2); | ||
463 | - ptr+=2; | ||
464 | - data_len = head[0]; | ||
465 | - data_len = (data_len<<8) + head[1] - 2; | ||
466 | - | ||
467 | - read_data(s,(uint8*) ptr,buf,data_len); | ||
468 | - ptr += data_len; | ||
469 | - IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8)); | ||
470 | - IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff)); | ||
471 | - | ||
472 | -#ifdef __DEF_IINCHIP_DGB__ | ||
473 | - printf("MAC RAW msg arrived\r\n"); | ||
474 | - printf("dest mac=%.2X.%.2X.%.2X.%.2X.%.2X.%.2X\r\n",buf[0],buf[1],buf[2],buf[3],buf[4],buf[5]); | ||
475 | - printf("src mac=%.2X.%.2X.%.2X.%.2X.%.2X.%.2X\r\n",buf[6],buf[7],buf[8],buf[9],buf[10],buf[11]); | ||
476 | - printf("type =%.2X%.2X\r\n",buf[12],buf[13]); | ||
477 | -#endif | ||
478 | - break; | ||
479 | - | ||
480 | - default : | ||
481 | - break; | ||
482 | - } | ||
483 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_RECV); | ||
484 | - | ||
485 | - /* +20071122[chungs]:wait to process the command... */ | ||
486 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
487 | - ; | ||
488 | - /* ------- */ | ||
489 | - } | ||
490 | -#ifdef __DEF_IINCHIP_DBG__ | ||
491 | - printf("recvfrom() end ..\r\n"); | ||
492 | -#endif | ||
493 | - return data_len; | ||
494 | -} | ||
495 | - | ||
496 | - | ||
497 | -uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len) | ||
498 | -{ | ||
499 | -// uint8 status=0; | ||
500 | -// uint8 isr=0; | ||
501 | - uint16 ret=0; | ||
502 | - | ||
503 | -#ifdef __DEF_IINCHIP_DBG__ | ||
504 | - printf("igmpsend()\r\n"); | ||
505 | -#endif | ||
506 | - if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size. | ||
507 | - else ret = len; | ||
508 | - | ||
509 | - if (ret == 0) | ||
510 | - { | ||
511 | - ; | ||
512 | -#ifdef __DEF_IINCHIP_DBG__ | ||
513 | - printf("%d Fail[%d]\r\n",len,ret); | ||
514 | -#endif | ||
515 | - } | ||
516 | - else | ||
517 | - { | ||
518 | - // copy data | ||
519 | - send_data_processing(s, (uint8 *)buf, ret); | ||
520 | - IINCHIP_WRITE(Sn_CR(s),Sn_CR_SEND); | ||
521 | -/* +2008.01 bj */ | ||
522 | - while( IINCHIP_READ(Sn_CR(s)) ) | ||
523 | - ; | ||
524 | -/* ------- */ | ||
525 | - | ||
526 | -/* +2008.01 bj */ | ||
527 | -#ifdef __DEF_IINCHIP_INT__ | ||
528 | - while ( (getISR(s) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
529 | -#else | ||
530 | - while ( (IINCHIP_READ(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
531 | -#endif | ||
532 | - { | ||
533 | - IINCHIP_READ(Sn_SR(s)); | ||
534 | -#ifdef __DEF_IINCHIP_INT__ | ||
535 | - if (getISR(s) & Sn_IR_TIMEOUT) | ||
536 | -#else | ||
537 | - if (IINCHIP_READ(Sn_IR(s)) & Sn_IR_TIMEOUT) | ||
538 | -#endif | ||
539 | - { | ||
540 | -#ifdef __DEF_IINCHIP_DBG__ | ||
541 | - printf("igmpsend fail.\r\n"); | ||
542 | -#endif | ||
543 | - /* in case of igmp, if send fails, then socket closed */ | ||
544 | - /* if you want change, remove this code. */ | ||
545 | - close(s); | ||
546 | - /* ----- */ | ||
547 | - | ||
548 | - return 0; | ||
549 | - } | ||
550 | - } | ||
551 | - | ||
552 | -/* +2008.01 bj */ | ||
553 | -#ifdef __DEF_IINCHIP_INT__ | ||
554 | - putISR(s, getISR(s) & (~Sn_IR_SEND_OK)); | ||
555 | -#else | ||
556 | - IINCHIP_WRITE(Sn_IR(s), Sn_IR_SEND_OK); | ||
557 | -#endif | ||
558 | - } | ||
559 | - return ret; | ||
560 | -} | ||
561 | - | 1 | +/* |
2 | +* | ||
3 | +@file socket.c | ||
4 | +@brief setting chip register for socket | ||
5 | + last update : 2008. Jan | ||
6 | +* | ||
7 | +*/ | ||
8 | + | ||
9 | +#include "ethernet.h" | ||
10 | +#include "w5100.h" | ||
11 | +#include "socket.h" | ||
12 | + | ||
13 | +#ifdef __DEF_IINCHIP_DBG__ | ||
14 | +#include <stdio.h> | ||
15 | +#endif | ||
16 | + | ||
17 | +static uint16 local_port; | ||
18 | + | ||
19 | +/** | ||
20 | +@brief This Socket function initialize the channel in perticular mode, and set the port and wait for W5100 done it. | ||
21 | +@return 1 for success else 0. | ||
22 | +*/ | ||
23 | +uint8 socket( | ||
24 | + SOCKET s, /**< for socket number */ | ||
25 | + uint8 protocol, /**< for socket protocol */ | ||
26 | + uint16 port, /**< the source port for the socket */ | ||
27 | + uint8 flag /**< the option for the socket */ | ||
28 | + ) | ||
29 | +{ | ||
30 | + uint8 ret; | ||
31 | +#ifdef __DEF_IINCHIP_DBG__ | ||
32 | + printf("socket()\r\n"); | ||
33 | +#endif | ||
34 | + if ((protocol == Sn_MR_TCP) || (protocol == Sn_MR_UDP) || (protocol == Sn_MR_IPRAW) || (protocol == Sn_MR_MACRAW) || (protocol == Sn_MR_PPPOE)) | ||
35 | + { | ||
36 | + close(s); | ||
37 | + IINCHIP_WRITE(Sn_MR(s),protocol | flag); | ||
38 | + if (port != 0) { | ||
39 | + IINCHIP_WRITE(Sn_PORT0(s),(uint8)((port & 0xff00) >> 8)); | ||
40 | + IINCHIP_WRITE((Sn_PORT0(s) + 1),(uint8)(port & 0x00ff)); | ||
41 | + } else { | ||
42 | + local_port++; // if don't set the source port, set local_port number. | ||
43 | + IINCHIP_WRITE(Sn_PORT0(s),(uint8)((local_port & 0xff00) >> 8)); | ||
44 | + IINCHIP_WRITE((Sn_PORT0(s) + 1),(uint8)(local_port & 0x00ff)); | ||
45 | + } | ||
46 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_OPEN); // run sockinit Sn_CR | ||
47 | + | ||
48 | + /* +20071122[chungs]:wait to process the command... */ | ||
49 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
50 | + ; | ||
51 | + /* ------- */ | ||
52 | + ret = 1; | ||
53 | + } | ||
54 | + else | ||
55 | + { | ||
56 | + ret = 0; | ||
57 | + } | ||
58 | +#ifdef __DEF_IINCHIP_DBG__ | ||
59 | + printf("Sn_SR = %.2x , Protocol = %.2x\r\n", IINCHIP_READ(Sn_SR(s)), IINCHIP_READ(Sn_MR(s))); | ||
60 | +#endif | ||
61 | + return ret; | ||
62 | +} | ||
63 | + | ||
64 | + | ||
65 | +/** | ||
66 | +@brief This function close the socket and parameter is "s" which represent the socket number | ||
67 | +*/ | ||
68 | +void close(SOCKET s) | ||
69 | +{ | ||
70 | +#ifdef __DEF_IINCHIP_DBG__ | ||
71 | + printf("close()\r\n"); | ||
72 | +#endif | ||
73 | + | ||
74 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_CLOSE); | ||
75 | + | ||
76 | + /* +20071122[chungs]:wait to process the command... */ | ||
77 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
78 | + ; | ||
79 | + /* ------- */ | ||
80 | + | ||
81 | + /* +2008.01 [hwkim]: clear interrupt */ | ||
82 | + #ifdef __DEF_IINCHIP_INT__ | ||
83 | + /* m2008.01 [bj] : all clear */ | ||
84 | + putISR(s, 0x00); | ||
85 | + #else | ||
86 | + /* m2008.01 [bj] : all clear */ | ||
87 | + IINCHIP_WRITE(Sn_IR(s), 0xFF); | ||
88 | + #endif | ||
89 | +} | ||
90 | + | ||
91 | + | ||
92 | +/** | ||
93 | +@brief This function established the connection for the channel in passive (server) mode. This function waits for the request from the peer. | ||
94 | +@return 1 for success else 0. | ||
95 | +*/ | ||
96 | +uint8 listen( | ||
97 | + SOCKET s /**< the socket number */ | ||
98 | + ) | ||
99 | +{ | ||
100 | + uint8 ret; | ||
101 | +#ifdef __DEF_IINCHIP_DBG__ | ||
102 | + printf("listen()\r\n"); | ||
103 | +#endif | ||
104 | + if (IINCHIP_READ(Sn_SR(s)) == SOCK_INIT) | ||
105 | + { | ||
106 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_LISTEN); | ||
107 | + /* +20071122[chungs]:wait to process the command... */ | ||
108 | + while( IINCHIP_READ(Sn_CR(s)) ); | ||
109 | + /* ------- */ | ||
110 | + ret = 1; | ||
111 | +#ifdef __DEF_IINCHIP_DBG__ | ||
112 | + printf("status = %x\r\n",IINCHIP_READ(Sn_SR(s))); | ||
113 | +#endif | ||
114 | + } | ||
115 | + else | ||
116 | + { | ||
117 | + ret = 0; | ||
118 | +#ifdef __DEF_IINCHIP_DBG__ | ||
119 | + printf("Fail[invalid ip,port]\r\n"); | ||
120 | +#endif | ||
121 | + } | ||
122 | + return ret; | ||
123 | +} | ||
124 | + | ||
125 | +/** | ||
126 | +@brief This function wait for client connection | ||
127 | +@return 1 for success else 0. | ||
128 | +*/ | ||
129 | +uint8 accept( | ||
130 | + SOCKET s /**< the socket number */ | ||
131 | + ) | ||
132 | +{ | ||
133 | + uint8 ret; | ||
134 | +#ifdef __DEF_IINCHIP_DBG__ | ||
135 | + printf("accept()\r\n"); | ||
136 | +#endif | ||
137 | + if (IINCHIP_READ(Sn_SR(s)) == SOCK_LISTEN) | ||
138 | + { | ||
139 | + while( IINCHIP_READ(Sn_SR(s)) != SOCK_ESTABLISHED ) | ||
140 | + ret = 1; | ||
141 | +#ifdef __DEF_IINCHIP_DBG__ | ||
142 | + printf("status = %x\r\n",IINCHIP_READ(Sn_SR(s))); | ||
143 | +#endif | ||
144 | + } | ||
145 | + else | ||
146 | + { | ||
147 | + ret = 0; | ||
148 | +#ifdef __DEF_IINCHIP_DBG__ | ||
149 | + printf("Fail[not listening]\r\n"); | ||
150 | +#endif | ||
151 | + } | ||
152 | + return ret; | ||
153 | +} | ||
154 | + | ||
155 | + | ||
156 | +/** | ||
157 | +@brief This function established the connection for the channel in Active (client) mode. | ||
158 | + This function waits for the until the connection is established. | ||
159 | + | ||
160 | +@return 1 for success else 0. | ||
161 | +*/ | ||
162 | +uint8 connect(SOCKET s, uint8 * addr, uint16 port) | ||
163 | +{ | ||
164 | + uint8 ret; | ||
165 | +#ifdef __DEF_IINCHIP_DBG__ | ||
166 | + printf("connect()\r\n"); | ||
167 | +#endif | ||
168 | + if | ||
169 | + ( | ||
170 | + ((addr[0] == 0xFF) && (addr[1] == 0xFF) && (addr[2] == 0xFF) && (addr[3] == 0xFF)) || | ||
171 | + ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && (addr[3] == 0x00)) || | ||
172 | + (port == 0x00) | ||
173 | + ) | ||
174 | + { | ||
175 | + ret = 0; | ||
176 | +#ifdef __DEF_IINCHIP_DBG__ | ||
177 | + printf("Fail[invalid ip,port]\r\n"); | ||
178 | +#endif | ||
179 | + } | ||
180 | + else | ||
181 | + { | ||
182 | + ret = 1; | ||
183 | + // set destination IP | ||
184 | + IINCHIP_WRITE(Sn_DIPR0(s),addr[0]); | ||
185 | + IINCHIP_WRITE((Sn_DIPR0(s) + 1),addr[1]); | ||
186 | + IINCHIP_WRITE((Sn_DIPR0(s) + 2),addr[2]); | ||
187 | + IINCHIP_WRITE((Sn_DIPR0(s) + 3),addr[3]); | ||
188 | + IINCHIP_WRITE(Sn_DPORT0(s),(uint8)((port & 0xff00) >> 8)); | ||
189 | + IINCHIP_WRITE((Sn_DPORT0(s) + 1),(uint8)(port & 0x00ff)); | ||
190 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_CONNECT); | ||
191 | + /* m2008.01 [bj] : wait for completion */ | ||
192 | + while ( IINCHIP_READ(Sn_CR(s)) ) ; | ||
193 | + | ||
194 | + } | ||
195 | + | ||
196 | + return ret; | ||
197 | +} | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | +/** | ||
202 | +@brief This function used for disconnect the socket and parameter is "s" which represent the socket number | ||
203 | +@return 1 for success else 0. | ||
204 | +*/ | ||
205 | +void disconnect(SOCKET s) | ||
206 | +{ | ||
207 | +#ifdef __DEF_IINCHIP_DBG__ | ||
208 | + printf("disconnect()\r\n"); | ||
209 | +#endif | ||
210 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_DISCON); | ||
211 | + | ||
212 | + /* +20071122[chungs]:wait to process the command... */ | ||
213 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
214 | + ; | ||
215 | + /* ------- */ | ||
216 | +} | ||
217 | + | ||
218 | + | ||
219 | +/** | ||
220 | +@brief This function used to send the data in TCP mode | ||
221 | +@return 1 for success else 0. | ||
222 | +*/ | ||
223 | +uint16 send( | ||
224 | + SOCKET s, /**< the socket index */ | ||
225 | + const uint8 * buf, /**< a pointer to data */ | ||
226 | + uint16 len /**< the data size to be send */ | ||
227 | + ) | ||
228 | +{ | ||
229 | + uint8 status=0; | ||
230 | + uint16 ret=0; | ||
231 | + uint16 freesize=0; | ||
232 | +#ifdef __DEF_IINCHIP_DBG__ | ||
233 | + printf("send()\r\n"); | ||
234 | +#endif | ||
235 | + | ||
236 | + if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size. | ||
237 | + else ret = len; | ||
238 | + | ||
239 | + // if freebuf is available, start. | ||
240 | + do | ||
241 | + { | ||
242 | + freesize = getSn_TX_FSR(s); | ||
243 | + status = IINCHIP_READ(Sn_SR(s)); | ||
244 | + if ((status != SOCK_ESTABLISHED) && (status != SOCK_CLOSE_WAIT)) | ||
245 | + { | ||
246 | +#ifdef __DEF_IINCHIP_DBG__ | ||
247 | + printf("socket %d freesize(%d) empty or error\r\n", s, freesize); | ||
248 | +#endif | ||
249 | + ret = 0; | ||
250 | + break; | ||
251 | + } | ||
252 | + } while (freesize < ret); | ||
253 | + | ||
254 | + // copy data | ||
255 | + send_data_processing(s, (uint8 *)buf, ret); | ||
256 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_SEND); | ||
257 | + | ||
258 | + /* +20071122[chungs]:wait to process the command... */ | ||
259 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
260 | + ; | ||
261 | + /* ------- */ | ||
262 | + | ||
263 | +/* +2008.01 bj */ | ||
264 | +#ifdef __DEF_IINCHIP_INT__ | ||
265 | + while ( (getISR(s) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
266 | +#else | ||
267 | + while ( (IINCHIP_READ(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
268 | +#endif | ||
269 | + { | ||
270 | + /* m2008.01 [bj] : reduce code */ | ||
271 | + if ( IINCHIP_READ(Sn_SR(s)) == SOCK_CLOSED ) | ||
272 | + { | ||
273 | +#ifdef __DEF_IINCHIP_DBG__ | ||
274 | + printf("SOCK_CLOSED.\r\n"); | ||
275 | +#endif | ||
276 | + close(s); | ||
277 | + return 0; | ||
278 | + } | ||
279 | + } | ||
280 | +/* +2008.01 bj */ | ||
281 | +#ifdef __DEF_IINCHIP_INT__ | ||
282 | + putISR(s, getISR(s) & (~Sn_IR_SEND_OK)); | ||
283 | +#else | ||
284 | + IINCHIP_WRITE(Sn_IR(s), Sn_IR_SEND_OK); | ||
285 | +#endif | ||
286 | + return ret; | ||
287 | +} | ||
288 | + | ||
289 | + | ||
290 | +/** | ||
291 | +@brief This function is an application I/F function which is used to receive the data in TCP mode. | ||
292 | + It continues to wait for data as much as the application wants to receive. | ||
293 | + | ||
294 | +@return received data size for success else -1. | ||
295 | +*/ | ||
296 | +int16 recv( | ||
297 | + SOCKET s, /**< socket index */ | ||
298 | + uint8 * buf, /**< a pointer to copy the data to be received */ | ||
299 | + uint16 len /**< the data size to be read */ | ||
300 | + ) | ||
301 | +{ | ||
302 | + uint16 ret=0; | ||
303 | + if( IINCHIP_READ(Sn_SR(s)) != SOCK_ESTABLISHED ){ | ||
304 | + printf("Bad status = %02x\n",IINCHIP_READ(Sn_SR(s))); | ||
305 | + return -1; | ||
306 | + } | ||
307 | + int plen = getSn_RX_RSR(0); | ||
308 | + if( plen <= 0 ) return 0; | ||
309 | + | ||
310 | +#ifdef __DEF_IINCHIP_DBG__ | ||
311 | + printf("recv()\r\n"); | ||
312 | +#endif | ||
313 | + | ||
314 | + if( plen < len ) len=plen; | ||
315 | + if ( len > 0 ) | ||
316 | + { | ||
317 | + recv_data_processing(s, buf, len); | ||
318 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_RECV); | ||
319 | + | ||
320 | + /* +20071122[chungs]:wait to process the command... */ | ||
321 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
322 | + ; | ||
323 | + /* ------- */ | ||
324 | + ret = len; | ||
325 | + } | ||
326 | + return ret; | ||
327 | +} | ||
328 | + | ||
329 | + | ||
330 | +/** | ||
331 | +@brief This function is an application I/F function which is used to send the data for other then TCP mode. | ||
332 | + Unlike TCP transmission, The peer's destination address and the port is needed. | ||
333 | + | ||
334 | +@return This function return send data size for success else -1. | ||
335 | +*/ | ||
336 | +uint16 sendto( | ||
337 | + SOCKET s, /**< socket index */ | ||
338 | + const uint8 * buf, /**< a pointer to the data */ | ||
339 | + uint16 len, /**< the data size to send */ | ||
340 | + uint8 * addr, /**< the peer's Destination IP address */ | ||
341 | + uint16 port /**< the peer's destination port number */ | ||
342 | + ) | ||
343 | +{ | ||
344 | +// uint8 status=0; | ||
345 | +// uint8 isr=0; | ||
346 | + uint16 ret=0; | ||
347 | + | ||
348 | +#ifdef __DEF_IINCHIP_DBG__ | ||
349 | + printf("sendto()\r\n"); | ||
350 | +#endif | ||
351 | + if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size. | ||
352 | + else ret = len; | ||
353 | + | ||
354 | + if | ||
355 | + ( | ||
356 | + ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && (addr[3] == 0x00)) || | ||
357 | + ((port == 0x00)) ||(ret == 0) | ||
358 | + ) | ||
359 | + { | ||
360 | + /* +2008.01 [bj] : added return value */ | ||
361 | + ret = 0; | ||
362 | +#ifdef __DEF_IINCHIP_DBG__ | ||
363 | + printf("%d Fail[%.2x.%.2x.%.2x.%.2x, %.d, %d]\r\n",s, addr[0], addr[1], addr[2], addr[3] , port, len); | ||
364 | + printf("Fail[invalid ip,port]\r\n"); | ||
365 | +#endif | ||
366 | + } | ||
367 | + else | ||
368 | + { | ||
369 | + IINCHIP_WRITE(Sn_DIPR0(s),addr[0]); | ||
370 | + IINCHIP_WRITE((Sn_DIPR0(s) + 1),addr[1]); | ||
371 | + IINCHIP_WRITE((Sn_DIPR0(s) + 2),addr[2]); | ||
372 | + IINCHIP_WRITE((Sn_DIPR0(s) + 3),addr[3]); | ||
373 | + IINCHIP_WRITE(Sn_DPORT0(s),(uint8)((port & 0xff00) >> 8)); | ||
374 | + IINCHIP_WRITE((Sn_DPORT0(s) + 1),(uint8)(port & 0x00ff)); | ||
375 | + | ||
376 | + // copy data | ||
377 | + send_data_processing(s, (uint8 *)buf, ret); | ||
378 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_SEND); | ||
379 | + | ||
380 | + /* +20071122[chungs]:wait to process the command... */ | ||
381 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
382 | + ; | ||
383 | + /* ------- */ | ||
384 | + | ||
385 | +/* +2008.01 bj */ | ||
386 | +#ifdef __DEF_IINCHIP_INT__ | ||
387 | + while ( (getISR(s) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
388 | +#else | ||
389 | + while ( (IINCHIP_READ(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
390 | +#endif | ||
391 | + { | ||
392 | +#ifdef __DEF_IINCHIP_INT__ | ||
393 | + if (getISR(s) & Sn_IR_TIMEOUT) | ||
394 | +#else | ||
395 | + if (IINCHIP_READ(Sn_IR(s)) & Sn_IR_TIMEOUT) | ||
396 | +#endif | ||
397 | + { | ||
398 | +#ifdef __DEF_IINCHIP_DBG__ | ||
399 | + printf("send fail.\r\n"); | ||
400 | +#endif | ||
401 | +/* +2008.01 [bj]: clear interrupt */ | ||
402 | +#ifdef __DEF_IINCHIP_INT__ | ||
403 | + putISR(s, getISR(s) & ~(Sn_IR_SEND_OK | Sn_IR_TIMEOUT)); /* clear SEND_OK & TIMEOUT */ | ||
404 | +#else | ||
405 | + IINCHIP_WRITE(Sn_IR(s), (Sn_IR_SEND_OK | Sn_IR_TIMEOUT)); /* clear SEND_OK & TIMEOUT */ | ||
406 | +#endif | ||
407 | + return 0; | ||
408 | + } | ||
409 | + } | ||
410 | + | ||
411 | +/* +2008.01 bj */ | ||
412 | +#ifdef __DEF_IINCHIP_INT__ | ||
413 | + putISR(s, getISR(s) & (~Sn_IR_SEND_OK)); | ||
414 | +#else | ||
415 | + IINCHIP_WRITE(Sn_IR(s), Sn_IR_SEND_OK); | ||
416 | +#endif | ||
417 | + | ||
418 | + } | ||
419 | + return ret; | ||
420 | +} | ||
421 | + | ||
422 | + | ||
423 | +/** | ||
424 | +@brief This function is an application I/F function which is used to receive the data in other then | ||
425 | + TCP mode. This function is used to receive UDP, IP_RAW and MAC_RAW mode, and handle the header as well. | ||
426 | + | ||
427 | +@return This function return received data size for success else -1. | ||
428 | +*/ | ||
429 | +uint16 recvfrom( | ||
430 | + SOCKET s, /**< the socket number */ | ||
431 | + uint8 * buf, /**< a pointer to copy the data to be received */ | ||
432 | + uint16 len, /**< the data size to read */ | ||
433 | + uint8 * addr, /**< a pointer to store the peer's IP address */ | ||
434 | + uint16 *port /**< a pointer to store the peer's port number. */ | ||
435 | + ) | ||
436 | +{ | ||
437 | + uint8 head[8]; | ||
438 | + uint16 data_len=0; | ||
439 | + uint16 plen = getSn_RX_RSR(s); | ||
440 | + uint16 ptr=0; | ||
441 | + | ||
442 | + if(plen <=0 ) return 0; | ||
443 | + | ||
444 | +#ifdef __DEF_IINCHIP_DBG__ | ||
445 | + printf("recvfrom()\r\n"); | ||
446 | +#endif | ||
447 | + | ||
448 | + plen = getSn_RX_RSR(s); | ||
449 | + if ( len > 0 ) | ||
450 | + { | ||
451 | + ptr = IINCHIP_READ(Sn_RX_RD0(s)); | ||
452 | + ptr = ((ptr & 0x00ff) << 8) + IINCHIP_READ(Sn_RX_RD0(s) + 1); | ||
453 | + | ||
454 | +#ifdef __DEF_IINCHIP_DBG__ | ||
455 | + printf("ISR_RX: rd_ptr : %.4x size=%d\r\n", ptr, plen); | ||
456 | +#endif | ||
457 | + switch (IINCHIP_READ(Sn_MR(s)) & 0x07) | ||
458 | + { | ||
459 | + case Sn_MR_UDP : | ||
460 | + read_data(s, (uint8 *)ptr, head, 0x08); | ||
461 | + ptr += 8; | ||
462 | + // read peer's IP address, port number. | ||
463 | + addr[0] = head[0]; | ||
464 | + addr[1] = head[1]; | ||
465 | + addr[2] = head[2]; | ||
466 | + addr[3] = head[3]; | ||
467 | + *port = head[4]; | ||
468 | + *port = (*port << 8) + head[5]; | ||
469 | + data_len = head[6]; | ||
470 | + data_len = (data_len << 8) + head[7]; | ||
471 | + | ||
472 | +#ifdef __DEF_IINCHIP_DBG__ | ||
473 | + printf("UDP msg #%d arrived\r\n",data_len); | ||
474 | + printf("source Port : %u\r\n", *port); | ||
475 | + printf("source IP : %d.%d.%d.%d\r\n", addr[0], addr[1], addr[2], addr[3]); | ||
476 | +#endif | ||
477 | + | ||
478 | + read_data(s, (uint8 *)ptr, buf, data_len); // data copy. | ||
479 | + ptr += data_len; | ||
480 | + | ||
481 | + IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8)); | ||
482 | + IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff)); | ||
483 | + break; | ||
484 | + | ||
485 | + case Sn_MR_IPRAW : | ||
486 | + read_data(s, (uint8 *)ptr, head, 0x06); | ||
487 | + ptr += 6; | ||
488 | + | ||
489 | + addr[0] = head[0]; | ||
490 | + addr[1] = head[1]; | ||
491 | + addr[2] = head[2]; | ||
492 | + addr[3] = head[3]; | ||
493 | + data_len = head[4]; | ||
494 | + data_len = (data_len << 8) + head[5]; | ||
495 | + | ||
496 | +#ifdef __DEF_IINCHIP_DBG__ | ||
497 | + printf("IP RAW msg arrived\r\n"); | ||
498 | + printf("source IP : %d.%d.%d.%d\r\n", addr[0], addr[1], addr[2], addr[3]); | ||
499 | +#endif | ||
500 | + read_data(s, (uint8 *)ptr, buf, data_len); // data copy. | ||
501 | + ptr += data_len; | ||
502 | + | ||
503 | + IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8)); | ||
504 | + IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff)); | ||
505 | + break; | ||
506 | + case Sn_MR_MACRAW : | ||
507 | + read_data(s,(uint8*)ptr,head,2); | ||
508 | + ptr+=2; | ||
509 | + data_len = head[0]; | ||
510 | + data_len = (data_len<<8) + head[1] - 2; | ||
511 | + | ||
512 | + read_data(s,(uint8*) ptr,buf,data_len); | ||
513 | + ptr += data_len; | ||
514 | + IINCHIP_WRITE(Sn_RX_RD0(s),(uint8)((ptr & 0xff00) >> 8)); | ||
515 | + IINCHIP_WRITE((Sn_RX_RD0(s) + 1),(uint8)(ptr & 0x00ff)); | ||
516 | + | ||
517 | +#ifdef __DEF_IINCHIP_DGB__ | ||
518 | + printf("MAC RAW msg arrived\r\n"); | ||
519 | + printf("dest mac=%.2X.%.2X.%.2X.%.2X.%.2X.%.2X\r\n",buf[0],buf[1],buf[2],buf[3],buf[4],buf[5]); | ||
520 | + printf("src mac=%.2X.%.2X.%.2X.%.2X.%.2X.%.2X\r\n",buf[6],buf[7],buf[8],buf[9],buf[10],buf[11]); | ||
521 | + printf("type =%.2X%.2X\r\n",buf[12],buf[13]); | ||
522 | +#endif | ||
523 | + break; | ||
524 | + | ||
525 | + default : | ||
526 | + break; | ||
527 | + } | ||
528 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_RECV); | ||
529 | + | ||
530 | + /* +20071122[chungs]:wait to process the command... */ | ||
531 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
532 | + ; | ||
533 | + /* ------- */ | ||
534 | + } | ||
535 | +#ifdef __DEF_IINCHIP_DBG__ | ||
536 | + printf("recvfrom() end ..\r\n"); | ||
537 | +#endif | ||
538 | + return data_len; | ||
539 | +} | ||
540 | + | ||
541 | + | ||
542 | +uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len) | ||
543 | +{ | ||
544 | + uint8 status=0; | ||
545 | +// uint8 isr=0; | ||
546 | + uint16 ret=0; | ||
547 | + | ||
548 | +#ifdef __DEF_IINCHIP_DBG__ | ||
549 | + printf("igmpsend()\r\n"); | ||
550 | +#endif | ||
551 | + if (len > getIINCHIP_TxMAX(s)) ret = getIINCHIP_TxMAX(s); // check size not to exceed MAX size. | ||
552 | + else ret = len; | ||
553 | + | ||
554 | + if (ret == 0) | ||
555 | + { | ||
556 | + ; | ||
557 | +#ifdef __DEF_IINCHIP_DBG__ | ||
558 | + printf("%d Fail[%d]\r\n",len,ret); | ||
559 | +#endif | ||
560 | + } | ||
561 | + else | ||
562 | + { | ||
563 | + // copy data | ||
564 | + send_data_processing(s, (uint8 *)buf, ret); | ||
565 | + IINCHIP_WRITE(Sn_CR(s),Sn_CR_SEND); | ||
566 | +/* +2008.01 bj */ | ||
567 | + while( IINCHIP_READ(Sn_CR(s)) ) | ||
568 | + ; | ||
569 | +/* ------- */ | ||
570 | + | ||
571 | +/* +2008.01 bj */ | ||
572 | +#ifdef __DEF_IINCHIP_INT__ | ||
573 | + while ( (getISR(s) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
574 | +#else | ||
575 | + while ( (IINCHIP_READ(Sn_IR(s)) & Sn_IR_SEND_OK) != Sn_IR_SEND_OK ) | ||
576 | +#endif | ||
577 | + { | ||
578 | + status = IINCHIP_READ(Sn_SR(s)); | ||
579 | +#ifdef __DEF_IINCHIP_INT__ | ||
580 | + if (getISR(s) & Sn_IR_TIMEOUT) | ||
581 | +#else | ||
582 | + if (IINCHIP_READ(Sn_IR(s)) & Sn_IR_TIMEOUT) | ||
583 | +#endif | ||
584 | + { | ||
585 | +#ifdef __DEF_IINCHIP_DBG__ | ||
586 | + printf("igmpsend fail.\r\n"); | ||
587 | +#endif | ||
588 | + /* in case of igmp, if send fails, then socket closed */ | ||
589 | + /* if you want change, remove this code. */ | ||
590 | + close(s); | ||
591 | + /* ----- */ | ||
592 | + | ||
593 | + return 0; | ||
594 | + } | ||
595 | + } | ||
596 | + | ||
597 | +/* +2008.01 bj */ | ||
598 | +#ifdef __DEF_IINCHIP_INT__ | ||
599 | + putISR(s, getISR(s) & (~Sn_IR_SEND_OK)); | ||
600 | +#else | ||
601 | + IINCHIP_WRITE(Sn_IR(s), Sn_IR_SEND_OK); | ||
602 | +#endif | ||
603 | + } | ||
604 | + return ret; | ||
605 | +} | ||
606 | + |
1 | -/* | ||
2 | -* | ||
3 | -@file socket.h | ||
4 | -@brief define function of socket API | ||
5 | -* | ||
6 | -*/ | ||
7 | - | ||
8 | -#ifndef _SOCKET_H_ | ||
9 | -#define _SOCKET_H_ | ||
10 | - | ||
11 | -extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode) | ||
12 | -extern void close(SOCKET s); // Close socket | ||
13 | - | ||
14 | - | ||
15 | -extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection) | ||
16 | -extern void disconnect(SOCKET s); // Disconnect the connection | ||
17 | - | ||
18 | -extern uint8 listen(SOCKET s); // Establish TCP connection (Passive connection) | ||
19 | -extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP) | ||
20 | -extern uint16 recv(SOCKET s, uint8 * buf, uint16 len); // Receive data (TCP) | ||
21 | - | ||
22 | - | ||
23 | -extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW) | ||
24 | -extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16 *port); // Receive data (UDP/IP RAW) | ||
25 | - | ||
26 | -extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len); | ||
27 | -#endif | ||
28 | -/* _SOCKET_H_ */ | 1 | +/* |
2 | +* | ||
3 | +@file socket.h | ||
4 | +@brief define function of socket API | ||
5 | +* | ||
6 | +*/ | ||
7 | + | ||
8 | +#ifndef _SOCKET_H_ | ||
9 | +#define _SOCKET_H_ | ||
10 | + | ||
11 | +extern uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag); // Opens a socket(TCP or UDP or IP_RAW mode) | ||
12 | +extern void close(SOCKET s); // Close socket | ||
13 | +extern uint8 connect(SOCKET s, uint8 * addr, uint16 port); // Establish TCP connection (Active connection) | ||
14 | +extern void disconnect(SOCKET s); // disconnect the connection | ||
15 | +extern uint8 listen(SOCKET s); // Establish TCP connection (Passive connection) | ||
16 | +extern uint8 accept(SOCKET s); // Wait for client (Passive connection) | ||
17 | +extern uint16 send(SOCKET s, const uint8 * buf, uint16 len); // Send data (TCP) | ||
18 | +extern int16 recv(SOCKET s, uint8 * buf, uint16 len); // Receive data (TCP) | ||
19 | +extern uint16 sendto(SOCKET s, const uint8 * buf, uint16 len, uint8 * addr, uint16 port); // Send data (UDP/IP RAW) | ||
20 | +extern uint16 recvfrom(SOCKET s, uint8 * buf, uint16 len, uint8 * addr, uint16 *port); // Receive data (UDP/IP RAW) | ||
21 | + | ||
22 | +extern uint16 igmpsend(SOCKET s, const uint8 * buf, uint16 len); | ||
23 | +#endif | ||
24 | +/* _SOCKET_H_ */ | ||
25 | + | ||
26 | +//1110000000010100 |
Tangible/socket.o
No preview for this file type
Tangible/tangibleInterface
No preview for this file type
Tangible/tangibleInterface.c
@@ -12,48 +12,62 @@ | @@ -12,48 +12,62 @@ | ||
12 | 12 | ||
13 | int main(void) | 13 | int main(void) |
14 | { | 14 | { |
15 | + uint8 com[4],per[14]; | ||
15 | uint8_t mac[MAC_SIZE] = {0xA0,0xBD,0xCD,0xDD,0xED,0xFD}; | 16 | uint8_t mac[MAC_SIZE] = {0xA0,0xBD,0xCD,0xDD,0xED,0xFD}; |
16 | uint8_t ip[IPV4_SIZE] = {172,26,145,205}; | 17 | uint8_t ip[IPV4_SIZE] = {172,26,145,205}; |
17 | uint8_t gateway[4] = {172,26,145,254}; | 18 | uint8_t gateway[4] = {172,26,145,254}; |
18 | uint8_t mask[4] = {255,255,255,0}; | 19 | uint8_t mask[4] = {255,255,255,0}; |
19 | - | ||
20 | - const char * answer = "I'm ok"; | ||
21 | - | ||
22 | - uint8 buf[16]; // Message à stocker. | ||
23 | - uint8_t addr[IPV4_SIZE]; // Adresse source du message reçu. | ||
24 | - uint16_t port; // Port source du message reçu. | 20 | + int isUDP = 0; |
21 | + const char answer [16] = "I'm ok"; | ||
25 | 22 | ||
23 | + uint8 buf[16]; | ||
24 | + uint8_t addr[IPV4_SIZE]; | ||
25 | + uint16_t port; | ||
26 | + uint16 datasize; | ||
27 | + uint8_t addrpifou[IPV4_SIZE]={172,26,145,35}; | ||
28 | + uint16 size; | ||
26 | SOCKET sUDP=0; | 29 | SOCKET sUDP=0; |
27 | SOCKET sTCP=1; | 30 | SOCKET sTCP=1; |
28 | - init_printf(); // On active la liaison série (9600 BD). | ||
29 | - // On assimile une adresse MAC et IP au shield + Indication de la passerelle et du masque de sous-réseau. | 31 | + init_printf(); |
30 | ethernet_init(mac,ip,gateway,mask); | 32 | ethernet_init(mac,ip,gateway,mask); |
31 | - | ||
32 | - if (!socket(sTCP,Sn_MR_TCP,2020,0)) | ||
33 | - { | ||
34 | - return -1; | ||
35 | - } | ||
36 | - while(1) | ||
37 | - { | ||
38 | - printf("BOUCLE\n"); | ||
39 | - if(listen(sTCP)) //Repondre je vais bien à un client | 33 | + if (!socket(sUDP,Sn_MR_UDP,2020,0)) |
34 | + { | ||
35 | + return -1; | ||
36 | + } | ||
37 | + if (!socket(sTCP,Sn_MR_TCP,2020,0)) | ||
38 | + { | ||
39 | + return -1; | ||
40 | + } | ||
41 | + while(1) | ||
42 | + { | ||
43 | + if((datasize=recvfrom(sUDP,buf,sizeof(buf),addr,&port)) == 17) | ||
40 | { | 44 | { |
41 | - send(sTCP,(uint8 *)answer,sizeof(answer)); | ||
42 | - } | ||
43 | - | ||
44 | - } | ||
45 | - close(sTCP); | ||
46 | - close(sUDP); | ||
47 | - return 0; | 45 | + com[0]=buf[0]; |
46 | + com[1]=buf[1]; | ||
47 | + com[2]=buf[2]; | ||
48 | + com[3]='\0'; | ||
49 | + per[0]=buf[3]; | ||
50 | + per[1]=buf[4]; | ||
51 | + per[2]=buf[5]; | ||
52 | + per[3]=buf[6]; | ||
53 | + per[4]=buf[7]; | ||
54 | + per[5]=buf[8]; | ||
55 | + per[6]=buf[9]; | ||
56 | + per[7]=buf[10]; | ||
57 | + per[8]=buf[11]; | ||
58 | + per[9]=buf[12]; | ||
59 | + per[10]=buf[13]; | ||
60 | + per[11]=buf[14]; | ||
61 | + per[12]=buf[15]; | ||
62 | + per[13]='\0'; | ||
63 | + printf("Com : %s\n",com); | ||
64 | + printf("Per : %s\n",per); | ||
65 | + } | ||
66 | + } | ||
67 | + printf("RESET\n"); | ||
68 | + close(sTCP); | ||
69 | + close(sUDP); | ||
70 | + return 0; | ||
48 | } | 71 | } |
49 | - | ||
50 | - /* if (recvfrom(sUDP,buf,sizeof(buf),addr,&port) != -1) //Reception via UDP (infos de la sonde) */ | ||
51 | - /* { */ | ||
52 | - /* } */ | ||
53 | - | ||
54 | - | ||
55 | 72 | ||
56 | - /* if (!socket(sUDP,Sn_MR_UDP,2020,0)) */ | ||
57 | - /* { */ | ||
58 | - /* return -1; */ | ||
59 | - /* } */ | 73 | +//send(sTCP,(uint8*)answer, (uint16)sizeof(answer)); |
Tangible/tangibleInterface.hex
@@ -5,18 +5,18 @@ | @@ -5,18 +5,18 @@ | ||
5 | :100040000C9451000C9451000C9451000C945100EC | 5 | :100040000C9451000C9451000C9451000C945100EC |
6 | :100050000C9451000C9451000C9451000C945100DC | 6 | :100050000C9451000C9451000C9451000C945100DC |
7 | :100060000C9451000C94510011241FBECFEFD8E026 | 7 | :100060000C9451000C94510011241FBECFEFD8E026 |
8 | -:10007000DEBFCDBF13E0A0E0B1E0E4E1FEE102C0ED | ||
9 | -:1000800005900D92A830B107D9F723E0A8E0B3E0BE | ||
10 | -:1000900001C01D92A434B207E1F70E948E0B0C94AC | ||
11 | -:1000A000080F0C940000E82FF0E0E85CFC4F808122 | ||
12 | -:1000B0000895E82FF0E0E85CFC4F60830895E82F96 | ||
13 | -:1000C000F0E0EE0FFF1FE85EFC4F80819181089504 | ||
14 | -:1000D000E82FF0E0EE0FFF1FE05EFC4F8081918182 | ||
15 | -:1000E0000895E82FF0E0EE0FFF1FE85DFC4F8081E0 | ||
16 | -:1000F00091810895E82FF0E0EE0FFF1FE05DFC4FC7 | ||
17 | -:10010000808191810895E82FF0E0EE0FFF1FE85FF6 | 8 | +:10007000DEBFCDBF13E0A0E0B1E0EEEBFFE102C0D8 |
9 | +:1000800005900D92A836B107D9F723E0A8E6B3E0B2 | ||
10 | +:1000900001C01D92A43AB207E1F70E94050C0C942E | ||
11 | +:1000A000DD0F0C940000E82FF0E0E856FC4F808153 | ||
12 | +:1000B0000895E82FF0E0E856FC4F60830895E82F9C | ||
13 | +:1000C000F0E0EE0FFF1FE858FC4F8081918108950A | ||
14 | +:1000D000E82FF0E0EE0FFF1FE058FC4F8081918188 | ||
15 | +:1000E0000895E82FF0E0EE0FFF1FE857FC4F8081E6 | ||
16 | +:1000F00091810895E82FF0E0EE0FFF1FE057FC4FCD | ||
17 | +:10010000808191810895E82FF0E0EE0FFF1FE859FC | ||
18 | :10011000FC4F808191810895E82FF0E0EE0FFF1FE2 | 18 | :10011000FC4F808191810895E82FF0E0EE0FFF1FE2 |
19 | -:10012000E05FFC4F80819181089524B12C6224B955 | 19 | +:10012000E059FC4F80819181089524B12C6224B95B |
20 | :100130002A9A25B1277D25B920E52CBD2A9820EFE4 | 20 | :100130002A9A25B1277D25B920E52CBD2A9820EFE4 |
21 | :100140002EBD0DB407FEFDCF9EBD0DB407FEFDCF45 | 21 | :100140002EBD0DB407FEFDCF9EBD0DB407FEFDCF45 |
22 | :100150008EBD0DB407FEFDCF6EBD0DB407FEFDCF05 | 22 | :100150008EBD0DB407FEFDCF6EBD0DB407FEFDCF05 |
@@ -37,13 +37,13 @@ | @@ -37,13 +37,13 @@ | ||
37 | :10024000CA0108952F923F924F925F926F927F92D0 | 37 | :10024000CA0108952F923F924F925F926F927F92D0 |
38 | :100250008F929F92AF92BF92CF92DF92EF92FF92D6 | 38 | :100250008F929F92AF92BF92CF92DF92EF92FF92D6 |
39 | :100260000F931F93CF93DF93CDB7DEB728970FB6C9 | 39 | :100260000F931F93CF93DF93CDB7DEB728970FB6C9 |
40 | -:10027000F894DEBF0FBECDBF282E362E8DE291E062 | ||
41 | -:100280000E94230C622D8BE190E00E949500632D6B | ||
42 | -:100290008AE190E00E94950080E090E49093110341 | ||
43 | -:1002A0008093100380E090E6909309038093080305 | ||
44 | -:1002B00088E391E00E94230C88E0882E83E0982E4A | ||
45 | -:1002C00090E1A92E93E0B92E20E233E038872F8306 | ||
46 | -:1002D00008E113E028E2C22E23E0D22E30E3E32E21 | 40 | +:10027000F894DEBF0FBECDBF282E362E88E291E067 |
41 | +:100280000E94F80C622D8BE190E00E949500632D96 | ||
42 | +:100290008AE190E00E94950080E090E490937103E1 | ||
43 | +:1002A0008093700380E090E69093690380936803E5 | ||
44 | +:1002B00083E391E00E94F80C88E6882E83E0982E74 | ||
45 | +:1002C00090E7A92E93E0B92E20E833E038872F83FA | ||
46 | +:1002D00008E713E028E8C22E23E0D22E30E9E32E0F | ||
47 | :1002E00033E0F32E1A821982412C512C1C821B827E | 47 | :1002E00033E0F32E1A821982412C512C1C821B827E |
48 | :1002F000612C712C222D30E03E832D83232C312C58 | 48 | :1002F000612C712C222D30E03E832D83232C312C58 |
49 | :10030000AF81B88511961C921E92F801118210825D | 49 | :10030000AF81B88511961C921E92F801118210825D |
@@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
70 | :100450004D935C93F40160817181F2E08F0E911CE9 | 70 | :100450004D935C93F40160817181F2E08F0E911CE9 |
71 | :10046000D5014C9111965C91B2E0AB0EB11C3F935B | 71 | :10046000D5014C9111965C91B2E0AB0EB11C3F935B |
72 | :100470002F939F938F937F936F935F934F937F926D | 72 | :100470002F939F938F937F936F935F934F937F926D |
73 | -:100480006F92A1E6B1E0BF93AF930E940D0CFFEF16 | 73 | +:100480006F92ACE5B1E0BF93AF930E94E20CFFEF37 |
74 | :100490006F1A7F0A29813A812E5F3F4F3A83298361 | 74 | :100490006F1A7F0A29813A812E5F3F4F3A83298361 |
75 | :1004A00032E0C30ED11C42E0E40EF11C0FB6F8940A | 75 | :1004A00032E0C30ED11C42E0E40EF11C0FB6F8940A |
76 | :1004B000DEBF0FBECDBF94E06916710409F020CFF6 | 76 | :1004B000DEBF0FBECDBF94E06916710409F020CFF6 |
@@ -164,9 +164,9 @@ | @@ -164,9 +164,9 @@ | ||
164 | :100A3000080F111D0C151D0511F7C801DF91CF918D | 164 | :100A3000080F111D0C151D0511F7C801DF91CF918D |
165 | :100A40001F910F91FF90EF90DF90CF900895CF927C | 165 | :100A40001F910F91FF90EF90DF90CF900895CF927C |
166 | :100A5000DF92EF92FF920F931F93CF93DF93E82FD4 | 166 | :100A5000DF92EF92FF920F931F93CF93DF93E82FD4 |
167 | -:100A6000F0E0EE0FFF1FDF01A05DBC4F8D919C9168 | ||
168 | -:100A7000DA01A823B923EF01C05FDC4FE880F980D9 | ||
169 | -:100A8000CD018E0D9F1DE05EFC4FC081D181AD0177 | 167 | +:100A6000F0E0EE0FFF1FDF01A057BC4F8D919C916E |
168 | +:100A7000DA01A823B923EF01C059DC4FE880F980DF | ||
169 | +:100A8000CD018E0D9F1DE058FC4FC081D181AD017D | ||
170 | :100A9000420F531FC417D50778F489016B01CA1B95 | 170 | :100A9000420F531FC417D50778F489016B01CA1B95 |
171 | :100AA000DB0BAE010E94D100A8014C1B5D0BB6010F | 171 | :100AA000DB0BAE010E94D100A8014C1B5D0BB6010F |
172 | :100AB0006C0F7D1FC70101C0A901DF91CF911F916C | 172 | :100AB0006C0F7D1FC70101C0A901DF91CF911F916C |
@@ -181,9 +181,9 @@ | @@ -181,9 +181,9 @@ | ||
181 | :100B40000F90DF91CF911F910F91FF90EF90DF9069 | 181 | :100B40000F90DF91CF911F910F91FF90EF90DF9069 |
182 | :100B5000CF90BF909F908F900C949500AF92BF92D2 | 182 | :100B5000CF90BF909F908F900C949500AF92BF92D2 |
183 | :100B6000CF92DF92EF92FF920F931F93CF93DF9379 | 183 | :100B6000CF92DF92EF92FF920F931F93CF93DF9379 |
184 | -:100B7000DA01A901E82FF0E0EE0FFF1FEF01C85DD9 | ||
185 | -:100B8000DC4F888199816B01C822D922EF01C85FAF | ||
186 | -:100B9000DC4FE880F980C6018E0D9F1DE85EFC4F9A | 184 | +:100B7000DA01A901E82FF0E0EE0FFF1FEF01C857DF |
185 | +:100B8000DC4F888199816B01C822D922EF01C859B5 | ||
186 | +:100B9000DC4FE880F980C6018E0D9F1DE858FC4FA0 | ||
187 | :100BA000C081D1819601240F351FC217D30780F46D | 187 | :100BA000C081D1819601240F351FC217D30780F46D |
188 | :100BB0008A015D01CC19DD09AE01BD010E94F90079 | 188 | :100BB0008A015D01CC19DD09AE01BD010E94F90079 |
189 | :100BC000A8014C1B5D0BB5016C0F7D1FC70101C057 | 189 | :100BC000A8014C1B5D0BB5016C0F7D1FC70101C057 |
@@ -193,324 +193,356 @@ | @@ -193,324 +193,356 @@ | ||
193 | :100C0000982E6B017A01082F10E00C5F1F4F102FF8 | 193 | :100C0000982E6B017A01082F10E00C5F1F4F102FF8 |
194 | :100C10000027580188E2A80EB11CC5010E94B3004C | 194 | :100C10000027580188E2A80EB11CC5010E94B3004C |
195 | :100C2000C82FD0E0DC2FCC27075D1F4FC8010E94E2 | 195 | :100C2000C82FD0E0DC2FCC27075D1F4FC8010E94E2 |
196 | -:100C3000B300C80FD11DDF93CF9382E891E09F935B | ||
197 | -:100C40008F930E940D0C9701A601BE01892D0E9471 | 196 | +:100C3000B300C80FD11DDF93CF938DE791E09F9351 |
197 | +:100C40008F930E94E20C9701A601BE01892D0E949C | ||
198 | :100C5000AE05CE0DDF1D6D2FC5010E9495000F90D2 | 198 | :100C5000AE05CE0DDF1D6D2FC5010E9495000F90D2 |
199 | :100C60000F900F900F906C2FC801DF91CF911F91C3 | 199 | :100C60000F900F900F906C2FC801DF91CF911F91C3 |
200 | :100C70000F91FF90EF90DF90CF90BF90AF909F903B | 200 | :100C70000F91FF90EF90DF90CF90BF90AF909F903B |
201 | -:100C80000C9495000F931F93CF93DF93C82F8AE99D | ||
202 | -:100C900091E00E94230CD0E02496DC2FCC278E011B | 201 | +:100C80000C9495000F931F93CF93DF93C82F85E9A2 |
202 | +:100C900091E00E94F80CD0E02496DC2FCC278E0146 | ||
203 | :100CA0000F5F1F4F60E1C8010E949500C8010E94BC | 203 | :100CA0000F5F1F4F60E1C8010E949500C8010E94BC |
204 | :100CB000B3008111FBCF6FEFCE010296DF91CF9190 | 204 | :100CB000B3008111FBCF6FEFCE010296DF91CF9190 |
205 | :100CC0001F910F910C949500CF92DF92EF92FF92BB | 205 | :100CC0001F910F910C949500CF92DF92EF92FF92BB |
206 | :100CD0000F931F93CF93DF93C82FC62E8A01D22E76 | 206 | :100CD0000F931F93CF93DF93C82FC62E8A01D22E76 |
207 | -:100CE00083EA91E00E94230C8FEF8C0DEC2EF12C07 | 207 | +:100CE0008EE991E00E94F80C8FEF8C0DEC2EF12C28 |
208 | :100CF0008530D0F58C2F0E944206E7012496DC2F28 | 208 | :100CF0008530D0F58C2F0E944206E7012496DC2F28 |
209 | :100D0000CC276C2D6D29CE010E949500CE01049652 | 209 | :100D0000CC276C2D6D29CE010E949500CE01049652 |
210 | :100D10009E012B5F3F4F69010115110529F0612FDD | 210 | :100D10009E012B5F3F4F69010115110529F0612FDD |
211 | -:100D20000E949500602F0FC020913C0330913D033D | ||
212 | -:100D30002F5F3F4F30933D0320933C03632F0E946E | ||
213 | -:100D4000950060913C03C6010E9495008E010F5FE3 | 211 | +:100D20000E949500602F0FC020919C0330919D037D |
212 | +:100D30002F5F3F4F30939D0320939C03632F0E94AE | ||
213 | +:100D4000950060919C03C6010E9495008E010F5F83 | ||
214 | :100D50001F4F61E0C8010E949500C8010E94B300C6 | 214 | :100D50001F4F61E0C8010E949500C8010E94B300C6 |
215 | :100D60008111FBCF11E001C010E0E7012496DC2FD8 | 215 | :100D60008111FBCF11E001C010E0E7012496DC2FD8 |
216 | :100D7000CC27CE010E94B300082FCE0103960E941B | 216 | :100D7000CC27CE010E94B300082FCE0103960E941B |
217 | -:100D8000B3001F920F931F928F938DEA91E09F9370 | ||
218 | -:100D90008F930E940D0C0F900F900F900F900F905B | 217 | +:100D8000B3001F920F931F928F9388EA91E09F9375 |
218 | +:100D90008F930E94E20C0F900F900F900F900F9086 | ||
219 | :100DA0000F90812FDF91CF911F910F91FF90EF90C6 | 219 | :100DA0000F90812FDF91CF911F910F91FF90EF90C6 |
220 | -:100DB000DF90CF900895CF93DF93C82F8EEC91E012 | ||
221 | -:100DC0000E94230CD0E02496DC2FCC27CE01039682 | ||
222 | -:100DD0000E94B300833161F4219662E0CE010E944B | ||
223 | -:100DE0009500CE010E94B3008111FBCF81E005C0C8 | ||
224 | -:100DF00088ED91E00E94230C80E0DF91CF9108956F | ||
225 | -:100E0000EF92FF920F931F93CF93DF93C82F8B0125 | ||
226 | -:100E10007A0182EF91E00E94230CF80160816F3F1C | ||
227 | -:100E200051F481818F3F99F482818F3F81F48381D6 | ||
228 | -:100E30008F3F69F40FC061110AC0F80181818111EF | ||
229 | -:100E400006C08281811103C08381882319F0E114D7 | ||
230 | -:100E5000F10431F488ED91E00E94230C80E02FC072 | ||
231 | -:100E6000D0E02496DC2FCC27CE010C960E94950072 | ||
232 | -:100E7000F8016181CE010D960E949500F801628112 | ||
233 | -:100E8000CE010E960E949500F8016381CE010F9667 | ||
234 | -:100E90000E9495006F2DCE0140960E9495006E2D08 | ||
235 | -:100EA000CE0141960E949500219664E0CE010E94F9 | ||
236 | -:100EB0009500CE010E94B3008111FBCF81E0DF914C | ||
237 | -:100EC000CF911F910F91FF90EF900895CF93DF93F3 | ||
238 | -:100ED000C82F8FEE91E00E94230CD0E0DC2FCC27AE | ||
239 | -:100EE000CF5FDB4F68E0CE010E949500CE010E94EB | ||
240 | -:100EF000B3008111FBCFDF91CF9108955F926F9284 | ||
241 | -:100F00007F928F929F92AF92BF92CF92DF92EF9299 | ||
242 | -:100F1000FF920F931F93CF93DF93582E3B018A01CB | ||
243 | -:100F200082EE92E00E94230C852D0E9468008017BB | ||
244 | -:100F3000910720F4852D0E9468008C01C52CD12CCE | ||
245 | -:100F4000E6012496DC2FCC275E0183E0A80EB11CBD | ||
246 | -:100F50009DEF892E91E0992E852D0E94AF047C0192 | ||
247 | -:100F6000C5010E94B300873111F08C3191F4FF92DA | ||
248 | -:100F7000EF92DF92CF929F928F920E940D0C0F9072 | ||
249 | -:100F80000F900F900F900F900F90E016F10620F346 | ||
250 | -:100F900002C000E010E0A801B301852D0E946705A2 | ||
251 | -:100FA0007E018FEFE81AF80A60E2C7010E949500FF | ||
252 | -:100FB000C7010E94B3008111FBCF2296CE010E948F | ||
253 | -:100FC000B30084FD0FC0C5010E94B3008111F6CFAC | ||
254 | -:100FD00085E292E00E94230C852D0E94420680E06B | ||
255 | -:100FE00090E005C060E1CE010E949500C801DF914C | ||
256 | -:100FF000CF911F910F91FF90EF90DF90CF90BF9016 | ||
257 | -:10100000AF909F908F907F906F905F900895EF9238 | ||
258 | -:10101000FF920F931F93CF93DF9300D0CDB7DEB72E | ||
259 | -:10102000F82E8A0183E392E069837A830E94230C7D | ||
260 | -:1010300069817A8101151105A9F0A8018F2D0E94FF | ||
261 | -:10104000F5058F2D90E0982F88279C012F5F3B4F4F | ||
262 | -:10105000790160E4C9010E949500C7010E94B300B4 | ||
263 | -:101060008111FBCFC8010F900F90DF91CF911F919D | ||
264 | -:101070000F91FF90EF9008958F929F92BF92CF9221 | ||
265 | -:10108000DF92EF92FF920F931F93CF93DF93B82ECF | ||
266 | -:101090004B01EA0179018BE392E00E94230C8B2D36 | ||
267 | -:1010A0000E9468008C179D0728F48B2D0E94680011 | ||
268 | -:1010B0006C0101C06E01F7016081611109C081817D | ||
269 | -:1010C000811106C08281811103C08381882331F0A0 | ||
270 | -:1010D0000115110519F0C114D10429F5DF93CF933F | ||
271 | -:1010E0001F930F93F70183811F928F9382811F9229 | ||
272 | -:1010F0008F9381811F928F931F926F931F92BF9244 | ||
273 | -:1011000085E492E09F938F930E940D0C88ED91E00F | ||
274 | -:101110000E94230C8DB79EB740960FB6F8949EBFE1 | ||
275 | -:101120000FBE8DBF49C0CB2DD0E02496DC2FCC273D | ||
276 | -:10113000CE010C960E949500F7016181CE010D96BB | ||
277 | -:101140000E949500F7016281CE010E960E949500E3 | ||
278 | -:10115000F7016381CE010F960E949500612FCE01A9 | ||
279 | -:1011600040960E949500602FCE0141960E94950006 | ||
280 | -:10117000A601B4018B2D0E9467058E010F5F1F4FE2 | ||
281 | -:1011800060E2C8010E949500C8010E94B30081116D | ||
282 | -:10119000FBCF2296CE010E94B30084FD10C0CE0189 | ||
283 | -:1011A0000E94B30083FFF6CF8CEF92E00E94230CE5 | ||
284 | -:1011B00068E1CE010E94950080E090E005C060E10A | ||
285 | -:1011C000CE010E949500C601DF91CF911F910F9132 | ||
286 | -:1011D000FF90EF90DF90CF90BF909F908F900895F9 | ||
287 | -:1011E0002F923F924F925F927F928F929F92AF92F7 | ||
288 | -:1011F000BF92CF92DF92EF92FF920F931F93CF9304 | ||
289 | -:10120000DF93CDB7DEB72A970FB6F894DEBF0FBED7 | ||
290 | -:10121000CDBF782E4B016A0179011A8709878DE6C7 | ||
291 | -:1012200092E00E94230CCD2809F40FC1472C512CC9 | ||
292 | -:1012300084E0480E511C542C4424520198E2A90E1B | ||
293 | -:10124000B11CC5010E94B300082F10E0102F002729 | ||
294 | -:101250006201E9E2CE0ED11CC6010E94B300080F64 | ||
295 | -:10126000111D1F930F9382E891E09F938F930E942B | ||
296 | -:101270000D0CC2010E94B3000F900F900F900F90C1 | ||
297 | -:101280008770833009F460C0843009F4A7C08230CD | ||
298 | -:1012900009F0CCC028E030E0AE014F5F5F4FB801ED | ||
299 | -:1012A000872D0E94AE051801F8E02F0E311C8981B0 | ||
300 | -:1012B000F70180838A8181838B8182838C81838300 | ||
301 | -:1012C0008D8190E0982F88272E81820F911DE985CE | ||
302 | -:1012D000FA85918380830F8110E0102F0027888585 | ||
303 | -:1012E000080F111D89E792E00E94230CE985FA8519 | ||
304 | -:1012F00081818F9380818F938AE892E09F938F936F | ||
305 | -:101300000E940D0CF70183811F928F9382811F929F | ||
306 | -:101310008F9381811F928F9380811F928F938DE98C | ||
307 | -:1013200092E09F938F930E940D0C9801A401B1014C | ||
308 | -:10133000872D0E94AE057101E00EF11E6F2DC501D3 | ||
309 | -:101340000E9495006E2D41C026E030E0AE014F5F57 | ||
310 | -:101350005F4FB801872D0E94AE05180196E0290E57 | ||
311 | -:10136000311C8981F70180838A8181838B8182830B | ||
312 | -:101370008C8183830D8110E0102F00278E81080F50 | ||
313 | -:10138000111D87EB92E00E94230CF70183811F92CD | ||
314 | -:101390008F9382811F928F9381811F928F9380817F | ||
315 | -:1013A0001F928F938DE992E09F938F930E940D0C73 | ||
316 | -:1013B0009801A401B101872D0E94AE05200E311EB7 | ||
317 | -:1013C000632DC5010E949500622DC6010E94950003 | ||
318 | -:1013D0000FB6F894DEBF0FBECDBF2AC022E030E0CA | ||
319 | -:1013E000AE014F5F5F4FB801872D0E94AE057801B7 | ||
320 | -:1013F00092E0E90EF11C098110E0902F88270A8104 | ||
321 | -:1014000010E002501109080F191F9801A401B7013B | ||
322 | -:10141000872D0E94AE05E00EF11E6F2DC5010E94C2 | ||
323 | -:1014200095006E2DC6010E94950002C000E010E0FC | ||
324 | -:10143000EFEF4E1A5E0A60E4C2010E949500C201FD | ||
325 | -:101440000E94B3008111FBCF02C000E010E08BECE2 | ||
326 | -:1014500092E00E94230CC8012A960FB6F894DEBFD2 | ||
327 | -:101460000FBECDBFDF91CF911F910F91FF90EF90F5 | ||
328 | -:10147000DF90CF90BF90AF909F908F907F905F90C4 | ||
329 | -:101480004F903F902F900895CF92DF92FF920F934D | ||
330 | -:101490001F93CF93DF93F82E6B01EA018EED92E05C | ||
331 | -:1014A0000E94230C8F2D0E9468008C179D0728F442 | ||
332 | -:1014B0008F2D0E9468008C0101C08E01011511055D | ||
333 | -:1014C00089F41F921F92DF93CF938AEE92E09F934D | ||
334 | -:1014D0008F930E940D0C0F900F900F900F900F9014 | ||
335 | -:1014E0000F9030C0A801B6018F2D0E946705CF2D47 | ||
336 | -:1014F000D0E02496DC2FCC276E018FEFC81AD80AD3 | ||
337 | -:1015000060E2C6010E949500C6010E94B3008111ED | ||
338 | -:10151000FBCF6E0182E0C80ED11C2396C6010E944B | ||
339 | -:10152000B30084FD12C0CE010E94B300C6010E9428 | ||
340 | -:10153000B30083FFF3CF88EF92E00E94230C8F2D3E | ||
341 | -:101540000E94420680E090E005C060E1C6010E9472 | ||
342 | -:101550009500C801DF91CF911F910F91FF90DF900F | ||
343 | -:10156000CF900895CF92DF92EF92FF920F931F9347 | ||
344 | -:10157000CF93DF936C017B018A01E9010E947E0217 | ||
345 | -:1015800065E585E50E942201C6010E94CD02C701E2 | ||
346 | -:101590000E94F002C8010E948102CE01DF91CF912A | ||
347 | -:1015A0001F910F91FF90EF90DF90CF900C94B402B9 | ||
348 | -:1015B0008093BB0084E88093BC008091BC0087FFCF | ||
349 | -:1015C000FCCF08951092B9008CE08093B80084E0BD | ||
350 | -:1015D0008093BC000895CF9394EA9093BC009091BF | ||
351 | -:1015E000BC0097FFFCCF9091B900987F983011F024 | ||
352 | -:1015F00080E015C0C62F880F0E94D80A8091B900DC | ||
353 | -:10160000887F8831A9F78C2F0E94D80A8091B90071 | ||
354 | -:10161000887F883269F784E98093BC0081E0CF91AC | ||
355 | -:101620000895CF93DF9394EA9093BC009091BC000F | ||
356 | -:1016300097FFFCCF9091B900987F983011F080E02F | ||
357 | -:101640001EC0C42FD62F880F0E94D80A8091B900DF | ||
358 | -:10165000887F8831A1F78D2F0E94D80A8091B90028 | ||
359 | -:10166000887F883261F78C2F0E94D80A8091B90058 | ||
360 | -:10167000887F883221F784E98093BC0081E0DF9184 | ||
361 | -:10168000CF910895092E000CAA0BBB0B9C01AD0154 | ||
362 | -:1016900084E0220F331F441F551F8A95D1F760E065 | ||
363 | -:1016A00074E284EF90E00E94EB0B215031093093FB | ||
364 | -:1016B000C5002093C40088E18093C10086E0809338 | ||
365 | -:1016C000C200E0ECF0E080818D7F808308959091EE | ||
366 | -:1016D000C00095FFFCCF8093C6000895CF93C82F1C | ||
367 | -:1016E0008A3019F48DE00E94670B8C2F0E94670BE3 | ||
368 | -:1016F00080E090E0CF9108958091C00087FFFCCFFB | ||
369 | -:101700008091C600089580E895E20E94420B80E037 | ||
370 | -:1017100091E090934103809340030895CF93DF932A | ||
371 | -:10172000CDB7DEB762970FB6F894DEBF0FBECDBF60 | ||
372 | -:1017300086E0EEE0F1E0DE01119601900D928A95CF | ||
373 | -:10174000E1F72CEA2F879AE1988B81E9898B3DECB0 | ||
374 | -:101750003A8B2B879C878D878EEF8E878FEF8F83B9 | ||
375 | -:10176000888789871A860E94830B9E01295F3F4FD5 | ||
376 | -:10177000AE01455F5F4FBE01615F7F4FCE010196B5 | ||
377 | -:101780000E94B20A20E044EE57E061E081E00E944E | ||
378 | -:1017900064068823A9F084E191E00E94230C81E093 | ||
379 | -:1017A0000E94DB068823B9F38BE191E00E94230CB1 | ||
380 | -:1017B00042E050E066E271E081E00E947E07EBCFFC | ||
381 | -:1017C0008FEF9FEF62960FB6F894DEBF0FBECDBFCE | ||
382 | -:1017D000DF91CF910895A1E21A2EAA1BBB1BFD0138 | ||
383 | -:1017E0000DC0AA1FBB1FEE1FFF1FA217B307E40700 | ||
384 | -:1017F000F50720F0A21BB30BE40BF50B661F771F58 | ||
385 | -:10180000881F991F1A9469F7609570958095909537 | ||
386 | -:101810009B01AC01BD01CF010895A0E0B0E0E3E180 | ||
387 | -:10182000FCE00C94E10EAE014B5F5F4FFA01619159 | ||
388 | -:101830007191AF0180914003909141030E94530C3C | ||
389 | -:10184000E2E00C94FD0E0F931F93CF93DF93E09192 | ||
390 | -:101850004003F0914103238121FF1BC08C01D0E0A4 | ||
391 | -:10186000C0E0F80181918F016091400370914103C4 | ||
392 | -:10187000DB011896ED91FC911997882331F00995B9 | ||
393 | -:10188000892B79F3DFEFCFEFECCF8AE00995892B35 | ||
394 | -:1018900019F08FEF9FEF02C08D2F9C2FDF91CF911A | ||
395 | -:1018A0001F910F910895ACE0B0E0E9E5FCE00C94E5 | ||
396 | -:1018B000D10E7C016B018A01FC01178216828381A3 | ||
397 | -:1018C00081FFBDC1CE0101964C01F7019381F60164 | ||
398 | -:1018D00093FD859193FF81916F01882309F4ABC13A | ||
399 | -:1018E000853239F493FD859193FF81916F018532A3 | ||
400 | -:1018F00029F4B70190E00E943B0EE7CF512C312C28 | ||
401 | -:1019000020E02032A0F48B3269F030F4803259F0BC | ||
402 | -:10191000833269F420612CC08D3239F0803339F480 | ||
403 | -:10192000216026C02260246023C0286021C027FDDA | ||
404 | -:1019300027C030ED380F3A3078F426FF06C0FAE0C1 | ||
405 | -:101940005F9E300D1124532E13C08AE0389E300D57 | ||
406 | -:101950001124332E20620CC08E3221F426FD6BC17F | ||
407 | -:10196000206406C08C3611F4206802C0883641F429 | ||
408 | -:10197000F60193FD859193FF81916F018111C1CF94 | ||
409 | -:10198000982F9F7D9554933028F40C5F1F4FFFE3F1 | ||
410 | -:10199000F9830DC0833631F0833771F0833509F058 | ||
411 | -:1019A0005BC022C0F801808189830E5F1F4F4424F1 | ||
412 | -:1019B0004394512C540115C03801F2E06F0E711C94 | ||
413 | -:1019C000F801A080B18026FF03C0652D70E002C041 | ||
414 | -:1019D0006FEF7FEFC5012C870E94300E2C01830131 | ||
415 | -:1019E0002C852F77222E17C03801F2E06F0E711C64 | ||
416 | -:1019F000F801A080B18026FF03C0652D70E002C011 | ||
417 | -:101A00006FEF7FEFC5012C870E94250E2C012C85DE | ||
418 | -:101A10002068222E830123FC1BC0832D90E04816F2 | ||
419 | -:101A20005906B0F4B70180E290E00E943B0E3A9470 | ||
420 | -:101A3000F4CFF50127FC859127FE81915F01B70165 | ||
421 | -:101A400090E00E943B0E31103A94F1E04F1A510899 | ||
422 | -:101A50004114510471F7E5C0843611F0893639F527 | ||
423 | -:101A6000F80127FF07C060817181828193810C5F3B | ||
424 | -:101A70001F4F08C060817181072E000C880B990BE5 | ||
425 | -:101A80000E5F1F4F2F76722E97FF09C0909580959D | ||
426 | -:101A9000709561957F4F8F4F9F4F2068722E2AE07F | ||
427 | -:101AA00030E0A4010E94730EA82EA81844C0853708 | ||
428 | -:101AB00029F42F7EB22E2AE030E025C0F22FF97FE4 | ||
429 | -:101AC000BF2E8F36C1F018F4883579F0B4C0803756 | ||
430 | -:101AD00019F0883721F0AFC02F2F2061B22EB4FE4D | ||
431 | -:101AE0000DC08B2D8460B82E09C024FF0AC09F2F23 | ||
432 | -:101AF0009660B92E06C028E030E005C020E130E055 | ||
433 | -:101B000002C020E132E0F801B7FE07C060817181B8 | ||
434 | -:101B1000828193810C5F1F4F06C06081718180E0DC | ||
435 | -:101B200090E00E5F1F4FA4010E94730EA82EA8180C | ||
436 | -:101B3000FB2DFF777F2E76FE0BC0372D3E7FA51441 | ||
437 | -:101B400050F474FE0AC072FC08C0372D3E7E05C0FA | ||
438 | -:101B5000BA2C372D03C0BA2C01C0B52C34FF0DC0F0 | ||
439 | -:101B6000FE01EA0DF11D8081803311F4397E09C038 | ||
440 | -:101B700032FF06C0B394B39404C0832F867809F073 | ||
441 | -:101B8000B39433FD13C030FF06C05A2CB31418F4BD | ||
442 | -:101B9000530C5B18B32CB31468F4B70180E290E0E7 | ||
443 | -:101BA0003C870E943B0EB3943C85F5CFB31410F4F0 | ||
444 | -:101BB0003B1801C0312C34FF12C0B70180E390E024 | ||
445 | -:101BC0003C870E943B0E3C8532FF17C031FD03C0AD | ||
446 | -:101BD00088E790E002C088E590E0B7010CC0832F51 | ||
447 | -:101BE000867859F031FF02C08BE201C080E237FDF8 | ||
448 | -:101BF0008DE2B70190E00E943B0EA51438F4B701C6 | ||
449 | -:101C000080E390E00E943B0E5A94F7CFAA94F4012F | ||
450 | -:101C1000EA0DF11D8081B70190E00E943B0EA110FA | ||
451 | -:101C2000F5CF332009F451CEB70180E290E00E9455 | ||
452 | -:101C30003B0E3A94F6CFF7018681978102C08FEF71 | ||
453 | -:101C40009FEF2C96E2E10C94ED0EFC0105906150A3 | ||
454 | -:101C500070400110D8F7809590958E0F9F1F0895C2 | ||
455 | -:101C6000FC016150704001900110D8F7809590956B | ||
456 | -:101C70008E0F9F1F08950F931F93CF93DF93FB0148 | ||
457 | -:101C8000238121FD03C08FEF9FEF28C022FF16C0E4 | ||
458 | -:101C900046815781248135814217530744F4A0813E | ||
459 | -:101CA000B1819D012F5F3F4F318320838C9326812B | ||
460 | -:101CB00037812F5F3F4F3783268310C0EB01092FF9 | ||
461 | -:101CC000182F0084F185E02D0995892BE1F68E818E | ||
462 | -:101CD0009F8101969F838E83812F902FDF91CF91DB | ||
463 | -:101CE0001F910F910895FA01AA27283051F1203150 | ||
464 | -:101CF00081F1E8946F936E7F6E5F7F4F8F4F9F4FA0 | ||
465 | -:101D0000AF4FB1E03ED0B4E03CD0670F781F891FE1 | ||
466 | -:101D10009A1FA11D680F791F8A1F911DA11D6A0FAF | ||
467 | -:101D2000711D811D911DA11D20D009F468943F9162 | ||
468 | -:101D30002AE0269F11243019305D3193DEF6CF0161 | ||
469 | -:101D40000895462F4770405D4193B3E00FD0C9F727 | ||
470 | -:101D5000F6CF462F4F70405D4A3318F0495D31FD94 | ||
471 | -:101D60004052419302D0A9F7EACFB4E0A6959795E7 | ||
472 | -:101D7000879577956795BA95C9F7009761057105BD | ||
473 | -:101D800008959B01AC010A2E069457954795379507 | ||
474 | -:101D90002795BA95C9F7620F731F841F951FA01D61 | ||
475 | -:101DA00008952F923F924F925F926F927F928F92FF | ||
476 | -:101DB0009F92AF92BF92CF92DF92EF92FF920F93DA | ||
477 | -:101DC0001F93CF93DF93CDB7DEB7CA1BDB0B0FB6E4 | ||
478 | -:101DD000F894DEBF0FBECDBF09942A8839884888A1 | ||
479 | -:101DE0005F846E847D848C849B84AA84B984C88437 | ||
480 | -:101DF000DF80EE80FD800C811B81AA81B981CE0F2E | ||
481 | -:101E0000D11D0FB6F894DEBF0FBECDBFED01089512 | ||
482 | -:041E1000F894FFCF74 | ||
483 | -:101E140000000002000000006E0B00000000A0BDE6 | ||
484 | -:101E2400CDDDEDFD424F55434C45006A652072659A | ||
485 | -:101E3400706F6E64730049276D206F6B0073797344 | ||
486 | -:101E4400696E697428290D004368616E6E656C20A3 | ||
487 | -:101E54003A2053454E44204D454D2053495A452080 | ||
488 | -:101E64003A2052454356204D454D2053495A450D7D | ||
489 | -:101E7400002564203A20252E3478203A20252E345B | ||
490 | -:101E840078203A20252E3478203A20252E34780DD7 | ||
491 | -:101E94000A004953525F52583A2072645F70747258 | ||
492 | -:101EA400203A20252E34780D0A00636C6F73652860 | ||
493 | -:101EB400290D00736F636B657428290D00536E5FE1 | ||
494 | -:101EC4005352203D20252E3278202C2050726F74DE | ||
495 | -:101ED4006F636F6C203D20252E32780D0A006C69EB | ||
496 | -:101EE4007374656E28290D004661696C5B696E76B2 | ||
497 | -:101EF400616C69642069702C706F72745D0D00648C | ||
498 | -:101F04006973636F6E6E65637428290D00736F6364 | ||
499 | -:101F14006B6574202564206672656573697A65282B | ||
500 | -:101F240025642920656D707479206F722065727242 | ||
501 | -:101F34006F720D0A00534F434B5F434C4F5345445C | ||
502 | -:101F44002E0D007265637628290D0073656E647426 | ||
503 | -:101F54006F28290D002564204661696C5B252E32AB | ||
504 | -:101F6400782E252E32782E252E32782E252E327874 | ||
505 | -:101F74002C20252E642C2025645D0D0A00726563D7 | ||
506 | -:101F84007666726F6D28290D00554450206D736775 | ||
507 | -:101F940020617272697665640D00736F7572636592 | ||
508 | -:101FA40020506F7274203A2025640D0A00736F75F7 | ||
509 | -:101FB400726365204950203A2025642E25642E251D | ||
510 | -:101FC400642E25640D0A00495020524157206D7338 | ||
511 | -:101FD4006720617272697665640D00726563766666 | ||
512 | -:101FE400726F6D282920656E64202E2E0D0069679E | ||
513 | -:101FF4006D7073656E6428290D002564204661693F | ||
514 | -:102004006C5B25645D0D0A0069676D7073656E64B1 | ||
515 | -:08201400206661696C2E0D00CD | 220 | +:100DB000DF90CF9008950F931F93CF93DF93C82FA9 |
221 | +:100DC00089EC91E00E94F80CD0E02496DC2FCC272F | ||
222 | +:100DD0008E010D5F1F4FC8010E94B3008331D9F40B | ||
223 | +:100DE000219662E0CE010E949500CE010E94B300E0 | ||
224 | +:100DF0008111FBCFC8010E94B3001F928F9383ED36 | ||
225 | +:100E000091E09F938F930E94E20C0F900F900F90B0 | ||
226 | +:100E10000F9081E005C081EE91E00E94F80C80E027 | ||
227 | +:100E2000DF91CF911F910F910895CF93DF93C82F3A | ||
228 | +:100E300088EF91E00E94F80CD0E0DC2FCC27CD5F4A | ||
229 | +:100E4000DB4FCE010E94B3008431B1F4CE010E9489 | ||
230 | +:100E5000B3008731D9F7CE010E94B3001F928F9360 | ||
231 | +:100E600083ED91E09F938F930E94E20C0F900F907F | ||
232 | +:100E70000F900F9081E005C082E092E00E94F80C94 | ||
233 | +:100E800080E0DF91CF910895EF92FF920F931F932F | ||
234 | +:100E9000CF93DF93C82F8B017A018AE192E00E9401 | ||
235 | +:100EA000F80CF80160816F3F51F481818F3F99F414 | ||
236 | +:100EB00082818F3F81F483818F3F69F40FC061117C | ||
237 | +:100EC0000AC0F8018181811106C08281811103C0AD | ||
238 | +:100ED0008381882319F0E114F10431F481EE91E06B | ||
239 | +:100EE0000E94F80C80E02FC0D0E02496DC2FCC27A5 | ||
240 | +:100EF000CE010C960E949500F8016181CE010D96FD | ||
241 | +:100F00000E949500F8016281CE010E960E94950024 | ||
242 | +:100F1000F8016381CE010F960E9495006F2DCE01DE | ||
243 | +:100F200040960E9495006E2DCE0141960E9495003C | ||
244 | +:100F3000219664E0CE010E949500CE010E94B3008C | ||
245 | +:100F40008111FBCF81E0DF91CF911F910F91FF9035 | ||
246 | +:100F5000EF900895CF93DF93C82F87E192E00E942E | ||
247 | +:100F6000F80CD0E0DC2FCC27CF5FDB4F68E0CE0160 | ||
248 | +:100F70000E949500CE010E94B3008111FBCFDF914A | ||
249 | +:100F8000CF9108958F929F92AF92BF92CF92DF92AE | ||
250 | +:100F9000EF92FF921F93CF93DF93182F4B017A01AB | ||
251 | +:100FA00082E493E00E94F80C812F0E9468008E1565 | ||
252 | +:100FB0009F0520F4812F0E9468007C01C12FD0E0A2 | ||
253 | +:100FC0002496DC2FCC275E0183E0A80EB11C812F74 | ||
254 | +:100FD0000E94AF046C01C5010E94B3008731A9F0E3 | ||
255 | +:100FE0008C3199F0DF92CF921F921F9385E292E0AD | ||
256 | +:100FF0009F938F930E94E20C0F900F900F900F9091 | ||
257 | +:101000000F900F90E12CF12C03C0CE14DF04F8F206 | ||
258 | +:10101000A701B401812F0E9467056E018FEFC81AE6 | ||
259 | +:10102000D80A60E2C6010E949500C6010E94B30082 | ||
260 | +:101030008111FBCF2296CE010E94B30084FD0FC028 | ||
261 | +:10104000C5010E94B3008111F6CF8DE492E00E94A9 | ||
262 | +:10105000F80C812F0E94420680E090E005C060E11C | ||
263 | +:10106000CE010E949500C701DF91CF911F91FF90A3 | ||
264 | +:10107000EF90DF90CF90BF90AF909F908F900895AA | ||
265 | +:10108000BF92CF92DF92EF92FF920F931F93CF9375 | ||
266 | +:10109000DF93B82E6B018A01C82FD0E02496DC2F95 | ||
267 | +:1010A000CC277E0183E0E80EF11CC7010E94B3004B | ||
268 | +:1010B000873191F0C7010E94B3001F928F938BE597 | ||
269 | +:1010C00092E09F938F930E94E20C0F900F900F90ED | ||
270 | +:1010D0000F908FEF9FEF26C080E00E94EB047C0111 | ||
271 | +:1010E00018161906ECF48EE692E00E94F80CE01651 | ||
272 | +:1010F000F10620F00115110589F001C08701A80152 | ||
273 | +:10110000B6018B2D0E94F505219660E4CE010E9468 | ||
274 | +:101110009500CE010E94B3008111FBCFC80102C02F | ||
275 | +:1011200080E090E0DF91CF911F910F91FF90EF90C1 | ||
276 | +:10113000DF90CF90BF9008958F929F92BF92CF92F1 | ||
277 | +:10114000DF92EF92FF920F931F93CF93DF93B82E0E | ||
278 | +:101150004B01EA01790186E792E00E94F80C8B2DA1 | ||
279 | +:101160000E9468008C179D0728F48B2D0E94680050 | ||
280 | +:101170006C0101C06E01F7016081611109C08181BC | ||
281 | +:10118000811106C08281811103C08381882331F0DF | ||
282 | +:101190000115110519F0C114D10429F5DF93CF937E | ||
283 | +:1011A0001F930F93F70183811F928F9382811F9268 | ||
284 | +:1011B0008F9381811F928F931F926F931F92BF9283 | ||
285 | +:1011C00080E892E09F938F930E94E20C81EE91E081 | ||
286 | +:1011D0000E94F80C8DB79EB740960FB6F8949EBF4C | ||
287 | +:1011E0000FBE8DBF49C0CB2DD0E02496DC2FCC277D | ||
288 | +:1011F000CE010C960E949500F7016181CE010D96FB | ||
289 | +:101200000E949500F7016281CE010E960E94950022 | ||
290 | +:10121000F7016381CE010F960E949500612FCE01E8 | ||
291 | +:1012200040960E949500602FCE0141960E94950045 | ||
292 | +:10123000A601B4018B2D0E9467058E010F5F1F4F21 | ||
293 | +:1012400060E2C8010E949500C8010E94B3008111AC | ||
294 | +:10125000FBCF2296CE010E94B30084FD10C0CE01C8 | ||
295 | +:101260000E94B30083FFF6CF8CE593E00E94F80C58 | ||
296 | +:1012700068E1CE010E94950080E090E005C060E149 | ||
297 | +:10128000CE010E949500C601DF91CF911F910F9171 | ||
298 | +:10129000FF90EF90DF90CF90BF909F908F90089538 | ||
299 | +:1012A0002F923F924F925F926F927F928F929F9276 | ||
300 | +:1012B000AF92BF92CF92DF92EF92FF920F931F9364 | ||
301 | +:1012C000CF93DF93CDB7DEB72A970FB6F894DEBF82 | ||
302 | +:1012D0000FBECDBF782E4B016A0179011A870987AD | ||
303 | +:1012E0000E94EB04892B09F42BC188EA92E00E944A | ||
304 | +:1012F000F80C872D0E94EB04682E392ECD2809F4B6 | ||
305 | +:1013000017C1472C512C84E0480E511C542C442406 | ||
306 | +:10131000520198E2A90EB11CC5010E94B300082F2A | ||
307 | +:1013200010E0102F00276201E9E2CE0ED11CC601A9 | ||
308 | +:101330000E94B300080F111D3F926F921F930F93ED | ||
309 | +:1013400084EB92E09F938F930E94E20CC2010E9473 | ||
310 | +:10135000B3000F900F900F900F900F900F90877029 | ||
311 | +:10136000833009F464C0843009F4ABC0823009F0E2 | ||
312 | +:10137000D0C028E030E0AE014F5F5F4FB801872D4D | ||
313 | +:101380000E94AE051801F8E02F0E311C8981F7018B | ||
314 | +:1013900080838A8181838B8182838C8183838D8109 | ||
315 | +:1013A00090E0982F88272E81820F911DE985FA857C | ||
316 | +:1013B000918380830F8110E0102F00278885080F0C | ||
317 | +:1013C000111D1F930F9384ED92E09F938F930E94C2 | ||
318 | +:1013D000E20CE985FA8581818F9380818F938AEE73 | ||
319 | +:1013E00092E09F938F930E94E20CF70183811F92FA | ||
320 | +:1013F0008F9382811F928F9381811F928F9380811F | ||
321 | +:101400001F928F938DEF92E09F938F930E94E20C37 | ||
322 | +:101410009801A401B101872D0E94AE057101E00E73 | ||
323 | +:10142000F11E6F2DC5010E9495006E2D41C026E072 | ||
324 | +:1014300030E0AE014F5F5F4FB801872D0E94AE05CF | ||
325 | +:10144000180196E0290E311C8981F70180838A8179 | ||
326 | +:1014500081838B8182838C8183830D8110E0102FA7 | ||
327 | +:1014600000278E81080F111D87E193E00E94F80C80 | ||
328 | +:10147000F70183811F928F9382811F928F938181C5 | ||
329 | +:101480001F928F9380811F928F938DEF92E09F9395 | ||
330 | +:101490008F930E94E20C9801A401B101872D0E9454 | ||
331 | +:1014A000AE05200E311E632DC5010E949500622DF0 | ||
332 | +:1014B000C6010E9495000FB6F894DEBF0FBECDBFE7 | ||
333 | +:1014C0002AC022E030E0AE014F5F5F4FB801872DA8 | ||
334 | +:1014D0000E94AE05780192E0E90EF11C098110E04E | ||
335 | +:1014E000902F88270A8110E002501109080F191F58 | ||
336 | +:1014F0009801A401B701872D0E94AE05E00EF11EF0 | ||
337 | +:101500006F2DC5010E9495006E2DC6010E949500A9 | ||
338 | +:1015100002C000E010E0EFEF4E1A5E0A60E4C20184 | ||
339 | +:101520000E949500C2010E94B3008111FBCF02C04E | ||
340 | +:1015300000E010E08BE293E00E94F80CC80102C0CA | ||
341 | +:1015400080E090E02A960FB6F894DEBF0FBECDBFC4 | ||
342 | +:10155000DF91CF911F910F91FF90EF90DF90CF908F | ||
343 | +:10156000BF90AF909F908F907F906F905F904F90C3 | ||
344 | +:101570003F902F900895CF92DF92FF920F931F9389 | ||
345 | +:10158000CF93DF93F82E6B01EA018EE393E00E9484 | ||
346 | +:10159000F80C8F2D0E9468008C179D0728F48F2D62 | ||
347 | +:1015A0000E9468008C0101C08E010115110589F4AB | ||
348 | +:1015B0001F921F92DF93CF938AE493E09F938F93C0 | ||
349 | +:1015C0000E94E20C0F900F900F900F900F900F90D1 | ||
350 | +:1015D00030C0A801B6018F2D0E946705CF2DD0E045 | ||
351 | +:1015E0002496DC2FCC276E018FEFC81AD80A60E250 | ||
352 | +:1015F000C6010E949500C6010E94B3008111FBCF75 | ||
353 | +:101600006E0182E0C80ED11C2396C6010E94B30071 | ||
354 | +:1016100084FD12C0CE010E94B300C6010E94B30037 | ||
355 | +:1016200083FFF3CF88E593E00E94F80C8F2D0E9492 | ||
356 | +:10163000420680E090E005C060E1C6010E9495008E | ||
357 | +:10164000C801DF91CF911F910F91FF90DF90CF9054 | ||
358 | +:101650000895CF92DF92EF92FF920F931F93CF9353 | ||
359 | +:10166000DF936C017B018A01E9010E947E0265E53E | ||
360 | +:1016700085E50E942201C6010E94CD02C7010E9499 | ||
361 | +:10168000F002C8010E948102CE01DF91CF911F912B | ||
362 | +:101690000F91FF90EF90DF90CF900C94B402809365 | ||
363 | +:1016A000BB0084E88093BC008091BC0087FFFCCF26 | ||
364 | +:1016B00008951092B9008CE08093B80084E0809384 | ||
365 | +:1016C000BC000895CF9394EA9093BC009091BC0025 | ||
366 | +:1016D00097FFFCCF9091B900987F983011F080E08F | ||
367 | +:1016E00015C0C62F880F0E944F0B8091B900887FCC | ||
368 | +:1016F0008831A9F78C2F0E944F0B8091B900887F09 | ||
369 | +:10170000883269F784E98093BC0081E0CF91089525 | ||
370 | +:10171000CF93DF9394EA9093BC009091BC0097FF25 | ||
371 | +:10172000FCCF9091B900987F983011F080E01EC0F6 | ||
372 | +:10173000C42FD62F880F0E944F0B8091B900887F4D | ||
373 | +:101740008831A1F78D2F0E944F0B8091B900887FBF | ||
374 | +:10175000883261F78C2F0E944F0B8091B900887FEF | ||
375 | +:10176000883221F784E98093BC0081E0DF91CF913A | ||
376 | +:101770000895092E000CAA0BBB0B9C01AD0184E05F | ||
377 | +:10178000220F331F441F551F8A95D1F760E074E282 | ||
378 | +:1017900084EF90E00E94C00C215031093093C500C5 | ||
379 | +:1017A0002093C40088E18093C10086E08093C2004A | ||
380 | +:1017B000E0ECF0E080818D7F808308959091C000FF | ||
381 | +:1017C00095FFFCCF8093C6000895CF93C82F8A3031 | ||
382 | +:1017D00019F48DE00E94DE0B8C2F0E94DE0B80E05E | ||
383 | +:1017E00090E0CF9108958091C00087FFFCCF809159 | ||
384 | +:1017F000C600089580E895E20E94B90B80E091E070 | ||
385 | +:101800009093A1038093A00308958F929F92AF922B | ||
386 | +:10181000BF92CF92DF92EF92FF920F931F93CF93DD | ||
387 | +:10182000DF93CDB7DEB7EA970FB6F894DEBF0FBEF1 | ||
388 | +:10183000CDBF86E0EEE0F1E0DE015F9601900D9213 | ||
389 | +:101840008A95E1F72CEA29AB9AE19AAB81E98BAB57 | ||
390 | +:101850003DEC3CAB2DA79EA78FA78EEF88AB8FEFFB | ||
391 | +:1018600089A78AA78BA71CA60E94FA0B9E01275D59 | ||
392 | +:101870003F4FAE01435D5F4FBE016F5C7F4FCE01B6 | ||
393 | +:101880004F960E94290B20E044EE57E062E080E092 | ||
394 | +:101890000E946406882309F45EC020E044EE57E00D | ||
395 | +:1018A00061E081E00E946406882309F454C04E017F | ||
396 | +:1018B00085E3880E911C84E1A82E81E0B82E6E018C | ||
397 | +:1018C00091E1C90ED11C9EE1E92E91E0F92E8E0125 | ||
398 | +:1018D000075C1F4F9E012B5D3F4F40E150E0BE0172 | ||
399 | +:1018E0006F5F7F4F80E00E945009419781F78981A7 | ||
400 | +:1018F0008DAB8A818EAB8B818FAB18AE8C81898B3F | ||
401 | +:101900008D818A8B8E818B8B8F818C8B88858D8B43 | ||
402 | +:1019100089858E8B8A858F8B8B85888F8C85898F27 | ||
403 | +:101920008D858A8F8E858B8F8F858C8F88898D8F03 | ||
404 | +:101930001E8E9F928F92BF92AF920E94E20CDF9216 | ||
405 | +:10194000CF92FF92EF920E94E20C0FB6F894DEBFA6 | ||
406 | +:101950000FBECDBFBCCF8FEF9FEFEA960FB6F894C6 | ||
407 | +:10196000DEBF0FBECDBFDF91CF911F910F91FF90D2 | ||
408 | +:10197000EF90DF90CF90BF90AF909F908F900895A1 | ||
409 | +:10198000A1E21A2EAA1BBB1BFD010DC0AA1FBB1F83 | ||
410 | +:10199000EE1FFF1FA217B307E407F50720F0A21BF5 | ||
411 | +:1019A000B30BE40BF50B661F771F881F991F1A9462 | ||
412 | +:1019B00069F760957095809590959B01AC01BD018C | ||
413 | +:1019C000CF010895A0E0B0E0E8EEFCE00C94B60F83 | ||
414 | +:1019D000AE014B5F5F4FFA0161917191AF01809150 | ||
415 | +:1019E000A0039091A1030E94280DE2E00C94D20F75 | ||
416 | +:1019F0000F931F93CF93DF93E091A003F091A10386 | ||
417 | +:101A0000238121FF1BC08C01D0E0C0E0F80181914F | ||
418 | +:101A10008F016091A0037091A103DB011896ED91F5 | ||
419 | +:101A2000FC911997882331F00995892B79F3DFEF21 | ||
420 | +:101A3000CFEFECCF8AE00995892B19F08FEF9FEF5C | ||
421 | +:101A400002C08D2F9C2FDF91CF911F910F91089590 | ||
422 | +:101A5000ACE0B0E0EEE2FDE00C94A60F7C016B017F | ||
423 | +:101A60008A01FC0117821682838181FFBDC1CE01EC | ||
424 | +:101A700001964C01F7019381F60193FD859193FF47 | ||
425 | +:101A800081916F01882309F4ABC1853239F493FD4C | ||
426 | +:101A9000859193FF81916F01853229F4B70190E020 | ||
427 | +:101AA0000E94100FE7CF512C312C20E02032A0F4FF | ||
428 | +:101AB0008B3269F030F4803259F0833269F420615E | ||
429 | +:101AC0002CC08D3239F0803339F4216026C0226079 | ||
430 | +:101AD000246023C0286021C027FD27C030ED380FC7 | ||
431 | +:101AE0003A3078F426FF06C0FAE05F9E300D1124EC | ||
432 | +:101AF000532E13C08AE0389E300D1124332E2062FD | ||
433 | +:101B00000CC08E3221F426FD6BC1206406C08C36D9 | ||
434 | +:101B100011F4206802C0883641F4F60193FD8591E6 | ||
435 | +:101B200093FF81916F018111C1CF982F9F7D9554B3 | ||
436 | +:101B3000933028F40C5F1F4FFFE3F9830DC0833609 | ||
437 | +:101B400031F0833771F0833509F05BC022C0F801B2 | ||
438 | +:101B5000808189830E5F1F4F44244394512C54018C | ||
439 | +:101B600015C03801F2E06F0E711CF801A080B18041 | ||
440 | +:101B700026FF03C0652D70E002C06FEF7FEFC50147 | ||
441 | +:101B80002C870E94050F2C0183012C852F77222E94 | ||
442 | +:101B900017C03801F2E06F0E711CF801A080B1800F | ||
443 | +:101BA00026FF03C0652D70E002C06FEF7FEFC50117 | ||
444 | +:101BB0002C870E94FA0E2C012C852068222E83018E | ||
445 | +:101BC00023FC1BC0832D90E048165906B0F4B701E2 | ||
446 | +:101BD00080E290E00E94100F3A94F4CFF50127FCC8 | ||
447 | +:101BE000859127FE81915F01B70190E00E94100F5F | ||
448 | +:101BF00031103A94F1E04F1A51084114510471F731 | ||
449 | +:101C0000E5C0843611F0893639F5F80127FF07C0A1 | ||
450 | +:101C100060817181828193810C5F1F4F08C0608158 | ||
451 | +:101C20007181072E000C880B990B0E5F1F4F2F76CA | ||
452 | +:101C3000722E97FF09C090958095709561957F4FA2 | ||
453 | +:101C40008F4F9F4F2068722E2AE030E0A4010E943F | ||
454 | +:101C5000480FA82EA81844C0853729F42F7EB22E2D | ||
455 | +:101C60002AE030E025C0F22FF97FBF2E8F36C1F079 | ||
456 | +:101C700018F4883579F0B4C0803719F0883721F02E | ||
457 | +:101C8000AFC02F2F2061B22EB4FE0DC08B2D84600B | ||
458 | +:101C9000B82E09C024FF0AC09F2F9660B92E06C037 | ||
459 | +:101CA00028E030E005C020E130E002C020E132E071 | ||
460 | +:101CB000F801B7FE07C060817181828193810C5F5A | ||
461 | +:101CC0001F4F06C06081718180E090E00E5F1F4F62 | ||
462 | +:101CD000A4010E94480FA82EA818FB2DFF777F2E85 | ||
463 | +:101CE00076FE0BC0372D3E7FA51450F474FE0AC05B | ||
464 | +:101CF00072FC08C0372D3E7E05C0BA2C372D03C0BC | ||
465 | +:101D0000BA2C01C0B52C34FF0DC0FE01EA0DF11D47 | ||
466 | +:101D10008081803311F4397E09C032FF06C0B3944C | ||
467 | +:101D2000B39404C0832F867809F0B39433FD13C0B5 | ||
468 | +:101D300030FF06C05A2CB31418F4530C5B18B32CA4 | ||
469 | +:101D4000B31468F4B70180E290E03C870E94100F62 | ||
470 | +:101D5000B3943C85F5CFB31410F43B1801C0312C7B | ||
471 | +:101D600034FF12C0B70180E390E03C870E94100F5F | ||
472 | +:101D70003C8532FF17C031FD03C088E790E002C008 | ||
473 | +:101D800088E590E0B7010CC0832F867859F031FFC9 | ||
474 | +:101D900002C08BE201C080E237FD8DE2B70190E026 | ||
475 | +:101DA0000E94100FA51438F4B70180E390E00E9460 | ||
476 | +:101DB000100F5A94F7CFAA94F401EA0DF11D808117 | ||
477 | +:101DC000B70190E00E94100FA110F5CF332009F465 | ||
478 | +:101DD00051CEB70180E290E00E94100F3A94F6CF06 | ||
479 | +:101DE000F7018681978102C08FEF9FEF2C96E2E189 | ||
480 | +:101DF0000C94C20FFC010590615070400110D8F79F | ||
481 | +:101E0000809590958E0F9F1F0895FC016150704042 | ||
482 | +:101E100001900110D8F7809590958E0F9F1F08951F | ||
483 | +:101E20000F931F93CF93DF93FB01238121FD03C009 | ||
484 | +:101E30008FEF9FEF28C022FF16C046815781248173 | ||
485 | +:101E400035814217530744F4A081B1819D012F5F72 | ||
486 | +:101E50003F4F318320838C93268137812F5F3F4F03 | ||
487 | +:101E60003783268310C0EB01092F182F0084F185DA | ||
488 | +:101E7000E02D0995892BE1F68E819F8101969F8344 | ||
489 | +:101E80008E83812F902FDF91CF911F910F91089515 | ||
490 | +:101E9000FA01AA27283051F1203181F1E8946F939B | ||
491 | +:101EA0006E7F6E5F7F4F8F4F9F4FAF4FB1E03ED041 | ||
492 | +:101EB000B4E03CD0670F781F891F9A1FA11D680FDF | ||
493 | +:101EC000791F8A1F911DA11D6A0F711D811D911D12 | ||
494 | +:101ED000A11D20D009F468943F912AE0269F112487 | ||
495 | +:101EE0003019305D3193DEF6CF010895462F4770EB | ||
496 | +:101EF000405D4193B3E00FD0C9F7F6CF462F4F7046 | ||
497 | +:101F0000405D4A3318F0495D31FD4052419302D0A3 | ||
498 | +:101F1000A9F7EACFB4E0A695979587957795679549 | ||
499 | +:101F2000BA95C9F700976105710508959B01AC0149 | ||
500 | +:101F30000A2E06945795479537952795BA95C9F770 | ||
501 | +:101F4000620F731F841F951FA01D08952F923F924B | ||
502 | +:101F50004F925F926F927F928F929F92AF92BF92B9 | ||
503 | +:101F6000CF92DF92EF92FF920F931F93CF93DF9365 | ||
504 | +:101F7000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBEC2 | ||
505 | +:101F8000CDBF09942A88398848885F846E847D840F | ||
506 | +:101F90008C849B84AA84B984C884DF80EE80FD8011 | ||
507 | +:101FA0000C811B81AA81B981CE0FD11D0FB6F89487 | ||
508 | +:0E1FB000DEBF0FBECDBFED010895F894FFCF48 | ||
509 | +:101FBE000000000200000000E50B00000000A0BDC4 | ||
510 | +:101FCE00CDDDEDFD436F6D203A2025730A0050657F | ||
511 | +:101FDE0072203A2025730A00737973696E6974282A | ||
512 | +:101FEE00290D004368616E6E656C203A2053454E94 | ||
513 | +:101FFE0044204D454D2053495A45203A20524543E1 | ||
514 | +:10200E0056204D454D2053495A450D002564203A22 | ||
515 | +:10201E0020252E3478203A20252E3478203A20257B | ||
516 | +:10202E002E3478203A20252E34780D0A004953524A | ||
517 | +:10203E005F52583A2072645F707472203A20252ED7 | ||
518 | +:10204E0034780D0A00636C6F736528290D00736F69 | ||
519 | +:10205E00636B657428290D00536E5F5352203D202B | ||
520 | +:10206E00252E3278202C2050726F746F636F6C2087 | ||
521 | +:10207E003D20252E32780D0A006C697374656E282A | ||
522 | +:10208E00290D00737461747573203D2025780D0A37 | ||
523 | +:10209E00004661696C5B696E76616C69642069707B | ||
524 | +:1020AE002C706F72745D0D00616363657074282906 | ||
525 | +:1020BE000D004661696C5B6E6F74206C697374659C | ||
526 | +:1020CE006E696E675D0D00646973636F6E6E656336 | ||
527 | +:1020DE007428290D00736F636B6574202564206668 | ||
528 | +:1020EE0072656573697A652825642920656D70743B | ||
529 | +:1020FE0079206F72206572726F720D0A00534F4312 | ||
530 | +:10210E004B5F434C4F5345442E0D00426164207388 | ||
531 | +:10211E007461747573203D20253032780A00726523 | ||
532 | +:10212E00637628290D0073656E64746F28290D007F | ||
533 | +:10213E002564204661696C5B252E32782E252E3261 | ||
534 | +:10214E00782E252E32782E252E32782C20252E64B0 | ||
535 | +:10215E002C2025645D0D0A007265637666726F6DC4 | ||
536 | +:10216E0028290D004953525F52583A2072645F700D | ||
537 | +:10217E007472203A20252E34782073697A653D25B5 | ||
538 | +:10218E00640D0A00554450206D736720232564208A | ||
539 | +:10219E00617272697665640D0A00736F757263659C | ||
540 | +:1021AE0020506F7274203A2025750D0A00736F75DA | ||
541 | +:1021BE00726365204950203A2025642E25642E2511 | ||
542 | +:1021CE00642E25640D0A00495020524157206D732C | ||
543 | +:1021DE006720617272697665640D0072656376665A | ||
544 | +:1021EE00726F6D282920656E64202E2E0D00696792 | ||
545 | +:1021FE006D7073656E6428290D0025642046616933 | ||
546 | +:10220E006C5B25645D0D0A0069676D7073656E64A5 | ||
547 | +:08221E00206661696C2E0D00C1 | ||
516 | :00000001FF | 548 | :00000001FF |
Tangible/tangibleInterface.o
No preview for this file type
Threads/threadSocket.c
@@ -10,6 +10,7 @@ void* reponseConnexion(void* sock) | @@ -10,6 +10,7 @@ void* reponseConnexion(void* sock) | ||
10 | { | 10 | { |
11 | 11 | ||
12 | printf("Connected\n"); | 12 | printf("Connected\n"); |
13 | +<<<<<<< HEAD | ||
13 | char buff_rec[BUFF_SIZE]; | 14 | char buff_rec[BUFF_SIZE]; |
14 | char buffer[]="HTTP/1.1 200 OK\r\nServer: Serveur fait maison\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: Keep-alive\r\n\r\nPOST /Page.html HTTP/1.1\r\n\r\n"; | 15 | char buffer[]="HTTP/1.1 200 OK\r\nServer: Serveur fait maison\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: Keep-alive\r\n\r\nPOST /Page.html HTTP/1.1\r\n\r\n"; |
15 | 16 | ||
@@ -31,6 +32,24 @@ void* reponseConnexion(void* sock) | @@ -31,6 +32,24 @@ void* reponseConnexion(void* sock) | ||
31 | fprintf(sockdial_stream, "Ceci est une réponse du serveur TCP.\n"); | 32 | fprintf(sockdial_stream, "Ceci est une réponse du serveur TCP.\n"); |
32 | 33 | ||
33 | //} | 34 | //} |
35 | +======= | ||
36 | + char buffer[BUFF_SIZE]; | ||
37 | + | ||
38 | + FILE* sockdial_stream = fdopen(*((int*)(sock)), "a+"); | ||
39 | + | ||
40 | + printf("Sock : %d // Stream : %p \n", *((int*)(sock)), sockdial_stream); | ||
41 | + | ||
42 | + while(strcmp(buffer, "EXIT\n")!=0) | ||
43 | + { | ||
44 | + printf("WAIT\n"); | ||
45 | + fgets(buffer, BUFF_SIZE, sockdial_stream); | ||
46 | + | ||
47 | + printf("Le message reçu : %s", buffer); | ||
48 | + | ||
49 | + fprintf(sockdial_stream, "Ceci est une réponse du serveur TCP.\n"); | ||
50 | + | ||
51 | + } | ||
52 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
34 | 53 | ||
35 | strcpy(buffer, "START"); | 54 | strcpy(buffer, "START"); |
36 | printf("Fin de la connexion\n"); | 55 | printf("Fin de la connexion\n"); |
bin/test.c
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | +<<<<<<< HEAD | ||
3 | #include <unistd.h> | 4 | #include <unistd.h> |
4 | #include <getopt.h> | 5 | #include <getopt.h> |
5 | #include <string.h> | 6 | #include <string.h> |
@@ -22,6 +23,13 @@ void handler(int sig) | @@ -22,6 +23,13 @@ void handler(int sig) | ||
22 | } | 23 | } |
23 | 24 | ||
24 | 25 | ||
26 | +======= | ||
27 | +#include <getopt.h> | ||
28 | +#include <string.h> | ||
29 | +#include "libnet.h" | ||
30 | + | ||
31 | + | ||
32 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
25 | void argPortParsing(int argc, char* argv[], char* port) | 33 | void argPortParsing(int argc, char* argv[], char* port) |
26 | { | 34 | { |
27 | struct option port_arg={"port", 1, NULL, 'p'}; | 35 | struct option port_arg={"port", 1, NULL, 'p'}; |
@@ -47,6 +55,7 @@ int main(int argc, char* argv[]) | @@ -47,6 +55,7 @@ int main(int argc, char* argv[]) | ||
47 | char port[10]="80"; | 55 | char port[10]="80"; |
48 | argPortParsing(argc, argv, port); | 56 | argPortParsing(argc, argv, port); |
49 | 57 | ||
58 | +<<<<<<< HEAD | ||
50 | action.sa_handler=&handler; | 59 | action.sa_handler=&handler; |
51 | sigaction(SIGINT, &action, NULL); | 60 | sigaction(SIGINT, &action, NULL); |
52 | 61 | ||
@@ -57,6 +66,19 @@ int main(int argc, char* argv[]) | @@ -57,6 +66,19 @@ int main(int argc, char* argv[]) | ||
57 | 66 | ||
58 | sendUDPBroadcast("BroadWesh", 2020); | 67 | sendUDPBroadcast("BroadWesh", 2020); |
59 | sendUDPUnicast("192.168.0.37", "Coucou", 2020); | 68 | sendUDPUnicast("192.168.0.37", "Coucou", 2020); |
69 | +======= | ||
70 | + | ||
71 | + int sock_fd=initialisationServeur(port); | ||
72 | + | ||
73 | + if( sock_fd==-1 ) { fprintf(stderr, "Initialisation du serveur impossible\n"); return -1; } | ||
74 | + | ||
75 | + | ||
76 | + boucleServeur(sock_fd, (void*)&reponseConnexion); | ||
77 | + | ||
78 | + | ||
79 | + sendUDPBroadcast("BroadWesh", 2020); | ||
80 | + | ||
81 | +>>>>>>> 52d8a1eaf954b611aaf0861144b440a15f7c517d | ||
60 | return 0; | 82 | return 0; |
61 | } | 83 | } |
62 | 84 |