![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
voltando a versao de n aberturas e fechamentos de sockets data 19/09
Dependencies: EthernetInterface NTPClient mbed-rtos mbed EALib
Fork of header_main_publish by
debug.cpp@8:e3bfe62a477e, 2014-09-15 (annotated)
- Committer:
- klauss
- Date:
- Mon Sep 15 15:13:52 2014 +0000
- Revision:
- 8:e3bfe62a477e
- Parent:
- 7:019b08223b87
versao que precisa ser alinhada
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #include "debug.h" |
klauss | 0:4d17cd9c8f9d | 2 | #include "string.h" |
klauss | 0:4d17cd9c8f9d | 3 | |
klauss | 0:4d17cd9c8f9d | 4 | UDPSocket debug; |
klauss | 0:4d17cd9c8f9d | 5 | Endpoint debug_server; |
klauss | 0:4d17cd9c8f9d | 6 | char debug_msg1[ 1024+64 ]; |
klauss | 0:4d17cd9c8f9d | 7 | char debug_msg2[ 1024 ]; |
klauss | 0:4d17cd9c8f9d | 8 | |
klauss | 0:4d17cd9c8f9d | 9 | void debug_pkg( int size, uint8_t * pkg ){ |
klauss | 0:4d17cd9c8f9d | 10 | static uint8_t i=0; |
klauss | 0:4d17cd9c8f9d | 11 | strcpy( debug_msg1, "Pkg " ); |
klauss | 0:4d17cd9c8f9d | 12 | memcpy( debug_msg1+5, pkg, size ); |
klauss | 0:4d17cd9c8f9d | 13 | debug_msg1[ 4 ] = i++; |
klauss | 1:a1758104fa1d | 14 | debug.sendTo( debug_server, debug_msg1, size+5 ); |
klauss | 0:4d17cd9c8f9d | 15 | } |