Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Committer:
klauss
Date:
Fri Nov 07 17:57:55 2014 +0000
Revision:
68:b54993674190
Parent:
63:0d95da692bb4
Child:
69:65665afbad5d
corre??es no tratamento dos pacotes de telemetria.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
klauss 0:4d17cd9c8f9d 1 #ifndef __UTILS_H__
klauss 0:4d17cd9c8f9d 2 #define __UTILS_H__
klauss 0:4d17cd9c8f9d 3
klauss 0:4d17cd9c8f9d 4 #include <iostream>
klauss 0:4d17cd9c8f9d 5 #include <string.h>
klauss 14:22a35f575502 6 #include "debug.h"
klauss 0:4d17cd9c8f9d 7 #include "mbed.h"
klauss 0:4d17cd9c8f9d 8 #include "EthernetInterface.h"
klauss 0:4d17cd9c8f9d 9 #include "vz_protocol.h"
klauss 0:4d17cd9c8f9d 10 #include "vector.h"
klauss 0:4d17cd9c8f9d 11 #include "sip.h"
klauss 0:4d17cd9c8f9d 12 #include "call.h"
klauss 0:4d17cd9c8f9d 13 #include "call_box.h"
klauss 0:4d17cd9c8f9d 14 #include "timeslice.h"
klauss 0:4d17cd9c8f9d 15 #include "parallelcpld.h"
klauss 0:4d17cd9c8f9d 16 #include "test.h"
klauss 31:bb5fb28a77df 17 #include "prompt.h"
klauss 48:195c97f12e8e 18 #include "configs.h"
klauss 0:4d17cd9c8f9d 19
klauss 63:0d95da692bb4 20 /* Armazena o ultimo pacote enviado para os CBx */
klauss 63:0d95da692bb4 21 extern uint8_t cb_tx_buffer[ __CB_BUFFER_SIZE__ ];
klauss 63:0d95da692bb4 22
klauss 0:4d17cd9c8f9d 23 using namespace std;
klauss 0:4d17cd9c8f9d 24
klauss 0:4d17cd9c8f9d 25 extern DigitalOut led1;
klauss 0:4d17cd9c8f9d 26 extern DigitalOut led2;
klauss 0:4d17cd9c8f9d 27 extern DigitalOut led3;
klauss 0:4d17cd9c8f9d 28 extern DigitalOut led4;
klauss 48:195c97f12e8e 29 extern EthernetInterface eth;
klauss 68:b54993674190 30 extern UDPSocket t_sock;
klauss 68:b54993674190 31 extern Endpoint t_server;
klauss 14:22a35f575502 32 #define set_status(a,b) _set_status(a,b)
klauss 14:22a35f575502 33 #define _set_status(a,b){ \
klauss 31:bb5fb28a77df 34 if( a != b ) if( debug_sip )debug_msg("Anterior %d -- Atual %d", a, b ); \
klauss 14:22a35f575502 35 if( a != NULL || b != NULL ) a = b; \
klauss 31:bb5fb28a77df 36 else if( debug_sip ) debug_msg("Paramento sip null"); \
klauss 14:22a35f575502 37 }
klauss 0:4d17cd9c8f9d 38
klauss 0:4d17cd9c8f9d 39 void reverse( char str[], int length );
klauss 0:4d17cd9c8f9d 40 char* itoa(int num, char* str, int base);
klauss 0:4d17cd9c8f9d 41 void reset_leds( void );
klauss 48:195c97f12e8e 42 int __init_eth__( void );
klauss 0:4d17cd9c8f9d 43
klauss 0:4d17cd9c8f9d 44 Call_Box * __find_CB__( Vector * v_cb, int ext );
klauss 0:4d17cd9c8f9d 45 VZ_call * __find_Call__( Vector * v_call, int ext );
klauss 0:4d17cd9c8f9d 46 void registry_aging( Vector * v_cb, uint8_t * data, uint8_t * write_buffer );
klauss 0:4d17cd9c8f9d 47 int sip_manager( Vector * v_cb, Vector * v_call, uint8_t * write_buffer );
klauss 0:4d17cd9c8f9d 48 void call_manager( Vector * v_call, Vector * v_cb, uint8_t * data, uint8_t * write_buffer, Timeslice * ts );
klauss 0:4d17cd9c8f9d 49 void build_telemetry_report( int ext, int port, char * data );
klauss 0:4d17cd9c8f9d 50 void __send_to_cb__( uint8_t * buffer );
klauss 62:07e5bdc9f8f7 51 int ls_comp( const void * a, const void * b );
klauss 0:4d17cd9c8f9d 52
klauss 68:b54993674190 53 void init_telemetry_handler( void );
klauss 68:b54993674190 54 void re_start_telemetry( void );
klauss 68:b54993674190 55
klauss 0:4d17cd9c8f9d 56 #endif