Respond to key transmission
This commit is contained in:
parent
db597e2231
commit
e534958300
@ -208,6 +208,7 @@ SesameEvent handleReceivedRequest(const uint8_t* payload, size_t length) {
|
||||
if (length != KEY_BYTE_COUNT + 2) {
|
||||
return SesameEvent::InvalidPayloadSize;
|
||||
}
|
||||
Serial.println("Key received");
|
||||
uint16_t keyIndex = ((uint16_t) payload[0] << 8) + payload[1];
|
||||
if (keyIndex >= KEY_COUNT) {
|
||||
return SesameEvent::InvalidKeyIndex;
|
||||
@ -268,7 +269,7 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
|
||||
sendResponse(SesameEvent::TextReceived);
|
||||
break;
|
||||
case WStype_BIN:
|
||||
handleReceivedRequest(payload, length);
|
||||
processReceivedBytes(payload, length);
|
||||
break;
|
||||
case WStype_ERROR:
|
||||
case WStype_FRAGMENT_TEXT_START:
|
||||
|
Loading…
Reference in New Issue
Block a user