Skip to content

Commit e0b6361

Browse files
committed
update to 0.77, too much to show here
1 parent bc468ff commit e0b6361

File tree

10 files changed

+249
-68
lines changed

10 files changed

+249
-68
lines changed

CHANGELOG

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,42 @@
1+
0.76
2+
- TIP: para quitar la sequencias ansi al activar dest_debug
3+
o dest_screen_crc, podemos usar sed:
4+
reader_network64 example.conf | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | tee file.txt
5+
- BUG: al decodificar cat48 que iba encadenada en el mismo
6+
paquete udp, solo se decodificaba a localhost el primer
7+
datarecord, el segundo se perdía (a la función de decodifi-
8+
car ast48f se enviaban unos índices antiguos del paquete.
9+
- SOPORTE: añadido un dest_debug, para sacar por stderr el
10+
paquete que se procesa
11+
0.76
12+
- SOPORTE: añadido dest_file_nodirectory para no crear
13+
directorios con timestamp, pero si un nombre de fichero
14+
con fecha.
15+
- NO! SOPORTE: hace rejoin de los grupos mcast cada 90 segundos.
16+
Esta idea no funciona, no se puede hacer un rejoin sin cerrar
17+
el socket y perder datos.
18+
19+
0.75c
20+
- BUG: quitado el debug para corregir I048/090
21+
- BUG: reader_network falla al decodificar I048/120 (visto
22+
decodificando Tanger)
23+
24+
0.75b
25+
- BUG: reader_rrd3 no contempla I048/090 y I001/090
26+
(modo C) negativos
27+
28+
0.75a
29+
- SOPORTE: desactiva el unset de ftp_proxy para enviar a aemet
30+
- SOPORTE: habilita el continuar un upload abortado de forma
31+
automática.
32+
133
0.75
234
- BUG: el tamano del paquete se tiene en cuenta en el
335
calculo del CRC, deberia disminuir los falsos positivos.
436
- SOPORTE: uso clock_gettime instead of gettimeofday.
5-
- ADD: añadida filtersicsacout
6-
- ADD: añadido enviar versión al hacer ftp
7-
- ADD: añadido hensoldt 2 asterix
37+
- SOPORTE: añadida filtersicsacout
38+
- SOPORTE: añadido enviar versión al hacer ftp
39+
- SOPORTE: añadido hensoldt 2 asterix
840

941
0.74
1042
- SOPORTE: añadido un conversor entre GPS y versión asterix

bin/conf/example.conf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# example configuration reader_network 0.65
1+
# example configuration reader_network 0.75c
22
enabled = true
33

44
# multicast | broadcast | file
@@ -21,6 +21,9 @@ mode_scrm = true
2121
# where YY = year, MM = month, DD = day, hh = hour, mm = minutes, ss = seconds
2222
dest_file_timestamp = true
2323

24+
# don't use directory structure, only filename (needs dest_file_timestamp = true)
25+
dest_file_nodirectory = false
26+
2427
# recording file will be compressed with bzip2
2528
dest_file_compress = true
2629

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ done
128128

129129
ls -la bin/
130130

131+
#scp bin/reader_network64 10.40.210.32:/home/eval/reader_network64
132+
131133
exit
132134

133135
#old binaries

include/asterix.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ along with reader_network. If not, see <http://www.gnu.org/licenses/>.
7878
#define BDS_17 4
7979
#define BDS_30 8
8080
#define BDS_40 16
81-
#define BDS_50 32
82-
#define BDS_60 64
81+
#define BDS_44 32
82+
#define BDS_50 64
83+
#define BDS_60 128
8384

8485
#define STATUS_MODEC_GARBLED 1
8586
#define STATUS_MODEC_NOTVALIDATED 2

include/dbp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct datablock_plot {
3737
float y; // CAT20
3838
};
3939
int modea; // CAT01
40-
int modec; // CAT01
40+
int modec ; // CAT01 CAT48 (expresado en FL)
4141
int modec_status; // CAT01
4242
int modea_status; // CAT01
4343
int available; // CAT01 CAT48
@@ -59,6 +59,7 @@ struct datablock_plot {
5959
unsigned char bds_17[8];
6060
unsigned char bds_30[7];
6161
unsigned char bds_40[8];
62+
unsigned char bds_44[8];
6263
unsigned char bds_50[8];
6364
unsigned char bds_60[8];
6465
int modes_status;

include/defines.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ reader_network - A package of utilities to record and work with
33
multicast radar data in ASTERIX format. (radar as in air navigation
44
surveillance).
55
6-
Copyright (C) 2002-2019 Diego Torres <diego dot torres at gmail dot com>
6+
Copyright (C) 2002-2020 Diego Torres <diego dot torres at gmail dot com>
77
88
This file is part of the reader_network utils.
99
@@ -22,8 +22,8 @@ along with reader_network. If not, see <http://www.gnu.org/licenses/>.
2222
*/
2323

2424

25-
#define VERSION "0.75"
26-
#define COPYRIGHT_NOTICE " v%s Copyright (C) 2002 - 2019 Diego Torres\n\n" \
25+
#define VERSION "0.76"
26+
#define COPYRIGHT_NOTICE " v%s Copyright (C) 2002 - 2020 Diego Torres\n\n" \
2727
"This program comes with ABSOLUTELY NO WARRANTY.\n" \
2828
"This is free software, and you are welcome to redistribute it\n" \
2929
"under certain conditions; see COPYING file for details.\n\n"

package.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
rm distrib/rn075.tar.bz2
2-
tar cvfj distrib/rn075.tar.bz2 \
1+
rm distrib/rn077.tar.bz2
2+
tar cvfj distrib/rn077.tar.bz2 \
33
bin/client* \
44
bin/reader_network* \
55
bin/reader_rrd3* bin/cleanast* bin/scripts/* bin/conf/* bin/filter*
6-
cp distrib/rn075.tar.bz2 /home/eval
6+
cp distrib/rn077.tar.bz2 /home/eval
7+
scp distrib/rn077.tar.bz2 nemo:.

src/asterix.c

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ void decode_bds30(/*unsigned char * ptr_raw, int j, */struct datablock_plot * db
352352
if (dbp->modea_status & STATUS_MODEA_SMOOTHED) strcpy(modea_l_s, "1"); else strcpy(modea_l_s, "0");
353353
}
354354
if (dbp->available & IS_MODEC) {
355-
snprintf(modec_s, 6, "%d", dbp->modec*100);
355+
snprintf(modec_s, 6, "%d", dbp->modec);
356356
if (dbp->modec_status & STATUS_MODEC_NOTVALIDATED) strcpy(modec_v_s, "1"); else strcpy(modec_v_s, "0");
357357
if (dbp->modec_status & STATUS_MODEC_GARBLED) strcpy(modec_g_s, "1"); else strcpy(modec_g_s, "0");
358358
}
@@ -488,7 +488,16 @@ int index = 0;
488488
//log_printf(LOG_NORMAL, "modec %02X %02X\n", ptr_raw[j], ptr_raw[j+1]);
489489
dbp.modec_status |= (ptr_raw[j] & 128) ? STATUS_MODEC_NOTVALIDATED : 0;
490490
dbp.modec_status |= (ptr_raw[j] & 64) ? STATUS_MODEC_GARBLED : 0;
491-
dbp.modec = ( (ptr_raw[j] & 63)*256 + ptr_raw[j+1]) * 1.0/4.0;// * 100;
491+
// corregir porque no se hacía el complemento a 2.
492+
// dbp.modec = ( (ptr_raw[j] & 63)*256 + ptr_raw[j+1]) * 1.0/4.0;// * 100;
493+
dbp.modec = ( (ptr_raw[j] & 63)*256 + ptr_raw[j+1]);// * 1.0/4.0;// * 100;
494+
if ( dbp.modec > 8192 ) { // es negativo, hacer el complemento a 2
495+
// log_printf(LOG_NORMAL, "[%d][%d][%d] es mayor que 8192 v1\n", dbp.sac, dbp.sic, dbp.modec);
496+
dbp.modec += -16384;
497+
// log_printf(LOG_NORMAL, "[%d][%d][%d] es mayor que 8192 v2\n", dbp.sac, dbp.sic, dbp.modec);
498+
}
499+
dbp.modec *= (100.0 * 1.0/4.0); // el resultado va en FL, así que nunca habrá decimales
500+
// log_printf(LOG_NORMAL, "[%d][%d]I048/090[%02X][%02X] (%d)\n", dbp.sac, dbp.sic, ptr_raw[j], ptr_raw[j+1], dbp.modec);
492501
size_current += 2; j += 2;
493502
dbp.available |= IS_MODEC;
494503
}
@@ -1129,7 +1138,7 @@ int index = 0;
11291138
dbp.tod_stamp = current_time_today; dbp.id = id; dbp.index = index;
11301139
dbp.radar_responses = 0;
11311140

