master
Hannes Matuschek 11 years ago
parent 36ac8d3cc1
commit 907527a7f9

@ -0,0 +1,41 @@
#include "wavfile.hh"
#include "autocast.hh"
#include "interpolate.hh"
#include "fsk.hh"
#include "aprs.hh"
#include "utils.hh"
using namespace sdr;
int main(int argc, char *argv[]) {
if (2 > argc) { std::cout << "USAGE: sdr_afsk1200 FILENAME" << std::endl; return -1; }
sdr::Logger::get().addHandler(
new sdr::StreamLogHandler(std::cerr, sdr::LOG_DEBUG));
Queue &queue = Queue::get();
WavSource src(argv[1], 1024);
if (! src.isOpen()) { std::cout << "Can not open file " << argv[1] << std::endl; return -1; }
AutoCast< int16_t > cast;
FSKDetector demod(1200, 1200, 2200);
BitStream bits(1200, BitStream::TRANSITION);
APRS decode;
src.connect(&cast);
cast.connect(&demod);
demod.connect(&bits);
bits.connect(&decode);
Queue::get().addIdle(&src, &WavSource::next);
src.addEOS(&queue, &Queue::stop);
Queue::get().start();
Queue::get().wait();
return 0;
}

@ -140,12 +140,8 @@ APRS::Message::Message(const AX25::Message &msg)
return;
}
if (_hasTime) {
if (! _readTime(offset)) { return; }
}
if (_hasLocation) {
if (! _readLocation(offset)) { return; }
}
if (_hasTime && (! _readTime(offset))) { _hasTime = false; _hasLocation = false; return; }
if (_hasLocation && (! _readLocation(offset))) { _hasLocation = false; return; }
// Remaining text is comment
if (offset < _payload.size()) {
_comment = _payload.substr(offset);
@ -153,6 +149,7 @@ APRS::Message::Message(const AX25::Message &msg)
}
}
bool
APRS::Message::_readLocation(size_t &offset) {
// Read latitude

Loading…
Cancel
Save