Tree @debian/1.7.0+ds-6 (Download .tar.gz)
- .idea
- build-aux
- config.tests
- debian
- deprecated
- GPSBabel.xcodeproj
- gui
- intdoc
- jeeps
- m4
- mkicondoc
- msvc
- reference
- src
- style
- testo.d
- tools
- win32
- xmldoc
- .codacy.yaml
- .foprc
- .gitignore
- .travis.yml
- aclocal.m4
- alan.cc
- an1.cc
- an1sym.h
- appveyor.yml
- arcdist.cc
- arcdist.h
- astylerc
- AUTHORS
- bcr.cc
- bend.cc
- bend.h
- brauniger_iq.cc
- build_and_test
- bushnell.cc
- bushnell_trl.cc
- cet.cc
- cet.h
- cet_util.cc
- cet_util.h
- chkdoc
- CMakeLists.txt
- compegps.cc
- config.h.in
- configure
- configure.ac
- COPYING
- coverity_model.cc
- cst.cc
- csv_util.cc
- csv_util.h
- defs.h
- delgpl.cc
- destinator.cc
- dg-100.cc
- dg-100.h
- discard.cc
- discard.h
- dmtlog.cc
- duplicate.cc
- duplicate.h
- easygps.cc
- emptyfile
- energympro.cc
- energympro.h
- enigma.cc
- exif.cc
- explorist_ini.cc
- explorist_ini.h
- f90g_track.cc
- fatal.cc
- filter.h
- filter_vecs.cc
- filter_vecs.h
- format.h
- format_skeleton.cc
- formspec.cc
- formspec.h
- g7towin.cc
- garmin.cc
- garmin_device_xml.cc
- garmin_device_xml.h
- garmin_fit.cc
- garmin_fit.h
- garmin_fs.cc
- garmin_fs.h
- garmin_gpi.cc
- garmin_gpi.h
- garmin_icon_tables.h
- garmin_tables.cc
- garmin_tables.h
- garmin_txt.cc
- garmin_xt.cc
- gbfile.cc
- gbfile.h
- gbser.cc
- gbser.h
- gbser_posix.cc
- gbser_posix.h
- gbser_private.h
- gbser_win.cc
- gbser_win.h
- gbversion.h
- gbversion.h.in
- gdb.cc
- geo.cc
- geojson.cc
- geojson.h
- ggv_bin.cc
- ggv_bin.h
- ggv_log.cc
- ggv_ovl.cc
- globals.cc
- globalsat_sport.cc
- globalsat_sport.h
- glogbook.cc
- gnav_trl.cc
- googledir.cc
- gopal.cc
- gpsbabel-sample.ini
- GPSBabel.pro
- gpsbabel.supp
- gpsman
- gpsman2
- gpssim.cc
- gpsutil.cc
- gpx.cc
- gpx.h
- gpxval
- grtcirc.cc
- grtcirc.h
- gtm.cc
- gtrnctr.cc
- guibabel
- height.cc
- height.h
- heightgrid.h
- hiketech.cc
- holux.cc
- holux.h
- html.cc
- humminbird.cc
- igc.cc
- ignrando.cc
- igo8.cc
- ik3d.cc
- inifile.cc
- inifile.h
- internal_styles.cc
- interpolate.cc
- interpolate.h
- itracku.cc
- jogmap.cc
- jtr.cc
- kml.cc
- kml.h
- legacyformat.h
- lmx.cc
- lowranceusr.cc
- lowranceusr.h
- magellan.h
- maggeo.cc
- magproto.cc
- main.cc
- make-an1sym.pl
- Makefile.in
- mapasia.cc
- mapbar_track.cc
- mapfactor.cc
- mapsend.cc
- mapsend.h
- mkicondoc.cc
- mkshort.cc
- mkstyle.sh
- mmo.cc
- mtk_locus.cc
- mtk_logger.cc
- mynav.cc
- mynav.h
- navicache.cc
- naviguide.cc
- navilink.cc
- navilink.h
- navitel.cc
- netstumbler.cc
- NEWS
- nmea.cc
- nmea.h
- nmn4.cc
- nukedata.cc
- nukedata.h
- osm.cc
- osm.h
- ozi.cc
- parse.cc
- pcx.cc
- pocketfms_bc.cc
- pocketfms_fp.cc
- pocketfms_wp.cc
- polygon.cc
- polygon.h
- position.cc
- position.h
- ptesto
- qstarz_bl_1000.cc
- qstarz_bl_1000.h
- radius.cc
- radius.h
- random.cc
- random.h
- raymarine.cc
- README.contrib
- README.igc
- README.mapconverter
- README.md
- README.xmapwpt
- reverse_route.cc
- reverse_route.h
- rgbcolors.cc
- route.cc
- saroute.cc
- sbn.cc
- sbp.cc
- session.cc
- session.h
- shape.cc
- shape.h
- shortname.cc
- skyforce.cc
- skytraq.cc
- smplrout.cc
- smplrout.h
- sort.cc
- sort.h
- stackfilter.cc
- stackfilter.h
- stmsdf.cc
- stmwpp.cc
- strptime.c
- strptime.h
- subrip.cc
- subrip.h
- swapdata.cc
- swapdata.h
- tef_xml.cc
- teletype.cc
- test-all
- test_encoding_latin1
- test_encoding_utf8
- testc
- testo
- testw
- text.cc
- tiger.cc
- tmpro.cc
- tomtom.cc
- torture_test
- tpg.cc
- tpo.cc
- trackfilter.cc
- trackfilter.h
- transform.cc
- transform.h
- unicsv.cc
- unicsv.h
- units.cc
- units.h
- util.cc
- util_crc.cc
- v900.cc
- validate.cc
- validate.h
- vcf.cc
- vecs.cc
- vecs.h
- vidaone.cc
- vitosmt.cc
- vitovtt.cc
- vpl.cc
- vtesto
- waypt.cc
- wbt-200.cc
- wfff_xml.cc
- wintec_tes.cc
- xcsv.cc
- xcsv.h
- xcsv_tokens.gperf
- xcsv_tokens.in
- xmlgeneric.cc
- xmlgeneric.h
- xmltag.cc
- xol.cc
- yahoo.cc
- yahoo.h
sbp.cc @debian/1.7.0+ds-6 — raw · history · blame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | /* Locosys NaviGPS GT-31/BGT-31 binary datalog format (SBP) Copyright (C) 2008 Rodney Lorrimar <rodney@rodney.id.au> Copyright (C) 2005 Robert Lipe, robertlipe+source@gpsbabel.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "defs.h" #include "navilink.h" #define MYNAME "sbp" static gbfile* file_handle = nullptr; static QVector<arglist_t> sbp_args = { }; /******************************************************************************* * %%% global callbacks called by gpsbabel main process %%% * *******************************************************************************/ static void sbp_rd_init(const QString& fname) { file_handle = gbfopen(fname, "r", MYNAME); } static void sbp_rd_deinit() { gbfclose(file_handle); } static void read_sbp_header(route_head*) { /* * A complete SBP file contains 64 bytes header, * * Here is the definition of the SBP header * BYTE 0 ~1 : true SBP header length * BYTE 2~63: MID_FILE_ID(0xfd) * will stuff 0xff for remaining bytes */ #define HEADER_SKIP 7 bool success; char header[64]; if (gbfread(header, sizeof(header), 1, file_handle) == 1) { size_t len = le_read16(header) - HEADER_SKIP; if (len > sizeof(header)) { len = sizeof(header); } success = locosys_decode_file_id(header + HEADER_SKIP, len); } else { success = false; } if (!success) { fatal(MYNAME ": Format error: Couldn't read SBP header." "This probably isn't a SBP file.\n"); } } static Waypoint* read_logpoint() { unsigned char buffer[SBP_RECORD_LEN]; if (gbfread(buffer, sizeof(buffer), 1, file_handle) == 1) { return navilink_decode_logpoint(buffer); } return nullptr; } static void sbp_read() { Waypoint* logpoint; auto* track = new route_head; track_add_head(track); read_sbp_header(track); while ((logpoint = read_logpoint())) { track_add_wpt(track, logpoint); } } /**************************************************************************/ ff_vecs_t sbp_vecs = { ff_type_file, { ff_cap_none /* waypoints */, ff_cap_read /* tracks */, ff_cap_none /* routes */ }, sbp_rd_init, nullptr, sbp_rd_deinit, nullptr, sbp_read, nullptr, nullptr, &sbp_args, CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ /* not fixed, can be changed through command line parameter */ , NULL_POS_OPS, nullptr }; /**************************************************************************/ |