JS8Call-Improved master
Loading...
Searching...
No Matches
JS8.h File Reference

Core JS8 namespace types, Costas arrays and decoder event payloads. More...

#include <QObject>
#include <QSemaphore>
#include <QThread>
#include <array>
#include <functional>
#include <string>
#include <variant>
Include dependency graph for JS8.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JS8::Event::DecodeStarted
 Emitted when the decode process starts with the configured submodes. More...
struct  JS8::Event::SyncStart
 Indicate start of a sync window. More...
struct  JS8::Event::SyncState
 Sync state update emitted during candidate evaluation. More...
struct  JS8::Event::Decoded
 Decoded frame payload emitted when a frame is successfully decoded. More...
struct  JS8::Event::DecodeFinished
class  JS8::Decoder
 High-level QObject controller that owns the decoding worker thread. More...

Typedefs

using JS8::Costas::Array = std::array<std::array<int, 7>, 3>
using JS8::Event::Variant
using JS8::Event::Emitter = std::function<void(Variant const &)>

Enumerations

enum class  JS8::Costas::Type { ORIGINAL , MODIFIED }
 Costas array helpers used to map symbols to tones. More...

Functions

void JS8::encode (int type, Costas::Array const &costas, const char *message, int *tones)
 Encode a NUL-terminated message into tone indices using a Costas array.

Variables

constexpr auto JS8::Costas::array
 Return the Costas array for the requested Type.

Detailed Description

Core JS8 namespace types, Costas arrays and decoder event payloads.

Defines the JS8 namespace, Costas array helpers, event payload structures used by the decoder, and the Decoder QObject wrapper type.

Typedef Documentation

◆ Array

using JS8::Costas::Array = std::array<std::array<int, 7>, 3>

3x7 Costas array type.

◆ Emitter

using JS8::Event::Emitter = std::function<void(Variant const &)>

Function type used to receive decoder events.

◆ Variant

Initial value:
std::variant<DecodeStarted, SyncStart, SyncState, Decoded, DecodeFinished>

Variant encompassing all decoder event payloads.

Enumeration Type Documentation

◆ Type

enum class JS8::Costas::Type
strong

Costas array helpers used to map symbols to tones.

JS8 historically re-used the Costas arrays from FT8 for the "normal" mode; other JS8 modes use modified arrays. Callers request the appropriate array via Costas::array(type).

Function Documentation

◆ encode()

void JS8::encode ( int type,
Costas::Array const & costas,
const char * message,
int * tones )

Encode a NUL-terminated message into tone indices using a Costas array.

Parameters
typeMode selector (interpreted as Costas::Type).
costasCostas array to use for encoding.
messageNUL-terminated input message string.
tonesOutput buffer to receive computed tone indices (caller-owned).

Variable Documentation

◆ array

auto JS8::Costas::array
constexpr
Initial value:
= [] {
constexpr auto COSTAS =
std::array{std::array{std::array{4, 2, 5, 6, 1, 3, 0},
std::array{4, 2, 5, 6, 1, 3, 0},
std::array{4, 2, 5, 6, 1, 3, 0}},
std::array{std::array{0, 6, 2, 3, 5, 4, 1},
std::array{1, 5, 0, 2, 3, 6, 4},
std::array{2, 5, 0, 6, 4, 1, 3}}};
return [COSTAS](Type type) -> Array const & {
return COSTAS[static_cast<std::underlying_type_t<Type>>(type)];
};
}()
Type
Costas array helpers used to map symbols to tones.
Definition JS8.h:31

Return the Costas array for the requested Type.

Parameters
typeSelector indicating ORIGINAL or MODIFIED Costas.
Returns
Const reference to the selected Costas Array.