![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
vz_protocol.h@16:b45b5b7363d7, 2014-09-18 (annotated)
- Committer:
- klauss
- Date:
- Thu Sep 18 13:59:58 2014 +0000
- Revision:
- 16:b45b5b7363d7
- Parent:
- 15:9c7456c1b6f4
- Child:
- 17:67a6b557eda5
versao do firmware instalado em pista em 2014/09/17 -- registrando 4 equipamentos cbx, aceitando concluindo negociacao SIP, transferencia de audio unilateral, audio header->CBx ok, porem, audio CBx->header ausente
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #ifndef _VZ_PROTOCOL_H__ |
klauss | 0:4d17cd9c8f9d | 2 | #define _VZ_PROTOCOL_H__ |
klauss | 0:4d17cd9c8f9d | 3 | |
klauss | 0:4d17cd9c8f9d | 4 | #include <stdlib.h> |
klauss | 0:4d17cd9c8f9d | 5 | #include <stdint.h> |
klauss | 0:4d17cd9c8f9d | 6 | #include <string.h> |
klauss | 0:4d17cd9c8f9d | 7 | #include "rtp.h" |
klauss | 0:4d17cd9c8f9d | 8 | #include "NTPClient.h" |
klauss | 0:4d17cd9c8f9d | 9 | #include "bits.h" |
klauss | 0:4d17cd9c8f9d | 10 | // 7 + 14 + 1 == ts |
klauss | 0:4d17cd9c8f9d | 11 | |
klauss | 0:4d17cd9c8f9d | 12 | #define __VZ_HEADER_OFFSET__ 7 |
klauss | 0:4d17cd9c8f9d | 13 | #define __CB_BUFFER_SIZE__ 300 |
klauss | 0:4d17cd9c8f9d | 14 | #define __ETH_BUFFER_SIZE__ __CB_BUFFER_SIZE__ + __RTP_HEADER_SIZE__ + 1 // 313 |
klauss | 0:4d17cd9c8f9d | 15 | #define __CB_AUDIO_DATA_SIZE__ 240 |
klauss | 0:4d17cd9c8f9d | 16 | #define __CHECKSUM_OFFSET__ 7 |
klauss | 0:4d17cd9c8f9d | 17 | #define __SEQ_NUM_SIZE__ 1 |
klauss | 0:4d17cd9c8f9d | 18 | #define __CLOCK_SYNC_SIZE__ 14 |
klauss | 0:4d17cd9c8f9d | 19 | #define __TIMESLICE_PLACE__ 22 |
klauss | 0:4d17cd9c8f9d | 20 | #define __UDP_PORT__ 7890 /* numeros arbitrarios ... */ |
klauss | 0:4d17cd9c8f9d | 21 | #define __TCP_PORT__ 8709 |
klauss | 0:4d17cd9c8f9d | 22 | |
klauss | 0:4d17cd9c8f9d | 23 | #define __MAX_CB_IN_A_BRANCH__ 40 |
klauss | 0:4d17cd9c8f9d | 24 | #define __READ__ 0x01 |
klauss | 0:4d17cd9c8f9d | 25 | #define __WAITING__ 0x00 |
klauss | 0:4d17cd9c8f9d | 26 | |
klauss | 0:4d17cd9c8f9d | 27 | // types |
klauss | 0:4d17cd9c8f9d | 28 | #define __BOOT__ 0x00 |
klauss | 0:4d17cd9c8f9d | 29 | #define __REGISTRY__ 0x02 |
klauss | 0:4d17cd9c8f9d | 30 | #define __INVITE__ 0x04 |
klauss | 0:4d17cd9c8f9d | 31 | #define __AUDIO__ 0x08 |
klauss | 0:4d17cd9c8f9d | 32 | #define __TELEMETRY__ 0x10 |
klauss | 0:4d17cd9c8f9d | 33 | #define __CB_BYE__ 0x20 |
klauss | 0:4d17cd9c8f9d | 34 | #define __SOMETHING_2__ 0x40 |
klauss | 0:4d17cd9c8f9d | 35 | #define __SOMETHING_3__ 0x80 |
klauss | 0:4d17cd9c8f9d | 36 | |
klauss | 0:4d17cd9c8f9d | 37 | #define __DO_NOTHING__ 0x99 |
klauss | 0:4d17cd9c8f9d | 38 | |
klauss | 16:b45b5b7363d7 | 39 | //#define __MY_IP__ "192.168.120.169" |
klauss | 15:9c7456c1b6f4 | 40 | #define __MY_IP__ "192.168.2.200" |
klauss | 0:4d17cd9c8f9d | 41 | |
klauss | 0:4d17cd9c8f9d | 42 | uint16_t __checksum__( uint8_t * buffer, size_t length ); |
klauss | 0:4d17cd9c8f9d | 43 | |
klauss | 0:4d17cd9c8f9d | 44 | /* incorporar a parte de cc */ |
klauss | 0:4d17cd9c8f9d | 45 | uint8_t * __parse_cb_buffer__( int * ext, int * port, volatile uint8_t * type, uint8_t * cb_buffer ); |
klauss | 0:4d17cd9c8f9d | 46 | uint8_t * __build_cb_package__( int ext, int port, uint8_t type, char * cb_buffer, uint8_t seq_num, int length, uint8_t * pkg ); |
klauss | 0:4d17cd9c8f9d | 47 | char * __build_eth__package__( void ); |
klauss | 0:4d17cd9c8f9d | 48 | void __print_clock__( uint8_t * buffer ); |
klauss | 0:4d17cd9c8f9d | 49 | |
klauss | 0:4d17cd9c8f9d | 50 | extern void uart3_puts(uint8_t *src, uint16_t size); |
klauss | 0:4d17cd9c8f9d | 51 | |
klauss | 0:4d17cd9c8f9d | 52 | /* mais pra frente isso vira os cpld_send and cpld_receive */ |
klauss | 0:4d17cd9c8f9d | 53 | uint8_t * __read_cb_buffer__( uint8_t * dest, uint8_t * src ); |
klauss | 0:4d17cd9c8f9d | 54 | uint8_t * __read_eth_buffer__( uint8_t * dest, uint8_t * src ); |
klauss | 0:4d17cd9c8f9d | 55 | uint8_t * __write_cb_buffer__( uint8_t * dest, uint8_t * src ); |
klauss | 0:4d17cd9c8f9d | 56 | void __send_to_cb__( uint8_t * buffer ); |
klauss | 0:4d17cd9c8f9d | 57 | uint8_t * __write_eth_buffer__( uint8_t * dest, uint8_t * src ); |
klauss | 0:4d17cd9c8f9d | 58 | |
klauss | 0:4d17cd9c8f9d | 59 | |
klauss | 0:4d17cd9c8f9d | 60 | #endif |