mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-05 22:42:08 +00:00
Merge pull request #2213 from meshtastic/repeater-role
Start of repeater role with in firmware
This commit is contained in:
commit
9d2fbec511
@ -190,7 +190,6 @@ bool GPS::setupGPS()
|
||||
// Switch to Vehicle Mode, since SoftRF enables Aviation < 2g
|
||||
_serial_gps->write("$PCAS11,3*1E\r\n");
|
||||
delay(250);
|
||||
|
||||
} else if (gnssModel == GNSS_MODEL_UBLOX) {
|
||||
|
||||
/*
|
||||
@ -429,6 +428,10 @@ void GPS::publishUpdate()
|
||||
|
||||
int32_t GPS::runOnce()
|
||||
{
|
||||
// Repeaters have no need for GPS
|
||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER)
|
||||
disable();
|
||||
|
||||
if (whileIdle()) {
|
||||
// if we have received valid NMEA claim we are connected
|
||||
setConnected();
|
||||
|
@ -310,6 +310,10 @@ void setup()
|
||||
// but we need to do this after main cpu iniot (esp32setup), because we need the random seed set
|
||||
nodeDB.init();
|
||||
|
||||
// If we're taking on the repeater role, use flood router
|
||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER)
|
||||
router = new FloodingRouter();
|
||||
|
||||
playStartMelody();
|
||||
|
||||
// fixed screen override?
|
||||
|
@ -367,7 +367,6 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
||||
{
|
||||
// If the packet is not yet encrypted, do so now
|
||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded);
|
||||
|
||||
// Only allow encryption on the text message app.
|
||||
|
@ -73,9 +73,6 @@ class Router : protected concurrency::OSThread
|
||||
*/
|
||||
void enqueueReceivedMessage(meshtastic_MeshPacket *p);
|
||||
|
||||
protected:
|
||||
friend class RoutingModule;
|
||||
|
||||
/**
|
||||
* Send a packet on a suitable interface. This routine will
|
||||
* later free() the packet to pool. This routine is not allowed to stall.
|
||||
@ -85,6 +82,9 @@ class Router : protected concurrency::OSThread
|
||||
*/
|
||||
virtual ErrorCode send(meshtastic_MeshPacket *p);
|
||||
|
||||
protected:
|
||||
friend class RoutingModule;
|
||||
|
||||
/**
|
||||
* Should this incoming filter be dropped?
|
||||
*
|
||||
|
@ -33,6 +33,7 @@
|
||||
*/
|
||||
void setupModules()
|
||||
{
|
||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||
#if HAS_BUTTON
|
||||
inputBroker = new InputBroker();
|
||||
#endif
|
||||
@ -78,6 +79,10 @@ void setupModules()
|
||||
externalNotificationModule = new ExternalNotificationModule();
|
||||
#endif
|
||||
|
||||
// NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra acks
|
||||
// NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra
|
||||
// acks
|
||||
} else {
|
||||
adminModule = new AdminModule();
|
||||
}
|
||||
routingModule = new RoutingModule();
|
||||
}
|
||||
|
@ -24,6 +24,8 @@ bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mesh
|
||||
|
||||
meshtastic_MeshPacket *RoutingModule::allocReply()
|
||||
{
|
||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER)
|
||||
return NULL;
|
||||
assert(currentRequest);
|
||||
|
||||
// We only consider making replies if the request was a legit routing packet (not just something we were sniffing)
|
||||
|
Loading…
Reference in New Issue
Block a user