FLEX TX: pager transmitter with long address support (1600/2FSK) (#3132)

External app for encoding and transmitting FLEX pager frames at
1600bps/2FSK. Supports short (1-1,933,312) and long (2,101,249-
4,297,068,542) addresses across all encoding sets (1-2, 1-3/1-4, 2-3).

Message types:
- Alphanumeric (vector type 5): 7-bit chars, signature, K checksum
- Standard Numeric (vector type 3): 4-bit BCD, K checksum
- Short/tone-only (vector type 2): space-filled BCD in vector word
- Short numeric (vector type 2): BCD digits in vector word (3/8 digits)

Frame structure:
- FIW (Frame Information Word): cycle, frame, roaming flag
- BIW (Block Information Word) support with up to 3 extra words:
  Date, Time, SysInfo/timezone+DST, SSID1 (Simulcast System ID:
  Local ID + Coverage Zone), SSID2 (Country Code)
- BCH(31,21) encoding with bit reversal, block interleaving
- Two frames per TX: message R=1 (new) then R=0 (duplicate)
- Message number N (0-63): random seed from RTC, auto-increments
- ERS (Emergency Re-Sync) burst: configurable N x 42-cycle bursts
  with 8-cycle preamble per frame

UI:
- Capcode info line: address type, computed frame/phase (reference)
- TX status: step counter with ERS/frame progress
- Set params view: Date/Time/TZ/DST, LocID/CovZone, CountryCode,
  Roaming, message number, ERS count
- Date/time auto-populated from RTC with calendar-equivalent year
  mapping for years beyond 2025 (per ARIB STD-43A)
- Year validation with equiv-year popup for out-of-range values
- Capcode and BIW flags persisted via SettingsManager

Serial interface:
- sendflex <capcode> <type> <msglen> + payload
- Types: 0=alpha, 1=numeric, 2=short/tone, 3=short numeric
- FlexTosendMessage (ID 103) for serial-to-app communication
- App must be open to receive serial commands
This commit is contained in:
VasylSamoilov
2026-04-10 12:17:52 +03:00
committed by GitHub
parent cf44076a34
commit 4dce613172
7 changed files with 1292 additions and 0 deletions
+21
View File
@@ -160,6 +160,7 @@ class Message {
P25TxConfigure = 102,
ToneDetectData = 103,
ToneDetectConfig = 104,
FlexTosend = 105,
MAX
};
@@ -1884,4 +1885,24 @@ class ToneDetectConfigureMessage : public Message {
uint32_t ctcss_freq_x10{0}; // CTCSS frequency × 10 (e.g. 1000 = 100.0 Hz); 0 = None
};
class FlexTosendMessage : public Message {
public:
constexpr FlexTosendMessage(
uint64_t capcode = 0,
uint8_t type = 0,
uint8_t msglen = 0,
const uint8_t* msg = nullptr)
: Message{ID::FlexTosend},
capcode{capcode},
type{type},
msglen{msglen} {
if (msg)
memcpy(this->msg, msg, 240);
}
uint64_t capcode = 0;
uint8_t type = 0;
uint8_t msglen = 0;
uint8_t msg[240] = {0};
};
#endif /*__MESSAGE_H__*/