Skip to content

Commit 9a27fb1

Browse files
authored
separate firmware date from version (#1650)
2 parents 2d79c5a + 5312932 commit 9a27fb1

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

gui/public/i18n/en/translation.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ tracker-settings-update = Update now
407407
tracker-settings-update-title = Firmware version
408408
tracker-settings-current-version = Current
409409
tracker-settings-latest-version = Latest
410+
tracker-settings-build-date = Build Date
410411
411412
412413
## Tracker part card info

gui/src/components/tracker/TrackerSettings.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,15 @@ export function TrackerSettingsPage() {
208208
Firmware version
209209
</Typography>
210210
<div className="flex gap-2 flex-col">
211+
<div className="flex justify-between gap-2">
212+
<Typography id="tracker-settings-build-date" />
213+
<Typography
214+
whitespace="whitespace-pre-wrap"
215+
textAlign="text-end"
216+
>
217+
{tracker?.device?.hardwareInfo?.firmwareDate || '--'}
218+
</Typography>
219+
</div>
211220
<div className="flex justify-between gap-2">
212221
<Typography id="tracker-settings-current-version" />
213222
<Typography

server/core/src/main/java/dev/slimevr/protocol/datafeed/DataFeedBuilder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ public static int createHardwareInfo(FlatBufferBuilder fbb, Device device) {
3939
? fbb.createString(device.getManufacturer())
4040
: 0;
4141

42+
int firmwareDateOffset = device.getFirmwareDate() != null
43+
? fbb.createString(device.getFirmwareDate())
44+
: 0;
45+
4246
int hardwareIdentifierOffset = fbb.createString(device.getHardwareIdentifier());
4347

4448
HardwareInfo.startHardwareInfo(fbb);
4549
HardwareInfo.addFirmwareVersion(fbb, nameOffset);
4650
HardwareInfo.addManufacturer(fbb, manufacturerOffset);
4751
HardwareInfo.addHardwareIdentifier(fbb, hardwareIdentifierOffset);
4852

53+
HardwareInfo.addFirmwareDate(fbb, firmwareDateOffset);
54+
4955
if (device instanceof UDPDevice udpDevice) {
5056
var address = udpDevice.getIpAddress().getAddress();
5157
HardwareInfo
@@ -68,6 +74,7 @@ public static int createHardwareInfo(FlatBufferBuilder fbb, Device device) {
6874

6975
HardwareInfo.addMcuId(fbb, device.getMcuType().getSolarType());
7076
HardwareInfo.addOfficialBoardType(fbb, device.getBoardType().getSolarType());
77+
7178
return HardwareInfo.endHardwareInfo(fbb);
7279
}
7380

server/core/src/main/java/dev/slimevr/tracking/trackers/Device.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ open class Device(val magSupport: Boolean = false) {
1313
open val id: Int = nextLocalDeviceId.incrementAndGet()
1414
open var name: String? = null
1515
open var firmwareVersion: String? = null
16+
open var firmwareDate: String? = null
1617
open var manufacturer: String? = null
1718
open val trackers: MutableMap<Int, Tracker> = ConcurrentHashMap()
1819

server/core/src/main/java/dev/slimevr/tracking/trackers/hid/HIDCommon.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,14 @@ class HIDCommon {
280280
// Nothing to do now..
281281
}
282282
}
283-
if (fw_date != null && fw_major != null && fw_minor != null && fw_patch != null) {
283+
if (fw_date != null) {
284284
val firmwareYear = 2020 + (fw_date shr 9 and 127)
285285
val firmwareMonth = fw_date shr 5 and 15
286286
val firmwareDay = fw_date and 31
287-
val firmwareDate = String.format("%04d-%02d-%02d", firmwareYear, firmwareMonth, firmwareDay)
288-
device.firmwareVersion = "$fw_major.$fw_minor.$fw_patch (Build $firmwareDate)"
287+
device.firmwareDate = String.format("%04d-%02d-%02d", firmwareYear, firmwareMonth, firmwareDay)
288+
}
289+
if (fw_major != null && fw_minor != null && fw_patch != null) {
290+
device.firmwareVersion = "$fw_major.$fw_minor.$fw_patch"
289291
}
290292
if (svr_status != null) {
291293
val status = TrackerStatus.getById(svr_status)

solarxr-protocol

Submodule solarxr-protocol updated 20 files

0 commit comments

Comments
 (0)