kopia lustrzana https://github.com/meshtastic/firmware
Merge branch 'master' into master
commit
eddc202799
|
@ -341,5 +341,8 @@ jobs:
|
|||
with:
|
||||
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
artifacts-branch: artifacts
|
||||
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
|
||||
artifacts-repo: meshtastic/artifacts
|
||||
artifacts-branch: device
|
||||
artifacts-dir: pr
|
||||
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
|
||||
|
|
|
@ -48,6 +48,14 @@ bool FloodingRouter::inRangeOfRouter()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool FloodingRouter::isPacketLocal(const MeshPacket *p)
|
||||
{
|
||||
|
||||
// TODO: Figure out if a packet is from a local node
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c)
|
||||
{
|
||||
bool rebroadcastPacket = true;
|
||||
|
@ -55,10 +63,18 @@ void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c)
|
|||
if (radioConfig.preferences.role == Role_Repeater || radioConfig.preferences.role == Role_Router) {
|
||||
rebroadcastPacket = true;
|
||||
|
||||
} else if ((radioConfig.preferences.role == Role_Default) && inRangeOfRouter()) {
|
||||
DEBUG_MSG("Role_Default - rx_snr > 13\n");
|
||||
} else if ((radioConfig.preferences.role == Role_Default)) {
|
||||
|
||||
rebroadcastPacket = false;
|
||||
|
||||
if (inRangeOfRouter()) {
|
||||
// In Range of a router
|
||||
rebroadcastPacket = false;
|
||||
|
||||
} else if (!isPacketLocal(p)) {
|
||||
// The packet did not come from a local source
|
||||
rebroadcastPacket = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ((p->to == NODENUM_BROADCAST) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum() && rebroadcastPacket)) {
|
||||
|
|
|
@ -60,6 +60,14 @@ class FloodingRouter : public Router, protected PacketHistory
|
|||
*/
|
||||
virtual bool inRangeOfRouter();
|
||||
|
||||
/**
|
||||
* Is the packet from a device that is physically near this node?
|
||||
*
|
||||
* Calculated based on the received SNR.
|
||||
* @return true if the received packet is physically close to this node.
|
||||
*/
|
||||
virtual bool isPacketLocal(const MeshPacket *p);
|
||||
|
||||
/**
|
||||
* Look for broadcasts we need to rebroadcast
|
||||
*/
|
||||
|
|
Ładowanie…
Reference in New Issue