Skip to content

Commit

Permalink
new psk connection
Browse files Browse the repository at this point in the history
  • Loading branch information
JvanKatwijk committed Jun 29, 2022
1 parent c99a765 commit 65aeb35
Show file tree
Hide file tree
Showing 38 changed files with 4,200 additions and 85 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ the spectrum from "classical" spectrum view to "waterfall" (and back).
This feature applies to both the display showing the full spectrum as
the display showing the "decoder" spectrum.

--------------------------------------------------------------------------
New: ft8 decoder
--------------------------------------------------------------------------

One of the new elements in the implementation is the addition of a
decoder for FT8 data. See the section on FT*

--------------------------------------------------------------------------
Device selection
--------------------------------------------------------------------------
Expand Down Expand Up @@ -187,15 +194,27 @@ The decoder has three control elements

* the indicator for the search range, selectable to 5.5 KHz

The current version has as option sending (some parts of) the messages to
the pskreporter, i.e. using the decoder as "Monitor", the map on pskreporter.info will then show you as "monitor".

The pskreporter (see report.pskreporter.info) obviously wants to know
who is sending the data, so there is a possibility to fill in your
callsign (I do not have a callsign, not being a "real" amateur, but I have an official number as "listener", obtained from the VERON, the association of radio amateurs in the Netherlands), the maiddenhead grid indication of your locatio
(which helps the pskreportet to position your description on the map) and
the antenna.
* Touching the "set identity" button will show a small form
where these data can be filled in).

* the psk reporter can be switched on and off, if switched on and
the software could initialize the connection to the psk reporter site
the label is colored greem.

* a file button for selecting a file where the received messages are stored.

Note: the decoder is experimental and will definitely not catch all transmitted messages.

![swradio-8](/swradio-ft8-widget.png?raw=true)

In the current version one can set a **callsign** and a **home grid**,
if these are set, the decoder will upload details to the PSKReporter,
so you can see yourself as monitor on the PSKreporter map.

-------------------------------------------------------------------------
a note on the weatherfax decoder
Expand Down
127 changes: 127 additions & 0 deletions decoders/ft8-decoder-win/PSKReporter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#pragma once

// Main header file for the external interface to the PSK Reporter API
// For documentation see http://psk.gladstonefamily.net/PSKReporterAPI.pdf

