mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
Deprecate Router Client role (and make it Client) (#4201)
This commit is contained in:
parent
6f3d7ca4d2
commit
20c1d71214
@ -22,7 +22,6 @@ bool FloodingRouter::shouldFilterReceived(const meshtastic_MeshPacket *p)
|
|||||||
if (wasSeenRecently(p)) { // Note: this will also add a recent packet record
|
if (wasSeenRecently(p)) { // Note: this will also add a recent packet record
|
||||||
printPacket("Ignoring incoming msg we've already seen", p);
|
printPacket("Ignoring incoming msg we've already seen", p);
|
||||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER &&
|
if (config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER &&
|
||||||
config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT &&
|
|
||||||
config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||||
// cancel rebroadcast of this message *if* there was already one, unless we're a router/repeater!
|
// cancel rebroadcast of this message *if* there was already one, unless we're a router/repeater!
|
||||||
Router::cancelSending(p->from, p->id);
|
Router::cancelSending(p->from, p->id);
|
||||||
|
@ -261,7 +261,6 @@ uint32_t RadioInterface::getTxDelayMsecWeighted(float snr)
|
|||||||
uint8_t CWsize = map(snr, SNR_MIN, SNR_MAX, CWmin, CWmax);
|
uint8_t CWsize = map(snr, SNR_MIN, SNR_MAX, CWmin, CWmax);
|
||||||
// LOG_DEBUG("rx_snr of %f so setting CWsize to:%d\n", snr, CWsize);
|
// LOG_DEBUG("rx_snr of %f so setting CWsize to:%d\n", snr, CWsize);
|
||||||
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
|
||||||
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT ||
|
|
||||||
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||||
delay = random(0, 2 * CWsize) * slotTimeMsec;
|
delay = random(0, 2 * CWsize) * slotTimeMsec;
|
||||||
LOG_DEBUG("rx_snr found in packet. As a router, setting tx delay:%d\n", delay);
|
LOG_DEBUG("rx_snr found in packet. As a router, setting tx delay:%d\n", delay);
|
||||||
|
@ -388,6 +388,10 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
|||||||
LOG_DEBUG("Tried to set node_info_broadcast_secs too low, setting to %d\n", min_node_info_broadcast_secs);
|
LOG_DEBUG("Tried to set node_info_broadcast_secs too low, setting to %d\n", min_node_info_broadcast_secs);
|
||||||
config.device.node_info_broadcast_secs = min_node_info_broadcast_secs;
|
config.device.node_info_broadcast_secs = min_node_info_broadcast_secs;
|
||||||
}
|
}
|
||||||
|
// Router Client is deprecated; Set it to client
|
||||||
|
if (c.payload_variant.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT) {
|
||||||
|
config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case meshtastic_Config_position_tag:
|
case meshtastic_Config_position_tag:
|
||||||
LOG_INFO("Setting config: Position\n");
|
LOG_INFO("Setting config: Position\n");
|
||||||
|
@ -319,8 +319,8 @@ ProcessMessage StoreForwardModule::handleReceived(const meshtastic_MeshPacket &m
|
|||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
if (moduleConfig.store_forward.enabled) {
|
if (moduleConfig.store_forward.enabled) {
|
||||||
|
|
||||||
// The router node should not be sending messages as a client. Unless he is a ROUTER_CLIENT
|
// The router node should not be sending messages as a client
|
||||||
if ((getFrom(&mp) != nodeDB->getNodeNum()) || (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT)) {
|
if ((getFrom(&mp) != nodeDB->getNodeNum())) {
|
||||||
|
|
||||||
if ((mp.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) && is_server) {
|
if ((mp.decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) && is_server) {
|
||||||
auto &p = mp.decoded;
|
auto &p = mp.decoded;
|
||||||
|
Loading…
Reference in New Issue
Block a user