Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit fc0ef5e

Browse files
committed
fix(radio): wrong length to convert read frame
usage of sizeof was wrong as it always returned 4, the size of the pointer. Fixes #15. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 8fca21e commit fc0ef5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LoRaRadio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ uint8_t LoraRadio::write(uint8_t *buffer, uint8_t len)
301301
uint8_t LoraRadio::read(uint8_t *buffer)
302302
{
303303
uint8_t len = 0;
304-
uint8_t frame[128];
304+
uint8_t frame[128] = {0};
305305

306306
if(buffer != NULL) {
307307
if(parseRcvData(frame) == AT_OK) {
308-
keyCharToInt((char *)frame, buffer, sizeof((char *)frame));
308+
keyCharToInt((char *)frame, buffer, strlen((char*)frame));
309309
len = sizeof((char *)buffer);
310310
}
311311
}

0 commit comments

Comments
 (0)