![](/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
utils.cpp@63:0d95da692bb4, 2014-10-28 (annotated)
- Committer:
- klauss
- Date:
- Tue Oct 28 12:44:45 2014 +0000
- Revision:
- 63:0d95da692bb4
- Parent:
- 62:07e5bdc9f8f7
- Child:
- 68:b54993674190
stats implementado, conta o nro de pacotes recebidos por determinado tipo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #include "utils.h" |
klauss | 30:8dfb6d8de53d | 2 | #include "prompt.h" |
klauss | 0:4d17cd9c8f9d | 3 | |
klauss | 48:195c97f12e8e | 4 | EthernetInterface eth; |
klauss | 63:0d95da692bb4 | 5 | uint8_t cb_tx_buffer[ __CB_BUFFER_SIZE__ ]; |
klauss | 48:195c97f12e8e | 6 | |
klauss | 0:4d17cd9c8f9d | 7 | void reverse( char str[], int length ){ |
klauss | 0:4d17cd9c8f9d | 8 | int start = 0; |
klauss | 0:4d17cd9c8f9d | 9 | int end = length -1; |
klauss | 0:4d17cd9c8f9d | 10 | while (start < end){ |
klauss | 0:4d17cd9c8f9d | 11 | swap(*(str+start), *(str+end)); |
klauss | 0:4d17cd9c8f9d | 12 | start++; |
klauss | 0:4d17cd9c8f9d | 13 | end--; |
klauss | 0:4d17cd9c8f9d | 14 | } |
klauss | 0:4d17cd9c8f9d | 15 | } |
klauss | 0:4d17cd9c8f9d | 16 | char* itoa(int num, char* str, int base){ |
klauss | 0:4d17cd9c8f9d | 17 | int i = 0; |
klauss | 0:4d17cd9c8f9d | 18 | bool isNegative = false; |
klauss | 0:4d17cd9c8f9d | 19 | |
klauss | 0:4d17cd9c8f9d | 20 | if( num == 0 ){ |
klauss | 0:4d17cd9c8f9d | 21 | str[i++] = '0'; |
klauss | 0:4d17cd9c8f9d | 22 | str[i] = '\0'; |
klauss | 0:4d17cd9c8f9d | 23 | return str; |
klauss | 0:4d17cd9c8f9d | 24 | } |
klauss | 0:4d17cd9c8f9d | 25 | if( num < 0 && base == 10 ){ |
klauss | 0:4d17cd9c8f9d | 26 | isNegative = true; |
klauss | 0:4d17cd9c8f9d | 27 | num = -num; |
klauss | 0:4d17cd9c8f9d | 28 | } |
klauss | 0:4d17cd9c8f9d | 29 | while( num != 0 ){ |
klauss | 0:4d17cd9c8f9d | 30 | int rem = num % base; |
klauss | 0:4d17cd9c8f9d | 31 | str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0'; |
klauss | 0:4d17cd9c8f9d | 32 | num = num/base; |
klauss | 0:4d17cd9c8f9d | 33 | } |
klauss | 0:4d17cd9c8f9d | 34 | if( isNegative ) |
klauss | 0:4d17cd9c8f9d | 35 | str[i++] = '-'; |
klauss | 0:4d17cd9c8f9d | 36 | |
klauss | 0:4d17cd9c8f9d | 37 | str[i] = '\0'; // Append string terminator |
klauss | 0:4d17cd9c8f9d | 38 | |
klauss | 0:4d17cd9c8f9d | 39 | reverse( str, i ); |
klauss | 0:4d17cd9c8f9d | 40 | return( str ); |
klauss | 0:4d17cd9c8f9d | 41 | } |
klauss | 0:4d17cd9c8f9d | 42 | |
klauss | 0:4d17cd9c8f9d | 43 | void reset_leds( void ){ |
klauss | 0:4d17cd9c8f9d | 44 | led1 = led2 = 1; |
klauss | 0:4d17cd9c8f9d | 45 | led3 = led4 = 0; |
klauss | 0:4d17cd9c8f9d | 46 | } |
klauss | 0:4d17cd9c8f9d | 47 | |
klauss | 48:195c97f12e8e | 48 | int __init_eth__(){ |
klauss | 44:cc4996469404 | 49 | static bool initialized = false; |
klauss | 50:d9b6577a70f5 | 50 | char buff_ip[ 16 ] = ""; |
klauss | 50:d9b6577a70f5 | 51 | char buff_msk[ 16 ] = ""; |
klauss | 50:d9b6577a70f5 | 52 | char buff_gtw[ 16 ] = ""; |
klauss | 48:195c97f12e8e | 53 | wdt.kick(); |
klauss | 28:94aec56c6329 | 54 | pc.printf("\n\r"); |
klauss | 27:98f824719d1c | 55 | FILE *fp = fopen( "/qspi/myip.txt", "r"); |
klauss | 27:98f824719d1c | 56 | if( fp == NULL ){ |
klauss | 31:bb5fb28a77df | 57 | if( debug_file ) debug_msg("Failed to open /qspi/myip.txt" ); |
klauss | 27:98f824719d1c | 58 | strncpy( buff_ip, __MY_IP__, 20 ); |
klauss | 27:98f824719d1c | 59 | }else{ |
klauss | 46:a670f187a704 | 60 | int read = fread( buff_ip, 1, 512, fp ); |
klauss | 46:a670f187a704 | 61 | if( read > 0 ){ |
klauss | 46:a670f187a704 | 62 | for( int i = 0; i < read; i++ ) |
klauss | 46:a670f187a704 | 63 | if( buff_ip[ i ] == '\n' || buff_ip[ i ] == '\r' ){ |
klauss | 46:a670f187a704 | 64 | buff_ip[ i ] = '\0'; |
klauss | 46:a670f187a704 | 65 | break; |
klauss | 46:a670f187a704 | 66 | } |
klauss | 31:bb5fb28a77df | 67 | if( debug_file ) debug_msg("Eth ip %s", buff_ip ); |
klauss | 27:98f824719d1c | 68 | }else{ |
klauss | 31:bb5fb28a77df | 69 | if( debug_file ) if( debug_file ) debug_msg("Failed to read /qspi/myip.txt" ); |
klauss | 27:98f824719d1c | 70 | strncpy( buff_ip, __MY_IP__, 20 ); |
klauss | 27:98f824719d1c | 71 | } |
klauss | 27:98f824719d1c | 72 | } |
klauss | 27:98f824719d1c | 73 | fclose( fp ); |
klauss | 27:98f824719d1c | 74 | buff_ip[ 15 ] = 0; |
klauss | 44:cc4996469404 | 75 | |
klauss | 27:98f824719d1c | 76 | fp = fopen( "/qspi/mymask.txt", "r"); |
klauss | 27:98f824719d1c | 77 | if( fp == NULL ){ |
klauss | 31:bb5fb28a77df | 78 | if( debug_file ) debug_msg("Failed to open /qspi/mymask.txt" ); |
klauss | 28:94aec56c6329 | 79 | strncpy( buff_msk, __MY_MSK__, 20 ); |
klauss | 27:98f824719d1c | 80 | }else{ |
klauss | 46:a670f187a704 | 81 | int read = fread( buff_msk, 1, 512, fp ); |
klauss | 46:a670f187a704 | 82 | if( read > 0 ){ |
klauss | 46:a670f187a704 | 83 | for( int i = 0; i < read; i++ ) |
klauss | 46:a670f187a704 | 84 | if( buff_msk[ i ] == '\n' || buff_msk[ i ] == '\r' ){ |
klauss | 46:a670f187a704 | 85 | buff_msk[ i ] = '\0'; |
klauss | 46:a670f187a704 | 86 | break; |
klauss | 46:a670f187a704 | 87 | } |
klauss | 31:bb5fb28a77df | 88 | if( debug_file ) debug_msg("mascara de rede Eth %s", buff_msk ); |
klauss | 27:98f824719d1c | 89 | }else{ |
klauss | 31:bb5fb28a77df | 90 | if( debug_file ) debug_msg("Failed to read /qspi/mymask.txt" ); |
klauss | 28:94aec56c6329 | 91 | strncpy( buff_msk, __MY_MSK__, 20 ); |
klauss | 27:98f824719d1c | 92 | } |
klauss | 27:98f824719d1c | 93 | } |
klauss | 27:98f824719d1c | 94 | fclose( fp ); |
klauss | 27:98f824719d1c | 95 | buff_msk[ 15 ] = 0; |
klauss | 27:98f824719d1c | 96 | |
klauss | 27:98f824719d1c | 97 | fp = fopen( "/qspi/mygate.txt", "r"); |
klauss | 27:98f824719d1c | 98 | if( fp == NULL ){ |
klauss | 31:bb5fb28a77df | 99 | if( debug_file ) debug_msg("Failed to open /qspi/mygate.txt" ); |
klauss | 28:94aec56c6329 | 100 | strncpy( buff_gtw, __MY_GTW__, 20 ); |
klauss | 27:98f824719d1c | 101 | }else{ |
klauss | 46:a670f187a704 | 102 | int read = fread( buff_gtw, 1, 512, fp ); |
klauss | 46:a670f187a704 | 103 | if( read > 0 ){ |
klauss | 46:a670f187a704 | 104 | for( int i = 0; i < read; i++ ) |
klauss | 46:a670f187a704 | 105 | if( buff_gtw[ i ] == '\n' || buff_gtw[ i ] == '\r' ){ |
klauss | 46:a670f187a704 | 106 | buff_gtw[ i ] = '\0'; |
klauss | 46:a670f187a704 | 107 | break; |
klauss | 46:a670f187a704 | 108 | } |
klauss | 31:bb5fb28a77df | 109 | if( debug_file ) debug_msg("Ip Gateway Eth %s", buff_gtw ); |
klauss | 27:98f824719d1c | 110 | }else{ |
klauss | 31:bb5fb28a77df | 111 | if( debug_file ) debug_msg("Failed to read /qspi/mygate.txt" ); |
klauss | 28:94aec56c6329 | 112 | strncpy( buff_gtw, __MY_GTW__, 20 ); |
klauss | 27:98f824719d1c | 113 | } |
klauss | 27:98f824719d1c | 114 | } |
klauss | 27:98f824719d1c | 115 | fclose( fp ); |
klauss | 27:98f824719d1c | 116 | buff_gtw[ 15 ] = 0; |
klauss | 46:a670f187a704 | 117 | |
klauss | 44:cc4996469404 | 118 | if( !initialized ){ |
klauss | 50:d9b6577a70f5 | 119 | //eth.init( buff_ip, buff_msk, buff_gtw ); |
klauss | 50:d9b6577a70f5 | 120 | eth.init( buff_ip, buff_msk, __MY_GTW__ ); |
klauss | 44:cc4996469404 | 121 | initialized = true; |
klauss | 48:195c97f12e8e | 122 | return eth.connect(); |
klauss | 44:cc4996469404 | 123 | } |
klauss | 48:195c97f12e8e | 124 | |
klauss | 48:195c97f12e8e | 125 | if( !eth.disconnect() ){ |
klauss | 48:195c97f12e8e | 126 | return eth.connect(); |
klauss | 48:195c97f12e8e | 127 | } |
klauss | 48:195c97f12e8e | 128 | else{ |
klauss | 48:195c97f12e8e | 129 | return eth.connect(); |
klauss | 48:195c97f12e8e | 130 | } |
klauss | 0:4d17cd9c8f9d | 131 | } |
klauss | 0:4d17cd9c8f9d | 132 | |
klauss | 0:4d17cd9c8f9d | 133 | Call_Box * __find_CB__( Vector * v_cb, int ext ){ |
klauss | 0:4d17cd9c8f9d | 134 | Call_Box * cb = NULL; |
klauss | 0:4d17cd9c8f9d | 135 | for( register int i = 0; i < v_cb->size(); i++ ){ |
klauss | 0:4d17cd9c8f9d | 136 | cb = ( Call_Box * )v_cb->get_element( i ); |
klauss | 0:4d17cd9c8f9d | 137 | if( cb->get_ext() == ext ) return( cb ); |
klauss | 0:4d17cd9c8f9d | 138 | } |
klauss | 0:4d17cd9c8f9d | 139 | return( NULL ); |
klauss | 0:4d17cd9c8f9d | 140 | } |
klauss | 0:4d17cd9c8f9d | 141 | |
klauss | 0:4d17cd9c8f9d | 142 | VZ_call * __find_Call__( Vector * v_call, int ext ){ |
klauss | 0:4d17cd9c8f9d | 143 | VZ_call * call = NULL; |
klauss | 0:4d17cd9c8f9d | 144 | for( register int i = 0; i < v_call->size(); i++ ){ |
klauss | 0:4d17cd9c8f9d | 145 | call = ( VZ_call * )v_call->get_element( i ); |
klauss | 0:4d17cd9c8f9d | 146 | if( call->get_cb_ext() == ext ) return( call ); |
klauss | 0:4d17cd9c8f9d | 147 | } |
klauss | 0:4d17cd9c8f9d | 148 | return( NULL ); |
klauss | 0:4d17cd9c8f9d | 149 | } |
klauss | 0:4d17cd9c8f9d | 150 | |
klauss | 0:4d17cd9c8f9d | 151 | void registry_aging( Vector * v_cb, uint8_t * data, uint8_t * write_buffer ){ |
klauss | 7:019b08223b87 | 152 | Call_Box * cb = NULL; |
klauss | 7:019b08223b87 | 153 | if( v_cb && data && write_buffer ){ |
klauss | 7:019b08223b87 | 154 | for( register int i = 0; i < v_cb->size(); i++ ){ |
klauss | 7:019b08223b87 | 155 | cb = (Call_Box * )v_cb->get_element( i ); |
klauss | 7:019b08223b87 | 156 | if( cb->is_timeout() ){ |
klauss | 7:019b08223b87 | 157 | if( cb->reconfigure_timeout() == 0x00 ){ |
klauss | 30:8dfb6d8de53d | 158 | if( debug_alive ) debug_msg("( ext %d removed )", cb->get_ext() ); |
klauss | 32:43041f5e27c4 | 159 | //cb->unregistry(); |
klauss | 30:8dfb6d8de53d | 160 | v_cb->remove_element( i ); |
klauss | 30:8dfb6d8de53d | 161 | delete( cb ); |
klauss | 7:019b08223b87 | 162 | break; |
klauss | 7:019b08223b87 | 163 | }else{ |
klauss | 31:bb5fb28a77df | 164 | if( debug_alive ) debug_msg("Ping Cbx %d", cb->get_ext() ); |
klauss | 28:94aec56c6329 | 165 | cb->set_msg_id( ( ( cb->get_msg_id() ) + 1 ) & ( BIT7 ^ 0xff ) ); |
klauss | 7:019b08223b87 | 166 | __send_to_cb__( __build_cb_package__( cb->get_ext(), cb->get_port(), __REGISTRY__, |
klauss | 7:019b08223b87 | 167 | ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); |
klauss | 7:019b08223b87 | 168 | cb->registry(); |
klauss | 7:019b08223b87 | 169 | } |
klauss | 7:019b08223b87 | 170 | } |
klauss | 7:019b08223b87 | 171 | } |
klauss | 7:019b08223b87 | 172 | } |
klauss | 0:4d17cd9c8f9d | 173 | } |
klauss | 0:4d17cd9c8f9d | 174 | |
klauss | 0:4d17cd9c8f9d | 175 | int sip_manager( Vector * v_cb, Vector * v_call, uint8_t * write_buffer ){ |
klauss | 0:4d17cd9c8f9d | 176 | static int index = 0; |
klauss | 0:4d17cd9c8f9d | 177 | if( v_cb && write_buffer ){ |
klauss | 0:4d17cd9c8f9d | 178 | if( v_cb->size() > 0 ){ |
klauss | 0:4d17cd9c8f9d | 179 | if( index >= v_cb->size() ) index = 0; |
klauss | 0:4d17cd9c8f9d | 180 | }else return 0; |
klauss | 0:4d17cd9c8f9d | 181 | Call_Box * cb = (Call_Box * )v_cb->get_element( index ); |
klauss | 0:4d17cd9c8f9d | 182 | /* Retorna |
klauss | 0:4d17cd9c8f9d | 183 | = 0 :: ok |
klauss | 0:4d17cd9c8f9d | 184 | < 0 :: tive problemas |
klauss | 0:4d17cd9c8f9d | 185 | > 0 :: devo remover essa call do vetor de calls |
klauss | 0:4d17cd9c8f9d | 186 | */ |
klauss | 0:4d17cd9c8f9d | 187 | int returned_value = 0; |
klauss | 13:ae278302dffe | 188 | |
klauss | 14:22a35f575502 | 189 | if( cb->status == cb_on_call || cb->status == cb_idle ){ |
klauss | 15:9c7456c1b6f4 | 190 | //debug_msg(""); |
klauss | 14:22a35f575502 | 191 | returned_value = cb->listen_SIP_server(); |
klauss | 14:22a35f575502 | 192 | } |
klauss | 0:4d17cd9c8f9d | 193 | index++; |
klauss | 0:4d17cd9c8f9d | 194 | return( returned_value ); |
klauss | 0:4d17cd9c8f9d | 195 | } |
klauss | 0:4d17cd9c8f9d | 196 | led1 = !led1; |
klauss | 0:4d17cd9c8f9d | 197 | return( -1 ); |
klauss | 0:4d17cd9c8f9d | 198 | } |
klauss | 0:4d17cd9c8f9d | 199 | |
klauss | 0:4d17cd9c8f9d | 200 | /* remove calls por timeout */ |
klauss | 0:4d17cd9c8f9d | 201 | void call_manager( Vector * v_call, Vector * v_cb, uint8_t * data, uint8_t * write_buffer, Timeslice * ts ){ |
klauss | 0:4d17cd9c8f9d | 202 | for( register int i = 0; i < v_call->size(); i++ ){ |
klauss | 0:4d17cd9c8f9d | 203 | VZ_call * call = ( VZ_call * )v_call->get_element( i ); |
klauss | 29:7246460b73f8 | 204 | if( call->is_timetofinish() ){ |
klauss | 0:4d17cd9c8f9d | 205 | v_call->remove_element( i ); |
klauss | 0:4d17cd9c8f9d | 206 | Call_Box * cb = __find_CB__( v_cb, call->get_cb_ext() ); |
klauss | 0:4d17cd9c8f9d | 207 | if( cb ){ |
klauss | 0:4d17cd9c8f9d | 208 | cb->status = cb_idle; |
klauss | 0:4d17cd9c8f9d | 209 | ts->return_timeslice( cb->get_timeslice() ); |
klauss | 0:4d17cd9c8f9d | 210 | cb->set_timeslice( 0x00 ); |
klauss | 0:4d17cd9c8f9d | 211 | data[ __TIMESLICE_PLACE__ ] = 0x00; |
klauss | 0:4d17cd9c8f9d | 212 | cb->set_msg_id( ( ( cb->get_msg_id() ) + 1 ) & ( BIT7 ^ 0xff ) ); |
klauss | 0:4d17cd9c8f9d | 213 | __send_to_cb__( __build_cb_package__( cb->get_ext(), cb->get_port(), __CB_BYE__, |
klauss | 0:4d17cd9c8f9d | 214 | ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); |
klauss | 0:4d17cd9c8f9d | 215 | cb->send_bye(); |
klauss | 13:ae278302dffe | 216 | set_status( cb->sip->status, sip_idle ); |
klauss | 29:7246460b73f8 | 217 | cb->re_start_timer(); |
klauss | 0:4d17cd9c8f9d | 218 | } |
klauss | 9:ffa64f38ef9c | 219 | delete( call ); |
klauss | 0:4d17cd9c8f9d | 220 | } |
klauss | 0:4d17cd9c8f9d | 221 | } |
klauss | 0:4d17cd9c8f9d | 222 | } |
klauss | 0:4d17cd9c8f9d | 223 | |
klauss | 0:4d17cd9c8f9d | 224 | void build_telemetry_report( int ext, int port, char * data ){ |
klauss | 58:af7e8788f106 | 225 | char aux[ __CB_BUFFER_SIZE__ + 6 ]; |
klauss | 53:bb492a8f115a | 226 | char tmp[ 6 ]; |
klauss | 53:bb492a8f115a | 227 | strcpy( aux, itoa( ext, tmp, 10 ) ); |
klauss | 53:bb492a8f115a | 228 | strcat( aux, " " ); |
klauss | 55:2f5e7374af9d | 229 | |
klauss | 55:2f5e7374af9d | 230 | //strncat( aux, (char * )data, __TELEMETRY_SIZE__ ); |
klauss | 55:2f5e7374af9d | 231 | |
klauss | 55:2f5e7374af9d | 232 | //pulando os bytes do clock |
klauss | 55:2f5e7374af9d | 233 | data += __CLOCK_SYNC_SIZE__; |
klauss | 55:2f5e7374af9d | 234 | //pulando o byte de id ( sequence number ) |
klauss | 55:2f5e7374af9d | 235 | data += __SEQ_NUM_SIZE__; |
klauss | 58:af7e8788f106 | 236 | |
klauss | 58:af7e8788f106 | 237 | uint8_t offset = strlen( aux ); |
klauss | 55:2f5e7374af9d | 238 | |
klauss | 58:af7e8788f106 | 239 | for( register uint16_t i = 0; i < __TELEMETRY_SIZE__; i++ ) aux[ i + offset ] = data[ i ]; |
klauss | 58:af7e8788f106 | 240 | |
klauss | 58:af7e8788f106 | 241 | for( register uint16_t i = __TELEMETRY_SIZE__ + offset; i < __CB_BUFFER_SIZE__; i++ ) aux[ i ] = 0; |
klauss | 53:bb492a8f115a | 242 | |
klauss | 54:448d57291be6 | 243 | if( debug_telemetry ){ |
klauss | 54:448d57291be6 | 244 | pc.printf("\n\r 1. "); |
klauss | 54:448d57291be6 | 245 | uint8_t count = 2; |
klauss | 54:448d57291be6 | 246 | for( register int i = 0; i < __CB_BUFFER_SIZE__; i++ ){ |
klauss | 58:af7e8788f106 | 247 | if( i > 0 && !( i % 15 ) ) pc.printf("\n\r%2i. ", count++ ); |
klauss | 58:af7e8788f106 | 248 | pc.printf("%3x ", aux[ i ] ); |
klauss | 54:448d57291be6 | 249 | } |
klauss | 54:448d57291be6 | 250 | pc.printf("\n\r"); |
klauss | 54:448d57291be6 | 251 | |
klauss | 55:2f5e7374af9d | 252 | if( tcp_session ) tcp_client.send_all( ( char *)aux, __CB_BUFFER_SIZE__ ); |
klauss | 53:bb492a8f115a | 253 | } |
klauss | 53:bb492a8f115a | 254 | |
klauss | 53:bb492a8f115a | 255 | UDPSocket t_sock; |
klauss | 53:bb492a8f115a | 256 | Endpoint t_server; |
klauss | 53:bb492a8f115a | 257 | |
klauss | 53:bb492a8f115a | 258 | int adr = t_server.set_address( __TELEMETRY_SERVER_IP__ , __TELEMETRY_SERVER_PORT__ ); |
klauss | 53:bb492a8f115a | 259 | if( debug_telemetry ) send_msg("Valor de retorno adr -- %d", adr ); |
klauss | 53:bb492a8f115a | 260 | t_sock.set_blocking( false, 1 ); |
klauss | 53:bb492a8f115a | 261 | |
klauss | 53:bb492a8f115a | 262 | int bind = t_sock.bind( __TELEMETRY_HEADER_PORT__ ); |
klauss | 53:bb492a8f115a | 263 | if( debug_telemetry ) send_msg("Valor de retorno bind -- %d", bind ); |
klauss | 56:c64bcbaa621a | 264 | |
klauss | 55:2f5e7374af9d | 265 | int ret = t_sock.sendTo( t_server, aux, __CB_BUFFER_SIZE__ ); |
klauss | 53:bb492a8f115a | 266 | if( debug_telemetry ) send_msg("Valor de retorno sent-- %d", ret ); |
klauss | 53:bb492a8f115a | 267 | |
klauss | 53:bb492a8f115a | 268 | int close = t_sock.close(); |
klauss | 53:bb492a8f115a | 269 | if( debug_telemetry ) send_msg("Valor de retorno close-- %d", close ); |
klauss | 0:4d17cd9c8f9d | 270 | } |
klauss | 0:4d17cd9c8f9d | 271 | |
klauss | 0:4d17cd9c8f9d | 272 | void __send_to_cb__( uint8_t * buffer ){ |
klauss | 0:4d17cd9c8f9d | 273 | xmemcpy( TXBuffer, buffer, DATA_SIZE ); |
klauss | 63:0d95da692bb4 | 274 | xmemcpy( cb_tx_buffer, buffer, __CB_BUFFER_SIZE__ ); |
klauss | 0:4d17cd9c8f9d | 275 | send2callboxes(); |
klauss | 62:07e5bdc9f8f7 | 276 | } |
klauss | 62:07e5bdc9f8f7 | 277 | |
klauss | 62:07e5bdc9f8f7 | 278 | int ls_comp( const void * a, const void * b ){ return( *( int * )a - *( int * )b ); } |