Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
38:af5ecd6997ab
Parent:
37:d66bfb594604
Child:
39:89e023ea5968
--- a/main.cpp	Tue Sep 30 19:25:32 2014 +0000
+++ b/main.cpp	Wed Oct 01 19:14:38 2014 +0000
@@ -140,7 +140,7 @@
         }
 //----------------------
             if( t.read() > 5 ){
-                //static int count = 0;            
+                static int count = 0;            
                 for( register uint8_t i = 0; i < v_cb->size(); i++ ){
                     Call_Box * cb = ( Call_Box * )v_cb->get_element( i );
                     if( debug_alive ){ 
@@ -158,22 +158,23 @@
                 
                 if( debug_cks ) debug_msg("PKG_CSK OK: %d :: PKG_CSK ERR: %d", pkg_cksok, pkg_ckserr );
                 
-                
-                //<><><><><><><><><><> simulando cbx
+                //<><><><><><><><><><>
                 /*
-                if( count  == 4 ){
-                    Call_Box * cb = new Call_Box( 854, 0x1011 );
-                    cb->registry();
-                    v_cb->add( cb );
-                    debug_msg("sent");
+                debug_sip = 1;
+                if( count  == 8 ){ 
+                    data = buffer;
+                    type = __INVITE__;
+                    ext = 854;
+                    port = 0x1011;
                 }
                 count++;
                 
-                if( count  == 41 ){
-                    Call_Box * cb = new Call_Box( 854, 0x1011 );
-                    cb->registry();
-                    v_cb->add( cb );
-                    debug_msg("sent");
+                if( count  == 6
+                 ){
+                    data = buffer;
+                    type = __INVITE__;
+                    ext = 854;
+                    port = 0x1011;
                 }
                 */
             }
@@ -393,7 +394,8 @@
                     }
                     __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();
+                    //FIXME talvez eu nao precise dessa linha mudar o set_status( cb->sip->status, sip_idle ); pra ver o que acontece
+                    //cb->reset_sip();
                     set_status( cb->sip->status, sip_idle );
                     cb->re_start_timer();
                 }