Clarify comment wording: 1 = direct (0 hops)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,5 +30,5 @@ struct NodePrefs { // persisted to file
|
|||||||
uint8_t autoadd_config; // bitmask for auto-add contacts config
|
uint8_t autoadd_config; // bitmask for auto-add contacts config
|
||||||
uint8_t client_repeat;
|
uint8_t client_repeat;
|
||||||
uint8_t path_hash_mode; // which path mode to use when sending
|
uint8_t path_hash_mode; // which path mode to use when sending
|
||||||
uint8_t autoadd_max_hops; // 0 = no limit, 1 = direct only, N = up to N-1 hops (max 63)
|
uint8_t autoadd_max_hops; // 0 = no limit, 1 = direct (0 hops), N = up to N-1 hops (max 63)
|
||||||
};
|
};
|
||||||
@@ -141,7 +141,7 @@ void BaseChatMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check hop limit for new contacts (0 = no limit, 1 = direct only, N = up to N-1 hops)
|
// check hop limit for new contacts (0 = no limit, 1 = direct (0 hops), N = up to N-1 hops)
|
||||||
uint8_t max_hops = getAutoAddMaxHops();
|
uint8_t max_hops = getAutoAddMaxHops();
|
||||||
if (max_hops > 0 && packet->getPathHashCount() >= max_hops) {
|
if (max_hops > 0 && packet->getPathHashCount() >= max_hops) {
|
||||||
ContactInfo ci;
|
ContactInfo ci;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ protected:
|
|||||||
virtual bool shouldAutoAddContactType(uint8_t type) const { return true; }
|
virtual bool shouldAutoAddContactType(uint8_t type) const { return true; }
|
||||||
virtual void onContactsFull() {};
|
virtual void onContactsFull() {};
|
||||||
virtual bool shouldOverwriteWhenFull() const { return false; }
|
virtual bool shouldOverwriteWhenFull() const { return false; }
|
||||||
virtual uint8_t getAutoAddMaxHops() const { return 0; } // 0 = no limit, 1 = direct only, N = up to N-1 hops
|
virtual uint8_t getAutoAddMaxHops() const { return 0; } // 0 = no limit, 1 = direct (0 hops), N = up to N-1 hops
|
||||||
virtual void onContactOverwrite(const uint8_t* pub_key) {};
|
virtual void onContactOverwrite(const uint8_t* pub_key) {};
|
||||||
virtual void onDiscoveredContact(ContactInfo& contact, bool is_new, uint8_t path_len, const uint8_t* path) = 0;
|
virtual void onDiscoveredContact(ContactInfo& contact, bool is_new, uint8_t path_len, const uint8_t* path) = 0;
|
||||||
virtual ContactInfo* processAck(const uint8_t *data) = 0;
|
virtual ContactInfo* processAck(const uint8_t *data) = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user