2 * Copyright © 2012 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 #include <ao_telemetry.h>
26 #define AO_GPS_NUM_SAT_MASK (0xf << 0)
27 #define AO_GPS_NUM_SAT_SHIFT (0)
29 #define AO_GPS_VALID (1 << 4)
30 #define AO_GPS_RUNNING (1 << 5)
31 #define AO_GPS_DATE_VALID (1 << 6)
32 #define AO_GPS_COURSE_VALID (1 << 7)
34 struct ao_telemetry_location ao_gps_data;
35 struct ao_telemetry_satellite ao_gps_tracking_data;
39 typedef int16_t (*ao_radio_fill_func)(uint8_t *buffer, int16_t len);
44 ao_aprs_bit(uint8_t bit)
47 printf ("%6d %d\n", seq++, bit ? 1 : 0);
51 ao_aprs_bit(uint8_t bit)
53 putchar (bit ? 0xc0 : 0x40);
58 ao_radio_send_aprs(ao_radio_fill_func fill);
63 * @section copyright_sec Copyright
65 * Copyright (c) 2001-2009 Michael Gray, KD7LMO
70 * @section gpl_sec GNU General Public License
72 * This program is free software; you can redistribute it and/or modify
73 * it under the terms of the GNU General Public License as published by
74 * the Free Software Foundation; either version 2 of the License, or
75 * (at your option) any later version.
77 * This program is distributed in the hope that it will be useful,
78 * but WITHOUT ANY WARRANTY; without even the implied warranty of
79 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80 * GNU General Public License for more details.
82 * You should have received a copy of the GNU General Public License
83 * along with this program; if not, write to the Free Software
84 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
93 int samples = secs * 9600;
100 // This is where we go after reset.
101 int main(int argc, char **argv)
105 ao_gps_data.latitude = (45.0 + 28.25 / 60.0) * 10000000;
106 ao_gps_data.longitude = (-(122 + 44.2649 / 60.0)) * 10000000;
107 ao_gps_data.altitude = 84;
108 ao_gps_data.flags = (AO_GPS_VALID|AO_GPS_RUNNING);
110 /* Transmit one packet */
113 tncBuffer[strlen((char *) tncBuffer) - 2] = '\0';
114 fprintf(stderr, "packet: %s\n", tncBuffer);
120 ao_radio_send_aprs(ao_radio_fill_func fill)
124 uint8_t buf[16], *b, c;
128 len = (*fill)(buf, sizeof (buf));
136 for (bit = 0; bit < 8; bit++) {
137 ao_aprs_bit(c & 0x80);