inputanalog_query - Query analog devices for filtering details.
analogtbl_tbl or analogtbl
inputanalog_query(
devnum, axnum, rescan )
This function allows you to query a device for analog device options and current
values, either globally (no arguments, table of analogtbl returned) or from a
specific device (and, optionally) axis. If rescan is set to != 0, the input
subsystem will first scan for new devices.
- 1
- rescan is a rather costly operation and may possibly lose data for devices
that doesn't identify properly.
- 2
- analogtbl members: devid, subid (device and axis indices) upper_bound,
lower_bound (value > upper and < lower will be discarded) deadzone
(abs(value) within deadzone will be discarded. kernel_size, number of
samples in for every sample out. mode(drop), analog processing disabled
mode(pass), emit every sample mode(avg), average the kernel_size buffer
mode(latest), only emit when buffer full, and keep only most recent
value
function inputanalog_query0()
local antbl = inputanalog_query();
print(#antbl, "devices found.");
for i = 1, #antbl do
print("-----0);
print(string.format("%d:%d, upper:%d, lower: %d, deadzone: %d, " ..
"kernel_size: %d, filter_mode: %s0, antbl[i].devid, antbl[i].subid,
antbl[i].upper_bound, antbl[i].lower_bound, antbl[i].deadzone,
antbl[i].kernel_size, antbl[i].mode));
print("-----0);
end
end
function inputanalog_query0()
inputanalog_query("ind");
end