mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* misc fixes
This commit is contained in:
parent
112b360ef4
commit
2715058eb2
2 changed files with 11 additions and 1 deletions
|
|
@ -327,6 +327,7 @@ void SensorMesh::applyContactPermissions(const uint8_t* pubkey, uint16_t perms)
|
||||||
memset(c, 0, sizeof(*c));
|
memset(c, 0, sizeof(*c));
|
||||||
} else {
|
} else {
|
||||||
c->permissions = perms; // update their permissions
|
c->permissions = perms; // update their permissions
|
||||||
|
self_id.calcSharedSecret(c->shared_secret, pubkey);
|
||||||
}
|
}
|
||||||
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY); // trigger saveContacts()
|
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY); // trigger saveContacts()
|
||||||
}
|
}
|
||||||
|
|
@ -464,6 +465,15 @@ void SensorMesh::handleCommand(uint32_t sender_timestamp, char* command, char* r
|
||||||
strcpy(reply, "Err - bad pubkey");
|
strcpy(reply, "Err - bad pubkey");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (sender_timestamp == 0 && strcmp(command, "getperm") == 0) {
|
||||||
|
Serial.println("Permissions:");
|
||||||
|
for (int i = 0; i < num_contacts; i++) {
|
||||||
|
auto c = &contacts[i];
|
||||||
|
|
||||||
|
mesh::Utils::printHex(Serial, c->id.pub_key, PUB_KEY_SIZE);
|
||||||
|
Serial.printf(" %04X\n", c->permissions);
|
||||||
|
}
|
||||||
|
reply[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
_cli.handleCommand(sender_timestamp, command, reply); // common CLI commands
|
_cli.handleCommand(sender_timestamp, command, reply); // common CLI commands
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ void halt() {
|
||||||
while (1) ;
|
while (1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char command[80];
|
static char command[120];
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue