projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Generalize and centralize telemetry constants, parse v0.8 telemetry
[fw/altos]
/
altosui
/
AltosTelemetryRecordLegacy.java
diff --git
a/altosui/AltosTelemetryRecordLegacy.java
b/altosui/AltosTelemetryRecordLegacy.java
index e3751ee77fd4e6ca2bd498cb68bc4efb5a2f37e2..756f3ec9ac5f4b92318f619e99d3e405fdc818a9 100644
(file)
--- a/
altosui/AltosTelemetryRecordLegacy.java
+++ b/
altosui/AltosTelemetryRecordLegacy.java
@@
-385,24
+385,25
@@
public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele
*/
int[] bytes;
*/
int[] bytes;
+ int adjust;
private int int8(int i) {
private int int8(int i) {
- return Altos.int8(bytes, i + 1);
+ return Altos.int8(bytes, i + 1
+ adjust
);
}
private int uint8(int i) {
}
private int uint8(int i) {
- return Altos.uint8(bytes, i + 1);
+ return Altos.uint8(bytes, i + 1
+ adjust
);
}
private int int16(int i) {
}
private int int16(int i) {
- return Altos.int16(bytes, i + 1);
+ return Altos.int16(bytes, i + 1
+ adjust
);
}
private int uint16(int i) {
}
private int uint16(int i) {
- return Altos.uint16(bytes, i + 1);
+ return Altos.uint16(bytes, i + 1
+ adjust
);
}
private int uint32(int i) {
}
private int uint32(int i) {
- return Altos.uint32(bytes, i + 1);
+ return Altos.uint32(bytes, i + 1
+ adjust
);
}
private String string(int i, int l) {
}
private String string(int i, int l) {
- return Altos.string(bytes, i + 1, l);
+ return Altos.string(bytes, i + 1
+ adjust
, l);
}
static final int AO_GPS_NUM_SAT_MASK = (0xf << 0);
}
static final int AO_GPS_NUM_SAT_MASK = (0xf << 0);
@@
-428,8
+429,13
@@
public class AltosTelemetryRecordLegacy extends AltosRecord implements AltosTele
}
}
version = 4;
}
}
version = 4;
-
callsign = string(62, 8)
;
+
adjust = 0
;
serial = uint16(0);
serial = uint16(0);
+
+ if (bytes.length == Altos.ao_telemetry_0_8_len + 4)
+ adjust = -1;
+
+ callsign = string(62, 8);
flight = uint16(2);
rssi = in_rssi;
status = in_status;
flight = uint16(2);
rssi = in_rssi;
status = in_status;