Skip to content

Commit 2666b73

Browse files
committed
and another
1 parent 4a2fe73 commit 2666b73

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Documentation/espnow-v2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ I [EspNowService] ESP-NOW version: 2.0
4343

4444
### Larger Messages
4545

46-
- Message size increased from **127 to 1417 characters**
46+
- Message size increased from **127 to 1416 characters**
4747
- Variable-length packet transmission (only sends actual message length)
4848
- Backwards compatible: messages < 197 chars still work with v1.0 devices
4949

@@ -69,7 +69,7 @@ Offset Size Field
6969
| `Tactility/Private/Tactility/app/chat/ChatProtocol.h` | `MESSAGE_SIZE` = 1417, added header constants |
7070
| `Tactility/Source/app/chat/ChatProtocol.cpp` | Variable-length serialize/deserialize |
7171
| `Tactility/Source/app/chat/ChatApp.cpp` | Send actual packet size |
72-
| `Tactility/Source/app/chat/ChatView.cpp` | Input field max length = 1417 |
72+
| `Tactility/Source/app/chat/ChatView.cpp` | Input field max length = 1416 |
7373
| `Documentation/chat.md` | Updated protocol documentation |
7474

7575
## Compatibility

Tactility/Source/app/chat/ChatApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void ChatApp::enableEspNow() {
2828
service::espnow::Mode::Station,
2929
1, // Channel 1 default; actual channel determined by WiFi if connected
3030
false,
31-
false
31+
settings.hasEncryptionKey
3232
);
3333
service::espnow::enable(config);
3434
}

Tactility/Source/service/espnow/EspNow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ uint32_t getVersion() {
9090
}
9191

9292
size_t getMaxDataLength() {
93-
return getVersion() >= 2 ? MAX_DATA_LEN_V2 : MAX_DATA_LEN_V1;
93+
auto v = getVersion();
94+
if (v == 0) return 0;
95+
return v >= 2 ? MAX_DATA_LEN_V2 : MAX_DATA_LEN_V1;
9496
}
9597

9698
}

0 commit comments

Comments
 (0)