to top
Datalogic APIs
public class

PoseManager

extends Object
java.lang.Object
   ↳ com.datalogic.device.configuration.PoseManager

Class Overview

The PoseManager provides all classes and methods that allow to register different device poses (characterized by a unique name and gravity vector) and associate to them actions that will be executed when the device finds itself inside or outside any device pose.
It also provides APIs to:

Summary

Nested Classes
class PoseManager.ActivationOption Class representing an option of activation applied to a pose setting. 
class PoseManager.DevicePoses Represents a collection of configured device poses. 
class PoseManager.ExecutionOption Class representing an execution step applied to a pose setting. 
class PoseManager.GravityVector Represents a 3D gravity vector with X, Y, and Z components. 
interface PoseManager.GravityVectorRetrievalListener Listener interface used to retrieve a gravity vector asynchronously from the Pose Manager. 
class PoseManager.Pose Represents a single device pose, defined by a name, gravity vector and associated settings. 
interface PoseManager.PoseChangeEventListener Listener interface used to receive notifications when the device enters or exits a pose. 
class PoseManager.PoseSettings Settings related to a specific pose, they are assigned to the pose itself with: The settings are used to specify additional constraints when entering or exiting the associated pose, as well as the operations to execute when the device is inside or outside the pose. 
Public Constructors
PoseManager()
Constructor for the Pose Manager object.
Public Methods
boolean addPoseChangeEventListener(PoseManager.PoseChangeEventListener listener)
Register a listener to receive notifications when the device enters or exits a pose.
boolean removePoseChangeEventListener(PoseManager.PoseChangeEventListener listener)
Unregister a listener to receive notifications when the device enters or exits a pose.
PoseManager.GravityVector retrieveGravityVector()
Retrieve the current gravity vector synchronously.
int retrieveGravityVector(PoseManager.GravityVectorRetrievalListener listener)
Retrieve the current gravity vector asynchronously.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PoseManager ()

Added in revision 47

Constructor for the Pose Manager object.

Throws
DeviceException In case the Pose Manager service cannot be found in this device.
Exception

Public Methods

public boolean addPoseChangeEventListener (PoseManager.PoseChangeEventListener listener)

Added in revision 47

Register a listener to receive notifications when the device enters or exits a pose.

Parameters
listener The listener to register.
Returns
  • true if the listener was successfully registered, false otherwise.

public boolean removePoseChangeEventListener (PoseManager.PoseChangeEventListener listener)

Added in revision 47

Unregister a listener to receive notifications when the device enters or exits a pose.

Parameters
listener The listener to unregister.
Returns
  • true if the listener was successfully unregistered, false otherwise.

public PoseManager.GravityVector retrieveGravityVector ()

Added in revision 47

Retrieve the current gravity vector synchronously.
This method requires a calibration process that takes some time to execute (at most 10 seconds) and requires the device to be stationary for an optimal result.

Returns
Throws
DeviceException In case of failures, if the exceptions are enabled through the ErrorManager.

public int retrieveGravityVector (PoseManager.GravityVectorRetrievalListener listener)

Added in revision 47

Retrieve the current gravity vector asynchronously.
This method requires a calibration process that takes some time to execute (at most 10 seconds) and requires the device to be stationary for an optimal result.
The provided listener will be notified once the gravity vector has been retrieved.

Parameters
listener The listener to notify when the gravity vector is available.
Returns
  • Returns SUCCESS in case the call succeeded, otherwise it returns an error code from the DeviceException error codes, if the exceptions are not enabled through the ErrorManager.
Throws
DeviceException In case of failures, if the exceptions are enabled through the ErrorManager.