diff --git a/documents/images/ham-7.jpg b/documents/images/ham-7.jpg new file mode 100644 index 000000000..d8c5032fa Binary files /dev/null and b/documents/images/ham-7.jpg differ diff --git a/documents/images/ham-8.jpg b/documents/images/ham-8.jpg new file mode 100644 index 000000000..453a159c2 Binary files /dev/null and b/documents/images/ham-8.jpg differ diff --git a/software/firmware/source/SoftRF/src/driver/RF.h b/software/firmware/source/SoftRF/src/driver/RF.h index 9ed5c43d9..3a9eeec27 100644 --- a/software/firmware/source/SoftRF/src/driver/RF.h +++ b/software/firmware/source/SoftRF/src/driver/RF.h @@ -102,10 +102,10 @@ typedef struct Slot_descr_struct { } Slot_descr_t; typedef struct Slots_descr_struct { - uint16_t interval_min; - uint16_t interval_max; - uint16_t interval_mid; - uint16_t adj; + uint32_t interval_min; + uint32_t interval_max; + uint32_t interval_mid; + uint32_t adj; uint16_t air_time; Slot_descr_t s0; Slot_descr_t s1; diff --git a/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp b/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp index 02696f7d0..6d6e43934 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp @@ -28,6 +28,9 @@ #include "../../../SoftRF.h" #include "../../driver/RF.h" +/* + * Classic APRS + */ const rf_proto_desc_t aprs_proto_desc = { "APRS", .type = RF_PROTOCOL_APRS, @@ -57,6 +60,38 @@ const rf_proto_desc_t aprs_proto_desc = { .slot1 = {0, 0} }; +/* + * 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 = APRS_PAYLOAD_SIZE, + .payload_offset = PROL_PAYLOAD_OFFSET, + .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} +}; + static const char *AprsIcon[16] = // Icons for various FLARM acftType's { "/z", // 0 = ? "/'", // 1 = (moto-)glider (most frequent) @@ -194,22 +229,6 @@ bool ax25_decode(void *pkt, ufo_t *this_aircraft, ufo_t *fop) { return aprs_decode((void *) tnc2.c_str(), this_aircraft, fop); } -static void nmea_lat(float lat, char *buf) -{ - int lat_int = (int) lat; - float lat_dec = lat - lat_int; - - sprintf(buf, "%02d%05.2f%c", abs(lat_int), fabsf(lat_dec * 60), lat < 0 ? 'S' : 'N'); -} - -static void nmea_lon(float lon, char *buf) -{ - int lon_int = (int) lon; - float lon_dec = lon - lon_int; - - sprintf(buf, "%03d%05.2f%c", abs(lon_int), fabsf(lon_dec * 60), lon < 0 ? 'W' : 'E'); -} - size_t aprs_encode(void *pkt, ufo_t *this_aircraft) { char buf[APRS_PAYLOAD_SIZE]; @@ -240,7 +259,6 @@ size_t aprs_encode(void *pkt, ufo_t *this_aircraft) { float lon_dec = lon - lon_int; snprintf(buf, sizeof(buf), -// "<\xff\x01" "%06X>%s:" "/" "%02d%02d%02dh" @@ -258,38 +276,6 @@ size_t aprs_encode(void *pkt, ufo_t *this_aircraft) { (altitude_i < 0) ? 0 : altitude_i, /* feet */ id | (XX << 24)); - memcpy((void *) pkt, buf, strlen(buf)); - return strlen(buf); + strcpy((char *) pkt, buf); + return strlen(buf) + 1; } - -/* - * 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 = APRS_PAYLOAD_SIZE, - .payload_offset = PROL_PAYLOAD_OFFSET, - .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} -}; diff --git a/software/firmware/source/SoftRF/src/protocol/radio/APRS.h b/software/firmware/source/SoftRF/src/protocol/radio/APRS.h index 9a580ba93..2d8d78897 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/APRS.h +++ b/software/firmware/source/SoftRF/src/protocol/radio/APRS.h @@ -35,7 +35,7 @@ #define APRS_AIR_TIME 3000 /* 3 s */ #define APRS_TX_INTERVAL_MIN 60000 /* in ms, no SB nor LBT support at this time */ -#define APRS_TX_INTERVAL_MAX 65500 /* TBD: 80000 */ +#define APRS_TX_INTERVAL_MAX 80000 typedef struct { @@ -57,7 +57,7 @@ size_t aprs_encode(void *, ufo_t *); #define PROL_AIR_TIME 4600 /* 4.6 s */ #define PROL_TX_INTERVAL_MIN 60000 /* in ms, no SB nor LBT support at this time */ -#define PROL_TX_INTERVAL_MAX 65500 /* TBD: 80000 */ +#define PROL_TX_INTERVAL_MAX 80000 extern const rf_proto_desc_t prol_proto_desc; diff --git a/software/firmware/source/SoftRF/src/protocol/radio/ES1090.cpp b/software/firmware/source/SoftRF/src/protocol/radio/ES1090.cpp index 53d31ca6e..ee9c86f06 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/ES1090.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/ES1090.cpp @@ -1,6 +1,6 @@ /* - * * Protocol_ES1090.cpp + * * Decoder for Extended Squitter 1090 MHz ADS-B radio protocol * Copyright (C) 2021-2023 Linar Yusupov * diff --git a/software/firmware/source/SoftRF/src/protocol/radio/OGNTP.cpp b/software/firmware/source/SoftRF/src/protocol/radio/OGNTP.cpp index 98cabe413..899d8a286 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/OGNTP.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/OGNTP.cpp @@ -1,6 +1,6 @@ /* - * * Protocol_OGNTP.cpp + * * Encoder and decoder for Open Glider Network tracker radio protocol * Copyright (C) 2017-2023 Linar Yusupov * diff --git a/software/firmware/source/SoftRF/src/protocol/radio/P3I.cpp b/software/firmware/source/SoftRF/src/protocol/radio/P3I.cpp index e2e6aec85..e7bdfe8d5 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/P3I.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/P3I.cpp @@ -1,6 +1,6 @@ /* - * * Protocol_P3I.cpp + * * Encoder and decoder for PilotAware P3I radio protocol * Copyright (C) 2017-2023 Linar Yusupov * diff --git a/software/firmware/source/SoftRF/src/protocol/radio/UAT978.cpp b/software/firmware/source/SoftRF/src/protocol/radio/UAT978.cpp index f4fa9df29..f102eb4ff 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/UAT978.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/UAT978.cpp @@ -1,6 +1,6 @@ /* - * * Protocol_UAT978.cpp + * * Decoder for UAT 978 MHz ADS-B radio protocol * Copyright (C) 2019-2023 Linar Yusupov * diff --git a/software/firmware/source/libraries/arduino-basicmac/src/protocol.h b/software/firmware/source/libraries/arduino-basicmac/src/protocol.h index b4a597d5d..d47f7a1b3 100644 --- a/software/firmware/source/libraries/arduino-basicmac/src/protocol.h +++ b/software/firmware/source/libraries/arduino-basicmac/src/protocol.h @@ -137,8 +137,8 @@ typedef struct RF_PROTOCOL { uint16_t air_time; uint8_t tm_type; - uint16_t tx_interval_min; - uint16_t tx_interval_max; + uint32_t tx_interval_min; + uint32_t tx_interval_max; tslot_t slot0; tslot_t slot1; } rf_proto_desc_t; diff --git a/software/firmware/source/libraries/arduino-lmic/src/protocol.h b/software/firmware/source/libraries/arduino-lmic/src/protocol.h index b4a597d5d..d47f7a1b3 100644 --- a/software/firmware/source/libraries/arduino-lmic/src/protocol.h +++ b/software/firmware/source/libraries/arduino-lmic/src/protocol.h @@ -137,8 +137,8 @@ typedef struct RF_PROTOCOL { uint16_t air_time; uint8_t tm_type; - uint16_t tx_interval_min; - uint16_t tx_interval_max; + uint32_t tx_interval_min; + uint32_t tx_interval_max; tslot_t slot0; tslot_t slot1; } rf_proto_desc_t;