/*
Copyright (c) 2008 Philip Gladstone
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/


#ifdef _DLL_OPTION_PSKREPORTER_EXPORT
#define DllImportExport __declspec ( dllexport )
#else
#define DllImportExport __declspec ( dllimport )
#endif


#ifdef __cplusplus
extern "C" {
#endif

#define REPORTER_SOURCE_MASK 0x07
#define REPORTER_SOURCE_AUTOMATIC 0x01
#define REPORTER_SOURCE_LOG 0x02
#define REPORTER_SOURCE_MANUAL 0x03
#define REPORTER_SOURCE_TENTATIVE 0x40
#define REPORTER_SOURCE_TEST 0x80

typedef struct {
wchar_t hostname[256];
wchar_t port[32];
bool connected;
unsigned int callsigns_sent;
unsigned int callsigns_buffered;
unsigned int callsigns_discarded;
unsigned int last_send_time;
unsigned int next_send_time;
wchar_t last_callsign_queued[24];
unsigned int bytes_sent;
unsigned int bytes_sent_total;
unsigned int packets_sent;
unsigned int packets_sent_total;
} REPORTER_STATISTICS;




unsigned long DllImportExport __cdecl ReporterInitialize(
const wchar_t *hostname,
const wchar_t *port
);

unsigned long DllImportExport __cdecl ReporterSeenCallsign(
const wchar_t *remoteInformation,
const wchar_t *localInformation,
unsigned long flags
);

unsigned long DllImportExport __cdecl ReporterTickle(
);

unsigned long DllImportExport __cdecl ReporterGetInformation(
wchar_t *buffer,
unsigned long maxlen
);

unsigned long DllImportExport __cdecl ReporterGetStatistics(
REPORTER_STATISTICS *buffer,
unsigned long maxlen
);

unsigned long DllImportExport __cdecl ReporterUninitialize(
);


unsigned long DllImportExport __stdcall ReporterInitializeSTD(
const char *hostname,
const char *port
);

unsigned long DllImportExport __stdcall ReporterSeenCallsignSTD(
const char *remoteInformation,
const char *localInformation,
unsigned long flags
);

unsigned long DllImportExport __stdcall ReporterTickleSTD(
);

unsigned long DllImportExport __stdcall ReporterGetInformationSTD(
char *buffer,
unsigned long maxlen
);

unsigned long DllImportExport __stdcall ReporterGetStatisticsSTD(
REPORTER_STATISTICS *buffer,
unsigned long maxlen
);

unsigned long DllImportExport __stdcall ReporterUninitializeSTD(
);

#ifdef __cplusplus
}
#endif


64 changes: 64 additions & 0 deletions decoders/ft8-decoder-win/cache.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
/*
* Copyright (C) 2010, 2011, 2012, 2013
* Jan van Katwijk ([email protected])
* Lazy Chair Programming
*
* This file is part of swradio
*
* swradio 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.
*
* swradio 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 swradio; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//
// to be included by the main program of the decoder

#include <stdint.h>
#include <complex>

class Cache {
private:
int nrows;
int ncolums;
std::complex<float> **data;

public:
Cache (int16_t ncolums, int16_t nrows) {
int16_t i;

this -> ncolums = ncolums;
this -> nrows = nrows;
data = new std::complex<float> *[nrows];
for (i = 0; i < nrows; i++)
data [i] = new std::complex<float> [ncolums];
fprintf (stderr, "new cache with %d rows and %d colums\n",
nrows, ncolums);
}

~Cache (void) {
int i;
for (i = 0; i < nrows; i ++)
delete[] data [i];

delete[] data;
}

std::complex<float> *cacheLine (int16_t n) {
return data [n];
}

std::complex<float> cacheElement (int16_t line, int16_t element) {
return data [line] [element];
}
};

83 changes: 83 additions & 0 deletions decoders/ft8-decoder-win/dl-cache.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#
/*
* Copyright (C) 2010, 2011, 2012, 2013
* Jan van Katwijk ([email protected])
* Lazy Chair Computing
*
* This file is part of swradio
*
* swradio 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.
*
* swradio 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 swradio; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __DL_CACHE__
#define __DL_CACHE__

#include <string>
#include <vector>
typedef struct {
float strength;
float frequency;
std::string theMessage;
} cacheElement;

class dlCache {
private:
std::vector<cacheElement> cache;
int p;
int size;
#define CACHE_SIZE 32
#define CACHE_MASK (CACHE_SIZE - 1)
public:
dlCache (int size) {
(void)size;
cache. resize (CACHE_SIZE);
this -> size = CACHE_SIZE;
p = 0;
}

~dlCache () {
}

void add (const std::string &s,
float strength, float frequency) {
cache [p]. strength = strength;
cache [p]. frequency = frequency;
cache [p]. theMessage = s;
p = (p + 1) & CACHE_MASK;
}

bool update (float strength,
float frequency, const std::string &s) {
for (uint16_t i = p; i < p + CACHE_SIZE; i ++) {
if (cache [i & CACHE_MASK]. theMessage == s) {
if (cache [i & CACHE_MASK]. strength < strength) {
for (uint16_t j = i; j < (p - 1) + CACHE_SIZE; j ++)
cache [j & CACHE_MASK] = cache [(j + 1) & CACHE_MASK];
cache [(p - 1 + CACHE_SIZE) & CACHE_MASK]. theMessage = s;
cache [(p - 1 + CACHE_SIZE) & CACHE_MASK]. strength = strength;
cache [(p - 1 + CACHE_SIZE) & CACHE_MASK]. frequency =
frequency;

}
return true;
}
}
cache [p]. theMessage = s;
cache [p]. strength = strength;
cache [p]. frequency = frequency;
p = (p + 1) & CACHE_MASK;
return false;
}
};
#endif
Loading

0 comments on commit 65aeb35

Please sign in to comment.