mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #663 from liamcottle/feature/remove-neighbour
Add CLI command to remove neighbour
This commit is contained in:
commit
d012dc7fd7
3 changed files with 25 additions and 0 deletions
|
|
@ -719,6 +719,17 @@ public:
|
|||
*dp = 0; // null terminator
|
||||
}
|
||||
|
||||
void removeNeighbor(const uint8_t* pubkey, int key_len) override {
|
||||
#if MAX_NEIGHBOURS
|
||||
for (int i = 0; i < MAX_NEIGHBOURS; i++) {
|
||||
NeighbourInfo* neighbour = &neighbours[i];
|
||||
if(memcmp(neighbour->id.pub_key, pubkey, key_len) == 0){
|
||||
neighbours[i] = NeighbourInfo(); // clear neighbour entry
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
mesh::LocalIdentity& getSelfId() override { return self_id; }
|
||||
|
||||
void clearStats() override {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue