Timers¶
There are three timers, the auto lock and power off timers. The auto lock determines how long the trigger remains locked after decoding data without receiving confirmation. There are two power off timers, one for when the device is connected to a power source and one for when it is not.
Set Timers’ timeout¶
To set the timers’ timeout you can use the SetTimersTimeoutAsync(byte timersMask, byte[] timeouts)
method from the
CaptureHelperDevice
object received from the DeviceArrival
event.
You will need to provide a timer mask, found under ICaptureProperty.Values.Timer
and a timeout array for all
three timers (byte[6]). Timeouts for timers not targeted can be set to 0x00, 0x00 (check Timeout values).
For example, setting the power off disconnected timer:
byte timerMask = ICaptureProperty.Values.Timer.kPowerOffDisconnected;
byte[] timeouts = new byte[]
{
0x00, 0x00, // auto lock
0x00, 0x05, // power off disconnected
0x00, 0x00 // power off connected
};
// _selectedDevice is the CaptureHelperDevice object
var result = await _selectedDevice.SetTimersTimeoutAsync();
Debug.WriteLine($"SetTimersTimeoutAsync; result: {resultSet.Result}");
Mask Values¶
It is possible to use a combination of masks to set multiple timers. However, auto lock and power off timers must be set separately. Below are the possible mask values:
ICaptureProperty.Values.Timer.kAutoLock
ICaptureProperty.Values.Timer.kPowerOffDisconnected
ICaptureProperty.Values.Timer.kPowerOffConnected
ICaptureProperty.Values.Timer.kPowerOffDisconnected + ICaptureProperty.Values.Timer.kPowerOffConnected
Note
For the S550, S320 and the S370 devices, setting one power off timer will disable the other. To set both
power off timers, you can choose the combination of masks kPowerOffDisconnected
+ kPowerOffConnected
.
Timeout values¶
A timeout value is expressed by two bytes.
Auto lock timeout: value is expressed in 1/4 of a second increment.
0x00, 0x04: 1 second
0x00, 0xFE: 63.5 seconds and max value
Power off timeouts: value is expressed in minutes (different logic for S550 and S370 devices, see notes).
0x00, 0x00: disabled (always on)
0x00, 0x01 to 0xFF, 0xFF: 1 minute up to ~45 days
Note
The S550, S320 and the S370 do not support setting the auto lock timeout.
However, you should still provide a 6 bytes array to SetTimersTimeoutAsync()
method such as:
byte[] timeouts = new byte[]
{
0x00, 0x00, // auto lock, value will not be read
0x00, 0x05, // power off disconnected
0x00, 0x02 // power off connected
};
Note
For both S550 and S370 devices, the power off timeout is represented by a single byte, which follows this logic:
0x00: disabled (Always On)
0x01 to 0x7F: 1 to 127 minutes (up to 2h07) (value is expressed in minutes)
0x80 to 0xFF: 1 to 128 quarter of an hour (up to 32 hours) (value is expressed in 15 minute increments when the MSB is set)
However, you should still provide a 6 bytes array to SetTimersTimeoutAsync()
method such as:
byte[] timeouts = new byte[]
{
0x00, 0x00, // auto lock,
0x00, 0x81, // power off disconnected, 30 minutes
0x00, 0x00 // power off connected, disabled
};