diff --git a/lib/MSP/msptypes.h b/lib/MSP/msptypes.h index 2c05fbb5..94b9ad47 100644 --- a/lib/MSP/msptypes.h +++ b/lib/MSP/msptypes.h @@ -50,6 +50,7 @@ #define MSP_ELRS_BACKPACK_SET_OSD_ELEMENT 0x030C #define MSP_ELRS_BACKPACK_SET_HEAD_TRACKING 0x030D // enable/disable head-tracking forwarding packets to the TX #define MSP_ELRS_BACKPACK_SET_RTC 0x030E +#define MSP_ELRS_BACKPACK_SET_DVR_NAME 0x030F // incoming, packets originating from the VRx #define MSP_ELRS_BACKPACK_SET_MODE 0x0380 // enable wifi/binding mode diff --git a/src/Vrx_main.cpp b/src/Vrx_main.cpp index e9921275..d84d98a2 100644 --- a/src/Vrx_main.cpp +++ b/src/Vrx_main.cpp @@ -245,6 +245,12 @@ void ProcessMSPPacket(mspPacket_t *packet) DBGLN("Processing MSP_ELRS_SET_OSD..."); vrxModule.SetOSD(packet); break; + case MSP_ELRS_BACKPACK_SET_DVR_NAME: + DBGLN("Processing MSP_ELRS_BACKPACK_SET_DVR_NAME..."); + // Race label for the goggles to name the next DVR recording with; + // forwarded verbatim over the goggle serial link + vrxModule.ForwardPacket(packet); + break; case MSP_ELRS_BACKPACK_SET_HEAD_TRACKING: DBGLN("Processing MSP_ELRS_BACKPACK_SET_HEAD_TRACKING..."); headTrackingEnabled = packet->readByte(); diff --git a/src/module_base.cpp b/src/module_base.cpp index 989eb4e3..4fbd20a3 100644 --- a/src/module_base.cpp +++ b/src/module_base.cpp @@ -39,6 +39,11 @@ ModuleBase::SetOSD(mspPacket_t *packet) { } +void +ModuleBase::ForwardPacket(mspPacket_t *packet) +{ +} + void ModuleBase::SendHeadTrackingEnableCmd(bool enable) { @@ -165,6 +170,13 @@ MSPModuleBase::Loop(uint32_t now) } +// Pass a packet through to the connected device (e.g. the goggles) verbatim +void +MSPModuleBase::ForwardPacket(mspPacket_t *packet) +{ + msp.sendPacket(packet, m_port); +} + void MSPModuleBase::sendResponse(uint16_t function, const uint8_t *response, uint32_t responseSize) { diff --git a/src/module_base.h b/src/module_base.h index cace5ab6..44fe18e3 100644 --- a/src/module_base.h +++ b/src/module_base.h @@ -11,6 +11,7 @@ class ModuleBase void SendIndexCmd(uint8_t index); void SetRecordingState(uint8_t recordingState, uint16_t delay); void SetOSD(mspPacket_t *packet); + void ForwardPacket(mspPacket_t *packet); void SendHeadTrackingEnableCmd(bool enable); void SetRTC(); void SendLinkTelemetry(uint8_t *rawCrsfPacket); @@ -24,6 +25,7 @@ class MSPModuleBase : public ModuleBase public: MSPModuleBase(Stream *port) : m_port(port) {}; void Loop(uint32_t); + void ForwardPacket(mspPacket_t *packet); void sendResponse(uint16_t function, const uint8_t *response, uint32_t responseSize);