2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Name: config.h
|
|
|
|
*
|
|
|
|
* Purpose:
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
*
|
|
|
|
*-----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H 1
|
|
|
|
|
|
|
|
#include "audio.h" /* for struct audio_s */
|
|
|
|
#include "digipeater.h" /* for struct digi_config_s */
|
2016-11-20 19:58:51 +00:00
|
|
|
#include "cdigipeater.h" /* for struct cdigi_config_s */
|
2015-07-27 00:35:07 +00:00
|
|
|
#include "aprs_tt.h" /* for struct tt_config_s */
|
|
|
|
#include "igate.h" /* for struct igate_config_s */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* All the leftovers.
|
|
|
|
* This wasn't thought out. It just happened.
|
|
|
|
*/
|
|
|
|
|
2016-07-03 22:09:34 +00:00
|
|
|
enum beacon_type_e { BEACON_IGNORE, BEACON_POSITION, BEACON_OBJECT, BEACON_TRACKER, BEACON_CUSTOM, BEACON_IGATE };
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
enum sendto_type_e { SENDTO_XMIT, SENDTO_IGATE, SENDTO_RECV };
|
|
|
|
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
#define MAX_BEACONS 30
|
|
|
|
|
|
|
|
struct misc_config_s {
|
|
|
|
|
2015-09-07 23:56:20 +00:00
|
|
|
int agwpe_port; /* Port number for the "AGW TCPIP Socket Interface" */
|
2017-05-03 21:41:37 +00:00
|
|
|
int kiss_port; /* Port number for the "TCP KISS" protocol. */
|
2015-07-27 00:35:07 +00:00
|
|
|
int enable_kiss_pt; /* Enable pseudo terminal for KISS. */
|
|
|
|
/* Want this to be off by default because it hangs */
|
|
|
|
/* after a while if nothing is reading from other end. */
|
|
|
|
|
2017-05-03 21:41:37 +00:00
|
|
|
char kiss_serial_port[20];
|
|
|
|
/* Serial port name for our end of the */
|
2015-07-27 00:35:07 +00:00
|
|
|
/* virtual null modem for native Windows apps. */
|
2017-05-03 21:41:37 +00:00
|
|
|
/* Version 1.5 add same capability for Linux. */
|
|
|
|
|
|
|
|
int kiss_serial_speed; /* Speed, in bps, for the KISS serial port. */
|
|
|
|
/* If 0, just leave what was already there. */
|
|
|
|
|
|
|
|
int kiss_serial_poll; /* When using Bluetooth KISS, the /dev/rfcomm0 device */
|
|
|
|
/* will appear and disappear as the remote application */
|
|
|
|
/* opens and closes the virtual COM port. */
|
|
|
|
/* When this is non-zero, we will check periodically to */
|
|
|
|
/* see if the device has appeared and we will open it. */
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
char gpsnmea_port[20]; /* Serial port name for reading NMEA sentences from GPS. */
|
|
|
|
/* e.g. COM22, /dev/ttyACM0 */
|
2016-03-20 23:23:09 +00:00
|
|
|
/* Currently no option for setting non-standard speed. */
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
char gpsd_host[20]; /* Host for gpsd server. */
|
|
|
|
/* e.g. localhost, 192.168.1.2 */
|
|
|
|
|
|
|
|
int gpsd_port; /* Port number for gpsd server. */
|
|
|
|
/* Default is 2947. */
|
|
|
|
|
2016-03-20 23:23:09 +00:00
|
|
|
|
|
|
|
char waypoint_port[20]; /* Serial port name for sending NMEA waypoint sentences */
|
|
|
|
/* to a GPS map display or other mapping application. */
|
2015-11-08 01:57:02 +00:00
|
|
|
/* e.g. COM22, /dev/ttyACM0 */
|
2016-03-20 23:23:09 +00:00
|
|
|
/* Currently no option for setting non-standard speed. */
|
|
|
|
|
|
|
|
int waypoint_formats; /* Which sentence formats should be generated? */
|
|
|
|
|
|
|
|
#define WPT_FORMAT_NMEA_GENERIC 0x01 /* N $GPWPT */
|
|
|
|
#define WPT_FORMAT_GARMIN 0x02 /* G $PGRMW */
|
|
|
|
#define WPT_FORMAT_MAGELLAN 0x04 /* M $PMGNWPL */
|
|
|
|
#define WPT_FORMAT_KENWOOD 0x08 /* K $PKWDWPL */
|
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2017-06-17 23:39:59 +00:00
|
|
|
int log_daily_names; /* True to generate new log file each day. */
|
|
|
|
|
|
|
|
char log_path[80]; /* Either directory or full file name depending on above. */
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
int sb_configured; /* TRUE if SmartBeaconing is configured. */
|
|
|
|
int sb_fast_speed; /* MPH */
|
|
|
|
int sb_fast_rate; /* seconds */
|
|
|
|
int sb_slow_speed; /* MPH */
|
|
|
|
int sb_slow_rate; /* seconds */
|
|
|
|
int sb_turn_time; /* seconds */
|
|
|
|
int sb_turn_angle; /* degrees */
|
|
|
|
int sb_turn_slope; /* degrees * MPH */
|
|
|
|
|
2016-11-20 19:58:51 +00:00
|
|
|
// AX.25 connected mode.
|
|
|
|
|
|
|
|
int frack; /* Number of seconds to wait for ack to transmission. */
|
|
|
|
|
|
|
|
int retry; /* Number of times to retry before giving up. */
|
|
|
|
|
|
|
|
int paclen; /* Max number of bytes in information part of frame. */
|
|
|
|
|
|
|
|
int maxframe_basic; /* Max frames to send before ACK. mod 8 "Window" size. */
|
|
|
|
|
|
|
|
int maxframe_extended; /* Max frames to send before ACK. mod 128 "Window" size. */
|
|
|
|
|
|
|
|
int maxv22; /* Maximum number of unanswered SABME frames sent before */
|
|
|
|
/* switching to SABM. This is to handle the case of an old */
|
|
|
|
/* TNC which simply ignores SABME rather than replying with FRMR. */
|
|
|
|
|
2017-06-01 00:07:52 +00:00
|
|
|
char **v20_addrs; /* Stations known to understand only AX.25 v2.0 so we don't */
|
|
|
|
/* waste time trying v2.2 first. */
|
|
|
|
|
|
|
|
int v20_count; /* Number of station addresses in array above. */
|
2016-11-20 19:58:51 +00:00
|
|
|
|
2018-07-02 16:18:23 +00:00
|
|
|
char **noxid_addrs; /* Stations known not to understand XID command so don't */
|
|
|
|
/* waste time sending it and eventually giving up. */
|
|
|
|
/* AX.25 for Linux is the one known case, so far, where */
|
|
|
|
/* SABME is implemented but XID is not. */
|
|
|
|
|
|
|
|
int noxid_count; /* Number of station addresses in array above. */
|
|
|
|
|
2016-11-20 19:58:51 +00:00
|
|
|
|
|
|
|
// Beacons.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
int num_beacons; /* Number of beacons defined. */
|
|
|
|
|
|
|
|
struct beacon_s {
|
|
|
|
|
|
|
|
enum beacon_type_e btype; /* Position or object. */
|
|
|
|
|
|
|
|
int lineno; /* Line number from config file for later error messages. */
|
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
enum sendto_type_e sendto_type;
|
|
|
|
|
|
|
|
/* SENDTO_XMIT - Usually beacons go to a radio transmitter. */
|
|
|
|
/* chan, below is the channel number. */
|
|
|
|
/* SENDTO_IGATE - Send to IGate, probably to announce my position */
|
|
|
|
/* rather than relying on someone else to hear */
|
|
|
|
/* me on the radio and report me. */
|
|
|
|
/* SENDTO_RECV - Pretend this was heard on the specified */
|
|
|
|
/* radio channel. Mostly for testing. It is a */
|
|
|
|
/* convenient way to send packets to attached apps. */
|
|
|
|
|
|
|
|
int sendto_chan; /* Transmit or simulated receive channel for above. Should be 0 for IGate. */
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
int delay; /* Seconds to delay before first transmission. */
|
|
|
|
|
2017-06-11 20:57:43 +00:00
|
|
|
int slot; /* Seconds after hour for slotted time beacons. */
|
|
|
|
/* If specified, it overrides any 'delay' value. */
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
int every; /* Time between transmissions, seconds. */
|
|
|
|
/* Remains fixed for PBEACON and OBEACON. */
|
|
|
|
/* Dynamically adjusted for TBEACON. */
|
|
|
|
|
|
|
|
time_t next; /* Unix time to transmit next one. */
|
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
char *dest; /* NULL or explicit AX.25 destination to use */
|
|
|
|
/* instead of the software version such as APDW11. */
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
int compress; /* Use more compact form? */
|
|
|
|
|
|
|
|
char objname[10]; /* Object name. Any printable characters. */
|
|
|
|
|
|
|
|
char *via; /* Path, e.g. "WIDE1-1,WIDE2-1" or NULL. */
|
|
|
|
|
|
|
|
char *custom_info; /* Info part for handcrafted custom beacon. */
|
|
|
|
/* Ignore the rest below if this is set. */
|
|
|
|
|
2015-09-07 23:56:20 +00:00
|
|
|
char *custom_infocmd; /* Command to generate info part. */
|
|
|
|
/* Again, other options below are then ignored. */
|
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
int messaging; /* Set messaging attribute for position report. */
|
|
|
|
/* i.e. Data Type Indicator of '=' rather than '!' */
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
double lat; /* Latitude and longitude. */
|
|
|
|
double lon;
|
2017-06-15 01:57:34 +00:00
|
|
|
int ambiguity; /* Number of lower digits to trim from location. 0 (default), 1, 2, 3, 4. */
|
2015-07-27 01:05:48 +00:00
|
|
|
float alt_m; /* Altitude in meters. */
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
char symtab; /* Symbol table: / or \ or overlay character. */
|
|
|
|
char symbol; /* Symbol code. */
|
|
|
|
|
|
|
|
float power; /* For PHG. */
|
|
|
|
float height;
|
|
|
|
float gain; /* Original protocol spec was unclear. */
|
|
|
|
/* Addendum 1.1 clarifies it is dBi not dBd. */
|
|
|
|
|
|
|
|
char dir[3]; /* 1 or 2 of N,E,W,S, or empty for omni. */
|
|
|
|
|
|
|
|
float freq; /* MHz. */
|
|
|
|
float tone; /* Hz. */
|
|
|
|
float offset; /* MHz. */
|
|
|
|
|
|
|
|
char *comment; /* Comment or NULL. */
|
2015-09-07 23:56:20 +00:00
|
|
|
char *commentcmd; /* Command to append more to Comment or NULL. */
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
} beacon[MAX_BEACONS];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define MIN_IP_PORT_NUMBER 1024
|
|
|
|
#define MAX_IP_PORT_NUMBER 49151
|
|
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_AGWPE_PORT 8000 /* Like everyone else. */
|
|
|
|
#define DEFAULT_KISS_PORT 8001 /* Above plus 1. */
|
|
|
|
|
|
|
|
|
|
|
|
#define DEFAULT_NULLMODEM "COM3" /* should be equiv. to /dev/ttyS2 on Cygwin */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern void config_init (char *fname, struct audio_s *p_modem,
|
|
|
|
struct digi_config_s *digi_config,
|
2016-11-20 19:58:51 +00:00
|
|
|
struct cdigi_config_s *cdigi_config,
|
2015-07-27 00:35:07 +00:00
|
|
|
struct tt_config_s *p_tt_config,
|
|
|
|
struct igate_config_s *p_igate_config,
|
|
|
|
struct misc_config_s *misc_config);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* CONFIG_H */
|
|
|
|
|
|
|
|
/* end config.h */
|
|
|
|
|
|
|
|
|