Skip to content

Commit

Permalink
freq error can be float
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Nov 10, 2023
1 parent f8fcbdb commit 5eeca7e
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 @@ -177,7 +177,7 @@ private static LoraFrame readFrame(JsonValue val) {
JsonObject obj = val.asObject();
LoraFrame result = new LoraFrame();
result.setData(Util.hexStringToByteArray(obj.getString("data", null)));
result.setFrequencyError(obj.getLong("frequencyError", 0));
result.setFrequencyError((long) obj.getFloat("frequencyError", 0));
result.setRssi((short) obj.getInt("rssi", 0));
result.setSnr(obj.getFloat("snr", 0));
result.setTimestamp(obj.getLong("timestamp", 0));
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 @@ -5,7 +5,7 @@
"data": "CAFE",
"rssi": -121,
"snr": -5.75,
"frequencyError": -729,
"frequencyError": -729.23,
"timestamp": 1641987504
}
]
Expand Down

0 comments on commit 5eeca7e

Please sign in to comment.