Simplify event types

This commit is contained in:
Christoph Hagen 2022-04-08 13:34:35 +02:00
parent 1c7011400c
commit 49e44f064d
2 changed files with 2 additions and 3 deletions

View File

@ -12,12 +12,11 @@
enum class SesameEvent {
TextReceived = 1,
UnexpectedSocketEvent = 2,
InvalidPayloadSize = 3,
InvalidMessageData = 3,
MessageAuthenticationFailed = 4,
MessageTimeMismatch = 5,
MessageCounterInvalid = 6,
MessageAccepted = 7,
InfoMessage = 8,
};
/**

View File

@ -68,7 +68,7 @@ switch(type) {
void ServerConnection::processReceivedBytes(uint8_t* payload, size_t length) {
if (length != AUTHENTICATED_MESSAGE_SIZE) {
sendFailureResponse(SesameEvent::InvalidPayloadSize);
sendFailureResponse(SesameEvent::InvalidMessageData);
return;
}
AuthenticatedMessage* message = (AuthenticatedMessage*) payload;