debugs removidos - ligacao em pares ok
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Fork of header_main by
call.h@0:4d17cd9c8f9d, 2014-09-09 (annotated)
- Committer:
- klauss
- Date:
- Tue Sep 09 20:01:24 2014 +0000
- Revision:
- 0:4d17cd9c8f9d
20140726 copy
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #ifndef __CALL_H__ |
klauss | 0:4d17cd9c8f9d | 2 | #define __CALL_H__ |
klauss | 0:4d17cd9c8f9d | 3 | |
klauss | 0:4d17cd9c8f9d | 4 | #include "rtp.h" |
klauss | 0:4d17cd9c8f9d | 5 | #include "rtpbuf.h" |
klauss | 0:4d17cd9c8f9d | 6 | #include "mbed.h" |
klauss | 0:4d17cd9c8f9d | 7 | #include "EthernetInterface.h" |
klauss | 0:4d17cd9c8f9d | 8 | #include <stdlib.h> |
klauss | 0:4d17cd9c8f9d | 9 | #include <stdint.h> |
klauss | 0:4d17cd9c8f9d | 10 | #include <string.h> |
klauss | 0:4d17cd9c8f9d | 11 | #include "object.h" |
klauss | 0:4d17cd9c8f9d | 12 | #include "vz_protocol.h" |
klauss | 0:4d17cd9c8f9d | 13 | |
klauss | 0:4d17cd9c8f9d | 14 | extern DigitalOut led1; |
klauss | 0:4d17cd9c8f9d | 15 | |
klauss | 0:4d17cd9c8f9d | 16 | #define __RPT_SEVER_IP__ "192.168.120.120" |
klauss | 0:4d17cd9c8f9d | 17 | #define __CALL_MAX_IDLE_TIME__ 5 |
klauss | 0:4d17cd9c8f9d | 18 | #define __MAX_CALL_TIME__ 180 |
klauss | 0:4d17cd9c8f9d | 19 | |
klauss | 0:4d17cd9c8f9d | 20 | class VZ_call : public Object{ |
klauss | 0:4d17cd9c8f9d | 21 | private : |
klauss | 0:4d17cd9c8f9d | 22 | Timer t; |
klauss | 0:4d17cd9c8f9d | 23 | Timer finish; |
klauss | 0:4d17cd9c8f9d | 24 | int cb_ext; |
klauss | 0:4d17cd9c8f9d | 25 | int cb_port; |
klauss | 0:4d17cd9c8f9d | 26 | uint8_t cb2server[ 320 ]; |
klauss | 0:4d17cd9c8f9d | 27 | char server2cb[ 320 ]; |
klauss | 0:4d17cd9c8f9d | 28 | uint8_t buffer[ 320 ]; |
klauss | 0:4d17cd9c8f9d | 29 | UDPSocket rtp_sock; |
klauss | 0:4d17cd9c8f9d | 30 | int rtp_server_ext; |
klauss | 0:4d17cd9c8f9d | 31 | int rtp_server_port; |
klauss | 0:4d17cd9c8f9d | 32 | Endpoint rtp_server; |
klauss | 0:4d17cd9c8f9d | 33 | RTP * rtp; |
klauss | 0:4d17cd9c8f9d | 34 | rtpbuf_t rtpbuf; |
klauss | 0:4d17cd9c8f9d | 35 | public : |
klauss | 0:4d17cd9c8f9d | 36 | VZ_call( int cb_ext, int cb_port, int rtp_server_ext, int rtp_server_port ); |
klauss | 0:4d17cd9c8f9d | 37 | ~VZ_call(); |
klauss | 0:4d17cd9c8f9d | 38 | int get_cb_ext(); |
klauss | 0:4d17cd9c8f9d | 39 | int get_cb_port(); |
klauss | 0:4d17cd9c8f9d | 40 | int get_rtp_server_ext(); |
klauss | 0:4d17cd9c8f9d | 41 | int get_rtp_server_port(); |
klauss | 0:4d17cd9c8f9d | 42 | char * get_eth_message( int * length ); |
klauss | 0:4d17cd9c8f9d | 43 | char * get_server2cb_buffer(); |
klauss | 0:4d17cd9c8f9d | 44 | uint8_t * get_cb2server_buffer(); |
klauss | 0:4d17cd9c8f9d | 45 | uint8_t * get_buffer(); |
klauss | 0:4d17cd9c8f9d | 46 | |
klauss | 0:4d17cd9c8f9d | 47 | uint8_t * build_cb_package( void ); |
klauss | 0:4d17cd9c8f9d | 48 | char * build_eth_package( uint8_t * ); |
klauss | 0:4d17cd9c8f9d | 49 | |
klauss | 0:4d17cd9c8f9d | 50 | int send_message( char * ); |
klauss | 0:4d17cd9c8f9d | 51 | bool is_timeout( void ); |
klauss | 0:4d17cd9c8f9d | 52 | bool is_timetofinish( void ); |
klauss | 0:4d17cd9c8f9d | 53 | }; |
klauss | 0:4d17cd9c8f9d | 54 | #endif |