From 49e44f064dd7285fad15392725e2d24b33597e60 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Fri, 8 Apr 2022 13:34:35 +0200 Subject: [PATCH] Simplify event types --- include/server.h | 3 +-- src/server.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/server.h b/include/server.h index a720900..c48654a 100644 --- a/include/server.h +++ b/include/server.h @@ -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, }; /** diff --git a/src/server.cpp b/src/server.cpp index f80fd3b..cd70dae 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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;