1132-
//ast_output_datablock(ptr_raw, size_datablock, dbp.id, dbp.index);
1141+
// ast_output_datablock(ptr_raw, size_datablock, dbp.id, dbp.index);
11331142
if (sizeFSPEC == 0) {
11341143
log_printf(LOG_WARNING, "ERROR_FSPEC_SIZE[%d] %s\n", sizeFSPEC, ptr_raw);
11351144
return T_ERROR;
@@ -1222,7 +1231,7 @@ unsigned char *datablock_start = NULL;
12221231
// return T_ERROR;
12231232
// }
12241233

1225-
//ast_output_datablock(ptr_raw, size_datablock - size_current - 3, id, index);
1234+
// ast_output_datablock(ptr_raw, size_datablock - size_current - 3, id, index);
12261235

12271236
datablock_start = ptr_raw;
12281237
j = sizeFSPEC;
@@ -1270,7 +1279,14 @@ unsigned char *datablock_start = NULL;
12701279
if ( ptr_raw[0] & 4 ) { /* I048/090 */
12711280
dbp.modec_status |= (ptr_raw[j] & 128) ? STATUS_MODEC_NOTVALIDATED : 0;
12721281
dbp.modec_status |= (ptr_raw[j] & 64) ? STATUS_MODEC_GARBLED : 0;
1273-
dbp.modec = ( (ptr_raw[j] & 63)*256 + ptr_raw[j+1]) * 1.0/4.0;// * 100;
1282+
dbp.modec = ( (ptr_raw[j] & 63)*256 + ptr_raw[j+1]);// * 1.0/4.0;// * 100;
1283+
if ( dbp.modec > 8192 ) { // es negativo, hacer el complemento a 2
1284+
// log_printf(LOG_NORMAL, "[%d][%d][%d] es mayor que 8192 v1\n", dbp.sac, dbp.sic, dbp.modec);
1285+
dbp.modec += -16384;
1286+
// log_printf(LOG_NORMAL, "[%d][%d][%d] es mayor que 8192 v2\n", dbp.sac, dbp.sic, dbp.modec);
1287+
}
1288+
dbp.modec *= (100.0 * 1.0/4.0); // el resultado va en FL, así que nunca habrá decimales
1289+
// log_printf(LOG_NORMAL, "[%d][%d]I048/090[%02X][%02X] (%d)\n", dbp.sac, dbp.sic, ptr_raw[j], ptr_raw[j+1], dbp.modec);
12741290
size_current += 2; j += 2;
12751291
dbp.available |= IS_MODEC;
12761292
}
@@ -1294,7 +1310,7 @@ unsigned char *datablock_start = NULL;
12941310
//char * ptr_tmp;
12951311
int i;
12961312
//ptr_tmp = (char *) mem_alloc(6*3 + 1);
1297-
//Bmemset(ptr_tmp, 0x0, 6*3 + 1);
1313+
//memset(ptr_tmp, 0x0, 6*3 + 1);
12981314
//for( i = 0; i < 6; i++ ) sprintf((char *)(ptr_tmp + i*3), "%02X ", (unsigned char) (ptr_raw[j+i]));
12991315
//log_printf(LOG_NORMAL, "I048/240[%s]\n", ptr_tmp);
13001316
//mem_free(ptr_tmp);
@@ -1342,6 +1358,7 @@ unsigned char *datablock_start = NULL;
13421358
case 0x17: ptr = dbp.bds_17; dbp.bds_available |= BDS_17; break;
13431359
case 0x30: ptr = dbp.bds_30; dbp.bds_available |= BDS_30; break;
13441360
case 0x40: ptr = dbp.bds_40; dbp.bds_available |= BDS_40; break;
1361+
case 0x44: ptr = dbp.bds_44; dbp.bds_available |= BDS_44; break;
13451362
case 0x50: ptr = dbp.bds_50; dbp.bds_available |= BDS_50; break;
13461363
case 0x60: ptr = dbp.bds_60; dbp.bds_available |= BDS_60; break;
13471364
default:
@@ -1372,9 +1389,11 @@ unsigned char *datablock_start = NULL;
13721389
if ( ptr_raw[2] & 16 ) { /* I048/100 */ j += 4; size_current += 4; }
13731390
if ( ptr_raw[2] & 8 ) { /* I048/110 */ j += 2; size_current += 2; }
13741391
if ( ptr_raw[2] & 4 ) { /* I048/120 */
1392+
// log_printf(LOG_NORMAL, "[%02X%02X%02X]\n", ptr_raw[j],ptr_raw[j+1],ptr_raw[j+2] );
13751393
int k = j;
13761394
if ( ptr_raw[k] & 128 ) { j += 2; size_current += 2; }
13771395
if ( ptr_raw[k] & 64 ) { int l = j; j += ptr_raw[l]*6 + 1; size_current += ptr_raw[l]*6 + 1; }
1396+
j++; size_current++;
13781397
}
13791398
if ( ptr_raw[2] & 2 ) { /* I048/230 */
13801399
// log_printf(LOG_ERROR, "en I048/230\n");

0 commit comments

Comments
 (0)