Skip to content

Commit

Permalink
fix(radio): wrong length to convert read frame
Browse files Browse the repository at this point in the history
usage of sizeof was wrong as it always returned 4,
the size of the pointer.

Fixes #15.

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Sep 12, 2024
1 parent 8fca21e commit fc0ef5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LoRaRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ uint8_t LoraRadio::write(uint8_t *buffer, uint8_t len)
uint8_t LoraRadio::read(uint8_t *buffer)
{
uint8_t len = 0;
uint8_t frame[128];
uint8_t frame[128] = {0};

if(buffer != NULL) {
if(parseRcvData(frame) == AT_OK) {
keyCharToInt((char *)frame, buffer, sizeof((char *)frame));
keyCharToInt((char *)frame, buffer, strlen((char*)frame));
len = sizeof((char *)buffer);
}
}
Expand Down

0 comments on commit fc0ef5e

Please sign in to comment.