![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Versao com problema no socket rx
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Diff: main.cpp
- Revision:
- 1:a1758104fa1d
- Parent:
- 0:4d17cd9c8f9d
--- a/main.cpp Tue Sep 09 20:01:24 2014 +0000 +++ b/main.cpp Wed Sep 10 12:50:57 2014 +0000 @@ -7,7 +7,6 @@ #include "debug.h" #include "utils.h" - // for aditional debugs #define on_work @@ -102,8 +101,7 @@ reset_leds(); reboot.start(); debug_msg( " Ready " ); - - + /* char test_buffer[400]; UDPSocket test_sock; Endpoint test_server; @@ -116,9 +114,9 @@ test_sock.sendTo( test_server, test_buffer, sizeof( test_buffer ) ); Timer reconnect; reconnect.start(); - - while( true ){ - + */ + while( true ){ + /* n = test_sock.receiveFrom( test_server, test_buffer, sizeof( test_buffer ) ); if( n > 0 ){ test_sock.sendTo( test_server, test_buffer, n ); @@ -130,8 +128,7 @@ reconnect.reset(); test_sock.sendTo( test_server, test_buffer, n ); led4 = !led4; - } - + }*/ if( status != __WAITING__ ){ __read_cb_buffer__( buffer, buffer_from_cb_ptr ); status = __WAITING__; @@ -222,6 +219,7 @@ }break; case __INVITE__ : { + debug_msg("ok -- recebido o invite pelo menos"); #ifndef on_work // invite de uma ligacao em andamento ? Call_Box * cb = __find_CB__( v_cb, ext ); @@ -431,6 +429,7 @@ } __send_to_cb__( __build_cb_package__( ext, port, __CB_BYE__, ( char * )buffer, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + cb->reset_sip(); set_status( cb->sip->status, sip_idle ); } }