mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-06 13:48:29 +00:00

Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / test-native (push) Waiting to run
CI / build-docker (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run
* Add unit tests for MQTT * Test received fields
39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
#pragma once
|
|
#include "Channels.h"
|
|
#include "ProtobufModule.h"
|
|
|
|
/**
|
|
* Routing module for router control messages
|
|
*/
|
|
class RoutingModule : public ProtobufModule<meshtastic_Routing>
|
|
{
|
|
public:
|
|
/** Constructor
|
|
* name is for debugging output
|
|
*/
|
|
RoutingModule();
|
|
|
|
virtual void sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex,
|
|
uint8_t hopLimit = 0);
|
|
|
|
// Given the hopStart and hopLimit upon reception of a request, return the hop limit to use for the response
|
|
uint8_t getHopLimitForResponse(uint8_t hopStart, uint8_t hopLimit);
|
|
|
|
protected:
|
|
friend class Router;
|
|
|
|
/** Called to handle a particular incoming message
|
|
|
|
@return true if you've guaranteed you've handled this message and no other handlers should be considered for it
|
|
*/
|
|
virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Routing *p) override;
|
|
|
|
/** Messages can be received that have the want_response bit set. If set, this callback will be invoked
|
|
* so that subclasses can (optionally) send a response back to the original sender. */
|
|
virtual meshtastic_MeshPacket *allocReply() override;
|
|
|
|
/// Override wantPacket to say we want to see all packets, not just those for our port number
|
|
virtual bool wantPacket(const meshtastic_MeshPacket *p) override { return true; }
|
|
};
|
|
|
|
extern RoutingModule *routingModule; |