mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-09 21:01:39 +00:00
fallback to parameter channel value
This commit is contained in:
parent
dd1698a4f5
commit
3af831621d
@ -58,7 +58,8 @@ void NodeInfoModule::sendOurNodeInfo(NodeNum dest, bool wantReplies, uint8_t cha
|
|||||||
// If this is a broadcast over the default channel, we can safely change this to the discovery channel if defined
|
// If this is a broadcast over the default channel, we can safely change this to the discovery channel if defined
|
||||||
if (dest == NODENUM_BROADCAST && channel == 0) {
|
if (dest == NODENUM_BROADCAST && channel == 0) {
|
||||||
int8_t discoveryChannelIdx = channels.getIndexByHash((ChannelHash)USERPREFS_CONFIG_DISCOVERY_CHANNEL_HASH);
|
int8_t discoveryChannelIdx = channels.getIndexByHash((ChannelHash)USERPREFS_CONFIG_DISCOVERY_CHANNEL_HASH);
|
||||||
p->channel = discoveryChannelIdx > 0 ? discoveryChannelIdx : 0;
|
// Fallback to primary channel if discovery channel is not found by its hash
|
||||||
|
p->channel = discoveryChannelIdx > 0 ? discoveryChannelIdx : channel;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user