Put ais_charset in its own file to make building commb tests a little easier

This commit is contained in:
Oliver Jowett 2019-05-02 17:24:26 +08:00
parent 74d7ead41b
commit 1b5b0dfa03
6 changed files with 14 additions and 7 deletions

View file

@ -44,13 +44,13 @@ all: dump1090 view1090
%.o: %.c *.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o sdr_ifile.o sdr.o $(SDR_OBJ) $(COMPAT)
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o sdr_ifile.o sdr.o ais_charset.o $(SDR_OBJ) $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_SDR) -lncurses
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o $(COMPAT)
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o ais_charset.o $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) -lncurses
faup1090: faup1090.o anet.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o $(COMPAT)
faup1090: faup1090.o anet.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o ais_charset.o $(COMPAT)
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS)
clean:

3
ais_charset.c Normal file
View file

@ -0,0 +1,3 @@
#include "ais_charset.h"
char ais_charset[64] = "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ !\"#$%&'()*+,-./0123456789:;<=>?";

6
ais_charset.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef AIS_CHARSET_H
#define AIS_CHARSET_H
extern char ais_charset[64];
#endif

View file

@ -19,6 +19,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dump1090.h"
#include "ais_charset.h"
typedef int (*CommBDecoderFn)(struct modesMessage *,bool);

View file

@ -49,6 +49,7 @@
#include "dump1090.h"
#include "ais_charset.h"
/* for PRIX64 */
#include <inttypes.h>
@ -382,8 +383,6 @@ int scoreModesMessage(unsigned char *msg, int validbits)
static void decodeExtendedSquitter(struct modesMessage *mm);
char ais_charset[64] = "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ !\"#$%&'()*+,-./0123456789:;<=>?";
// return 0 if all OK
// -1: message might be valid, but we couldn't validate the CRC against a known ICAO
// -2: bad message or unrepairable CRC error

View file

@ -95,6 +95,4 @@ static inline __attribute__((always_inline)) unsigned getbits(unsigned char *da
}
}
extern char ais_charset[64];
#endif