Wouter Bijen
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
12 additions and
3 deletions
-
examples/simple_repeater/MyMesh.cpp
-
examples/simple_room_server/MyMesh.cpp
-
examples/simple_sensor/SensorMesh.cpp
|
|
|
@ -117,7 +117,10 @@ uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secr |
|
|
|
} |
|
|
|
|
|
|
|
MESH_DEBUG_PRINTLN("Login success!"); |
|
|
|
client->last_timestamp = sender_timestamp; |
|
|
|
// NOTE: don't update last_timestamp here - login uses companion RTC which may differ
|
|
|
|
// from the app clock used for messages. Mixing the two causes silent message rejection
|
|
|
|
// when the companion RTC runs ahead of the app clock (see #1551).
|
|
|
|
// Login replay protection is already handled by hasSeen() in the mesh layer.
|
|
|
|
client->last_activity = getRTCClock()->getCurrentTime(); |
|
|
|
client->permissions &= ~0x03; |
|
|
|
client->permissions |= perms; |
|
|
|
|
|
|
|
@ -346,7 +346,10 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m |
|
|
|
} |
|
|
|
|
|
|
|
MESH_DEBUG_PRINTLN("Login success!"); |
|
|
|
client->last_timestamp = sender_timestamp; |
|
|
|
// NOTE: don't update last_timestamp here - login uses companion RTC which may differ
|
|
|
|
// from the app clock used for messages. Mixing the two causes silent message rejection
|
|
|
|
// when the companion RTC runs ahead of the app clock (see #1551).
|
|
|
|
// Login replay protection is already handled by hasSeen() in the mesh layer.
|
|
|
|
client->extra.room.sync_since = sender_sync_since; |
|
|
|
client->extra.room.pending_ack = 0; |
|
|
|
client->extra.room.push_failures = 0; |
|
|
|
|
|
|
|
@ -355,7 +355,10 @@ uint8_t SensorMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* |
|
|
|
} |
|
|
|
|
|
|
|
MESH_DEBUG_PRINTLN("Login success!"); |
|
|
|
client->last_timestamp = sender_timestamp; |
|
|
|
// NOTE: don't update last_timestamp here - login uses companion RTC which may differ
|
|
|
|
// from the app clock used for messages. Mixing the two causes silent message rejection
|
|
|
|
// when the companion RTC runs ahead of the app clock (see #1551).
|
|
|
|
// Login replay protection is already handled by hasSeen() in the mesh layer.
|
|
|
|
client->last_activity = getRTCClock()->getCurrentTime(); |
|
|
|
client->permissions |= PERM_ACL_ADMIN; |
|
|
|
memcpy(client->shared_secret, secret, PUB_KEY_SIZE); |
|
|
|
|