* misc fixes
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user