Skip to content

Commit

Permalink
infra for APRS-over-LoRa option
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Aug 21, 2023
1 parent e0e18ed commit ebb87f9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions software/firmware/source/SoftRF/src/platform/ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
45 changes: 45 additions & 0 deletions software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
17 changes: 17 additions & 0 deletions software/firmware/source/SoftRF/src/protocol/radio/APRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit ebb87f9

Please sign in to comment.