Skip to content

Commit 73076ee

Browse files
committed
HardwareReport: GPS: print type and DroneCAN device name
1 parent 7777669 commit 73076ee

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

HardwareReport/HardwareReport.js

+51
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,60 @@ function load_gps(log) {
12331233
heading.innerHTML = "GPS " + (inst+1)
12341234
fieldset.appendChild(heading)
12351235

1236+
// Try and decode the type param
1237+
let types = []
1238+
types[0] = "None"
1239+
types[1] = "AUTO"
1240+
types[2] = "uBlox"
1241+
types[5] = "NMEA"
1242+
types[6] = "SiRF"
1243+
types[7] = "HIL"
1244+
types[8] = "SwiftNav"
1245+
types[9] = "DroneCAN"
1246+
types[10] = "SBF"
1247+
types[11] = "GSOF"
1248+
types[13] = "ERB"
1249+
types[14] = "MAV"
1250+
types[15] = "NOVA"
1251+
types[16] = "HemisphereNMEA"
1252+
types[17] = "uBlox-MovingBaseline-Base"
1253+
types[18] = "uBlox-MovingBaseline-Rover"
1254+
types[19] = "MSP"
1255+
types[20] = "AllyStar"
1256+
types[21] = "ExternalAHRS"
1257+
types[22] = "DroneCAN-MovingBaseline-Base"
1258+
types[23] = "DroneCAN-MovingBaseline-Rover"
1259+
types[24] = "UnicoreNMEA"
1260+
types[25] = "UnicoreMovingBaselineNMEA"
1261+
types[26] = "SBF-DualAntenna"
1262+
1263+
if (types[gps_info.type] != null) {
1264+
fieldset.appendChild(document.createTextNode("Type " + gps_info.type + ": " + types[gps_info.type]))
1265+
fieldset.appendChild(document.createElement("br"))
1266+
}
1267+
12361268
fieldset.appendChild(document.createTextNode(gps_info.device))
12371269
fieldset.appendChild(document.createElement("br"))
12381270

1271+
// If DroneCAN type we can print the node name
1272+
if ((gps_info.type == 9) || (gps_info.type == 22) || (gps_info.type == 23)) {
1273+
1274+
// Can't tell which bus, so give up if the node ID is found on both
1275+
let can_device
1276+
let can_count = 0
1277+
for (const [driver_num, can_driver] of Object.entries(can)) {
1278+
if (gps_info.node_id in can_driver) {
1279+
can_device = can_driver[gps_info.node_id][0]
1280+
can_count++
1281+
}
1282+
}
1283+
1284+
if ((can_device != null) && (can_count == 1)) {
1285+
fieldset.appendChild(document.createTextNode("Name: " + can_device.name))
1286+
fieldset.appendChild(document.createElement("br"))
1287+
}
1288+
}
1289+
12391290
return fieldset
12401291
}
12411292

0 commit comments

Comments
 (0)