diff --git a/software/firmware/source/SoftRF/src/platform/ESP32.h b/software/firmware/source/SoftRF/src/platform/ESP32.h index 8d60bf891..852ad74dd 100644 --- a/software/firmware/source/SoftRF/src/platform/ESP32.h +++ b/software/firmware/source/SoftRF/src/platform/ESP32.h @@ -301,6 +301,7 @@ struct rst_info { #define USE_BLE_MIDI //#define USE_GDL90_MSL #define USE_OGN_ENCRYPTION +//#define ENABLE_PROL //#define EXCLUDE_GNSS_UBLOX /* Neo-6/7/8, M10 */ #define ENABLE_UBLOX_RFS /* revert factory settings (when necessary) */ diff --git a/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp b/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp index 2af27ef6d..a0b7994b0 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp @@ -255,3 +255,48 @@ size_t aprs_encode(void *pkt, ufo_t *this_aircraft) { return aprs_proto_desc.payload_size; } + +#if defined(ENABLE_PROL) +/* + * APRS-over-LoRa + */ +const rf_proto_desc_t prol_proto_desc = { + "PRoL", + .type = RF_PROTOCOL_APRS, + .modulation_type = RF_MODULATION_TYPE_LORA, + .preamble_type = 0 /* INVALID FOR LORA */, + .preamble_size = 0 /* INVALID FOR LORA */, + .syncword = { 0x12 }, // sx127x default value, valid for PRoL + .syncword_size = 1, + .net_id = 0x0000, /* not in use */ + .payload_type = RF_PAYLOAD_DIRECT, + .payload_size = PROL_PAYLOAD_SIZE, + .payload_offset = 0, + .crc_type = RF_CHECKSUM_TYPE_NONE, /* LoRa packet has built-in CRC */ + .crc_size = 0 /* INVALID FOR LORA */, + .bitrate = DR_SF12 /* CR_5 BW_125 SF_12 */, + + .deviation = 0 /* INVALID FOR LORA */, + .whitening = RF_WHITENING_NONE, + .bandwidth = RF_RX_BANDWIDTH_SS_125KHZ, /* TBD */ + + .air_time = PROL_AIR_TIME, + + .tm_type = RF_TIMING_INTERVAL, + .tx_interval_min = PROL_TX_INTERVAL_MIN, + .tx_interval_max = PROL_TX_INTERVAL_MAX, + .slot0 = {0, 0}, + .slot1 = {0, 0} +}; + +bool prol_decode(void *pkt, ufo_t *this_aircraft, ufo_t *fop) { + + return false; +} + +size_t prol_encode(void *pkt, ufo_t *this_aircraft) { + + return 0 /* prol_proto_desc.payload_size */; +} + +#endif /* ENABLE_PROL */ diff --git a/software/firmware/source/SoftRF/src/protocol/radio/APRS.h b/software/firmware/source/SoftRF/src/protocol/radio/APRS.h index 1002b6541..247ce7424 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/APRS.h +++ b/software/firmware/source/SoftRF/src/protocol/radio/APRS.h @@ -48,4 +48,21 @@ extern const rf_proto_desc_t aprs_proto_desc; bool aprs_decode(void *, ufo_t *, ufo_t *); size_t aprs_encode(void *, ufo_t *); +#if defined(ENABLE_PROL) +/* + * APRS-over-LoRa + */ +#define PROL_PAYLOAD_SIZE AX25_MIN_FRAME_LEN /* TBD */ + +#define PROL_AIR_TIME 3000 /* 3 s */ + +#define PROL_TX_INTERVAL_MIN 60000 /* in ms, no SB support at this time */ +#define PROL_TX_INTERVAL_MAX 80000 + +extern const rf_proto_desc_t prol_proto_desc; + +bool prol_decode(void *, ufo_t *, ufo_t *); +size_t prol_encode(void *, ufo_t *); + +#endif /* ENABLE_PROL */ #endif /* PROTOCOL_APRS_H */