DEFINITION MODULE loraprotocols; (* decode known lora frames *)



CONST
      MAXBW=500000.0;
      BWTAB=ARRAY OF CARDINAL {64, 48, 32, 24, 16, 12, 8, 4, 2, 1};

TYPE
     IPNUM=CARDINAL;
     UDPPORT=CARDINAL;

     pJDESTS=POINTER TO JDESTS;
     JDESTS=RECORD
       next        :pJDESTS;
       jipnum      :IPNUM;
       judpport    :UDPPORT;
     END;
    FPAR=RECORD
      level, minlev, maxlev, nf, minnf, maxnf, snr, drift:REAL;
      afchz, truedf:INTEGER;
      txd, frametime, qual, cr, cfgsf, synfilter, label, idfound, illid, fasecorrs, fecbits:CARDINAL;
      hascrc, crc, dcdlost, invers, ax25long, udpcrcok, axjoin, dcd, needsjunk:BOOLEAN;
    END;


VAR 
    bwnum       :CARDINAL;
    jsonfd,
    udpsock     :INTEGER;
    jpipename   :ARRAY[0..1023] OF CHAR;
    hamview,
    allwaysascii,
    verb,
    verb2,
    newline,
    quietcrc    :BOOLEAN;
    jmhz        :REAL;
    jdests      :pJDESTS;


PROCEDURE sendframe(text:ARRAY OF CHAR; textlen:CARDINAL;
                    fpar:FPAR;
                    axpart:ARRAY OF CHAR;
                    notchlist, finf:ARRAY OF CHAR;
                    ipnum, ipnumraw:IPNUM; udpport, udprawport:UDPPORT; udp2:BOOLEAN);

PROCEDURE senddcd(sf:INTEGER; inv, on:BOOLEAN);


END loraprotocols.

