mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-08 06:35:38 +00:00

Some checks failed
CI / setup (check) (push) Has been cancelled
CI / setup (esp32) (push) Has been cancelled
CI / setup (esp32c3) (push) Has been cancelled
CI / setup (esp32c6) (push) Has been cancelled
CI / setup (esp32s3) (push) Has been cancelled
CI / setup (nrf52840) (push) Has been cancelled
CI / setup (rp2040) (push) Has been cancelled
CI / setup (rp2350) (push) Has been cancelled
CI / setup (stm32) (push) Has been cancelled
CI / version (push) Has been cancelled
CI / build-debian-src (push) Has been cancelled
CI / package-pio-deps-native-tft (push) Has been cancelled
CI / test-native (push) Has been cancelled
CI / docker-deb-amd64 (push) Has been cancelled
CI / docker-deb-amd64-tft (push) Has been cancelled
CI / docker-alp-amd64 (push) Has been cancelled
CI / docker-alp-amd64-tft (push) Has been cancelled
CI / docker-deb-arm64 (push) Has been cancelled
CI / docker-deb-armv7 (push) Has been cancelled
CI / check (push) Has been cancelled
CI / build-esp32 (push) Has been cancelled
CI / build-esp32s3 (push) Has been cancelled
CI / build-esp32c3 (push) Has been cancelled
CI / build-esp32c6 (push) Has been cancelled
CI / build-nrf52840 (push) Has been cancelled
CI / build-rp2040 (push) Has been cancelled
CI / build-rp2350 (push) Has been cancelled
CI / build-stm32 (push) Has been cancelled
CI / gather-artifacts (esp32) (push) Has been cancelled
CI / gather-artifacts (esp32c3) (push) Has been cancelled
CI / gather-artifacts (esp32c6) (push) Has been cancelled
CI / gather-artifacts (esp32s3) (push) Has been cancelled
CI / gather-artifacts (nrf52840) (push) Has been cancelled
CI / gather-artifacts (rp2040) (push) Has been cancelled
CI / gather-artifacts (rp2350) (push) Has been cancelled
CI / gather-artifacts (stm32) (push) Has been cancelled
CI / release-artifacts (push) Has been cancelled
CI / release-firmware (esp32) (push) Has been cancelled
CI / release-firmware (esp32c3) (push) Has been cancelled
CI / release-firmware (esp32c6) (push) Has been cancelled
CI / release-firmware (esp32s3) (push) Has been cancelled
CI / release-firmware (nrf52840) (push) Has been cancelled
CI / release-firmware (rp2040) (push) Has been cancelled
CI / release-firmware (rp2350) (push) Has been cancelled
CI / release-firmware (stm32) (push) Has been cancelled
CI / publish-firmware (push) Has been cancelled
* treewide: make 'ifdef DEBUG_PORT' guards also take into account DEBUG_MUTE * stm32wl: Add a guard against having debug prints turned on without PIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF defined --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
#include "TextMessageModule.h"
|
|
#include "MeshService.h"
|
|
#include "NodeDB.h"
|
|
#include "PowerFSM.h"
|
|
#include "buzz.h"
|
|
#include "configuration.h"
|
|
#include "graphics/Screen.h"
|
|
TextMessageModule *textMessageModule;
|
|
|
|
ProcessMessage TextMessageModule::handleReceived(const meshtastic_MeshPacket &mp)
|
|
{
|
|
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE)
|
|
auto &p = mp.decoded;
|
|
LOG_INFO("Received text msg from=0x%0x, id=0x%x, msg=%.*s", mp.from, mp.id, p.payload.size, p.payload.bytes);
|
|
#endif
|
|
// We only store/display messages destined for us.
|
|
// Keep a copy of the most recent text message.
|
|
devicestate.rx_text_message = mp;
|
|
devicestate.has_rx_text_message = true;
|
|
|
|
// Only trigger screen wake if configuration allows it
|
|
if (shouldWakeOnReceivedMessage()) {
|
|
powerFSM.trigger(EVENT_RECEIVED_MSG);
|
|
}
|
|
notifyObservers(&mp);
|
|
|
|
return ProcessMessage::CONTINUE; // Let others look at this message also if they want
|
|
}
|
|
|
|
bool TextMessageModule::wantPacket(const meshtastic_MeshPacket *p)
|
|
{
|
|
return MeshService::isTextPayload(p);
|
|
} |