Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
121:ee02790d00b7
Parent:
119:ee6a53069455
Child:
124:c1b6c893e1c3
--- a/call_box_manager.cpp	Mon May 04 17:25:29 2015 +0000
+++ b/call_box_manager.cpp	Fri May 08 04:15:23 2015 +0000
@@ -4,7 +4,7 @@
 Timer timer_aging;
 Timer timer_sync_refresh;
 
-Call_Box * __find_CB__( Vector * v_cb, int ext ){
+Call_Box * find_CB( Vector * v_cb, int ext ){
     Call_Box * cb = NULL;
     for ( register int i = 0; i < v_cb->size (); i++ )
     {
@@ -33,11 +33,12 @@
             
             Call_Box * cb = (Call_Box * )v_cb->get_element( lst_index++ );
             
-            if( cb != NULL && cb->status == cb_idle ){
+            if ( ( cb != NULL ) && ( cb -> get_status () == cb_idle ) )
+            {
                 
                 if( cb->get_ext() % 2 == 1 ){ 
-                    Call_Box * cb_master =  __find_CB__( v_cb, cb->get_ext() - 1 );
-                    if( cb_master != NULL && cb_master->status != cb_idle ) return( 0x20 );
+                    Call_Box * cb_master =  find_CB( v_cb, cb->get_ext() - 1 );
+                    if ( ( cb_master != NULL ) && ( cb_master -> get_status () != cb_idle ) ) return( 0x20 );
                 }
         
                 cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 );
@@ -96,10 +97,10 @@
                 if( ( size == 1 ) || ( ( wake_all_up_index + 1 ) == size ) || ( ext_list[ wake_all_up_index + 1 ] !=  ( ext_list[ wake_all_up_index ] + 1 ) ) )
                 {
                     strcpy( ( char * )data, "ping\r" );
-                    Call_Box * cb = __find_CB__( v_cb, ext_list[ wake_all_up_index ] );
+                    Call_Box * cb = find_CB( v_cb, ext_list[ wake_all_up_index ] );
                  
                     // verifica se o master esta em chamada.   
-                    if( cb != NULL && cb->status == cb_idle )
+                    if ( ( cb != NULL ) && ( cb -> get_status () == cb_idle ) )
                     { 
                         cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 );
                         
@@ -115,10 +116,10 @@
                 if( ( size == 1 ) || (  wake_all_up_index == 0 ) || (  wake_all_up_index >= 1 ) && ( ext_list[ wake_all_up_index - 1 ] !=  ( ext_list[ wake_all_up_index ] - 1 ) ) )
                 {
                     strcpy( ( char * )data, "ping\r" );
-                    Call_Box * cb = __find_CB__( v_cb, ( ext_list[ wake_all_up_index ] ) );
+                    Call_Box * cb = find_CB( v_cb, ( ext_list[ wake_all_up_index ] ) );
                     
                     // verifica se o slave esta em chamada.
-                    if( cb != NULL && cb->status == cb_idle )
+                    if ( ( cb != NULL ) && ( cb -> get_status () == cb_idle ) )
                     { 
                         cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 );