Skip to content

Commit

Permalink
fix r2lora message parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Nov 12, 2023
1 parent 5eeca7e commit 14d4aa9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ru/r2cloud/lora/r2lora/R2loraClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private static LoraFrame readFrame(JsonValue val) {
LoraFrame result = new LoraFrame();
result.setData(Util.hexStringToByteArray(obj.getString("data", null)));
result.setFrequencyError((long) obj.getFloat("frequencyError", 0));
result.setRssi((short) obj.getInt("rssi", 0));
result.setRssi((short) obj.getFloat("rssi", 0));
result.setSnr(obj.getFloat("snr", 0));
result.setTimestamp(obj.getLong("timestamp", 0));
return result;
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/r2loratest/successStop.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"frames": [
{
"data": "CAFE",
"rssi": -121,
"rssi": -121.75,
"snr": -5.75,
"frequencyError": -729.23,
"timestamp": 1641987504
Expand Down

0 comments on commit 14d4aa9

Please sign in to comment.