aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/SupportedCommandResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/SupportedCommandResource.java')
-rw-r--r--src/org/traccar/api/resource/SupportedCommandResource.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/api/resource/SupportedCommandResource.java b/src/org/traccar/api/resource/SupportedCommandResource.java
index 849447060..bf4fd4969 100644
--- a/src/org/traccar/api/resource/SupportedCommandResource.java
+++ b/src/org/traccar/api/resource/SupportedCommandResource.java
@@ -34,9 +34,9 @@ public class SupportedCommandResource extends BaseResource {
@GET
public Collection<SupportedCommand> get(@QueryParam("deviceId") long deviceId) throws SQLException {
Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
- Position latestPosition = Context.getDataManager().getLatestPosition(deviceId);
- if (latestPosition != null) {
- return Context.getServerManager().getProtocolSuppportedCommands(latestPosition.getProtocol());
+ Position lastPosition = Context.getConnectionManager().getLastPosition(deviceId);
+ if (lastPosition != null) {
+ return Context.getServerManager().getProtocolSuppportedCommands(lastPosition.getProtocol());
} else {
return Collections.EMPTY_LIST;
}