Skip to content

Commit f0e79f7

Browse files
authored
Add rx device info frame as response to pings (ExpressLRS#1021)
CRSF defines a message called CRSF_FRAMETYPE_DEVICE_PING. This message allows to ping all devices (also called broadcast) or a certain device. If a device receives a ping it should respond with a CRSF_FRAMETYPE_DEVICE_INFO message. The tx module already responds to this message for the lua script support. With ExpressLRS#997 our lua script also shows other devices but the rx did not get listed since it did not respond to the ping message. This PR adds the device name for the rx targets and adds two responses to pings: ping received from tx module (from the lua script): reply OTA ping received from FC (needed for ardupilot): reply via UART The method to generate the device info frame is moved in the crsf class and both tx+rx use the same method. To inject the device info frame in the usual telemetry buffer a change in the logic was needed. The device info response of the FC would overwrite the device info response of the rx so the telemetry class makes sure that different buffers are used depending on the sender of a message.
1 parent 8852dda commit f0e79f7

46 files changed

Lines changed: 263 additions & 81 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/include/target/BETAFPV_2400_RX.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define DEVICE_NAME "BETAFPV 2400RX"
12
// GPIO pin definitions
23
#define GPIO_PIN_NSS 15
34
#define GPIO_PIN_BUSY 5

src/include/target/BETAFPV_2400_TX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define TX_DEVICE_NAME "BETAFPV 2400TX"
1+
#define DEVICE_NAME "BETAFPV 2400TX"
22

33
// There is some special handling for this target
44
#define TARGET_TX_BETAFPV_2400_V1

src/include/target/BETAFPV_900_TX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define TX_DEVICE_NAME "BETAFPV 900TX"
1+
#define DEVICE_NAME "BETAFPV 900TX"
22

33
// There is some special handling for this target
44
#define TARGET_TX_BETAFPV_900_V1

src/include/target/DIY_2400_RX_ESP8285_SX1280.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define DEVICE_NAME "ELRS 2400RX"
12
// GPIO pin definitions
23
#define GPIO_PIN_NSS 15
34
#define GPIO_PIN_BUSY 5
@@ -11,4 +12,4 @@
1112
#define GPIO_PIN_ANTENNA_SELECT 0 // Low = Ant1, High = Ant2, pulled high by external resistor
1213
#endif
1314

14-
// Output Power - use default SX1280
15+
// Output Power - use default SX1280

src/include/target/DIY_2400_RX_STM32_CCG_Nano_v0_5.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define DEVICE_NAME "ELRS 2400RX"
12
// GPIO pin definitions
23
#define GPIO_PIN_NSS PA4
34
#define GPIO_PIN_MOSI PA7

src/include/target/DIY_2400_TX_ESP32_SX1280_E28.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#if !defined(TX_DEVICE_NAME)
2-
#define TX_DEVICE_NAME "DIY2400 E28"
1+
#if !defined(DEVICE_NAME)
2+
#define DEVICE_NAME "DIY2400 E28"
33
#endif
44

55
// GPIO pin definitions

src/include/target/DIY_2400_TX_ESP32_SX1280_LORA1280F27.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define TX_DEVICE_NAME "DIY2400 F27"
1+
#define DEVICE_NAME "DIY2400 F27"
22

33
// Output Power
44
#define MinPower PWR_10mW

src/include/target/DIY_2400_TX_ESP32_SX1280_Mini.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define TX_DEVICE_NAME "DIY2400 Mini"
1+
#define DEVICE_NAME "DIY2400 Mini"
22

33
// GPIO pin definitions
44
#define GPIO_PIN_NSS 5

src/include/target/DIY_2400_TX_ESP8285_SX1280.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define TX_DEVICE_NAME "DIY2400 ESP8266"
1+
#define DEVICE_NAME "DIY2400 ESP8266"
22

33
// GPIO pin definitions
44
#define GPIO_PIN_NSS 15

src/include/target/DIY_900_RX_ESP8285_SX127x.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define DEVICE_NAME "ELRS 900RX"
12
// GPIO pin definitions
23
#define GPIO_PIN_NSS 15
34
#define GPIO_PIN_DIO0 4

0 commit comments

Comments
 (0)