diff options
author | Anton Tananaev <anton@traccar.org> | 2024-02-19 11:53:08 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-02-19 11:53:14 -0800 |
commit | efd9e261791942334dbf4a911883a1b2b791f282 (patch) | |
tree | 8aa830282cd64b9b3a28e858865a8783b1eea3bc /src/main/java/org/traccar/BaseProtocolDecoder.java | |
parent | 26548bb534de6c9944ece5a2aa5216da83cb8819 (diff) | |
download | trackermap-server-efd9e261791942334dbf4a911883a1b2b791f282.tar.gz trackermap-server-efd9e261791942334dbf4a911883a1b2b791f282.tar.bz2 trackermap-server-efd9e261791942334dbf4a911883a1b2b791f282.zip |
Streamline model name access
Diffstat (limited to 'src/main/java/org/traccar/BaseProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/BaseProtocolDecoder.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/BaseProtocolDecoder.java b/src/main/java/org/traccar/BaseProtocolDecoder.java index 4d4086c3c..495a866c0 100644 --- a/src/main/java/org/traccar/BaseProtocolDecoder.java +++ b/src/main/java/org/traccar/BaseProtocolDecoder.java @@ -51,6 +51,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { private MediaManager mediaManager; private CommandsManager commandsManager; + private String modelOverride; + public BaseProtocolDecoder(Protocol protocol) { this.protocol = protocol; } @@ -141,6 +143,14 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } } + public void setModelOverride(String modelOverride) { + this.modelOverride = modelOverride; + } + + public String getDeviceModel(DeviceSession deviceSession) { + return modelOverride != null ? modelOverride : deviceSession.getModel(); + } + public void getLastLocation(Position position, Date deviceTime) { if (position.getDeviceId() != 0) { position.setOutdated(true); |