tm_mercury v0.3.0 TM.Mercury.Reader
Summary
Functions
Execute the reader’s bootloader
Execute the reader’s firmware from the bootloader
Clear the tag buffer
Return the antenna port configuration used by the reader
Return the identity of the program currently running on the device
Return the current value of an optional reader parameter with a given key
Set the power-consumption mode of the reader as a whole
Get the current TX power for reading tags in centi-dBm
Return the RF regulatory environment that the reader will operate within
Return the tags that have accumulated in the reader’s buffer while waiting on a synchronous read timeout to expire
Return the tag protocol used by the reader
Get the radio’s temperature
Return hardware, firmware, and bootloader version details
Catch-all handlers for op commands that don’t require any state binding or special handling
Start reading tags asynchronously using the current reader configuration
Tags will be sent to the process provided as the callback until stop_read_async
is called
Start reading tags asynchronously using a custom read plan
Tags will be sent to the process provided as the callback until stop_read_async
is called
Stop reading tags asynchronously
Read tags synchronously using the current reader configuration
Read tags synchronously using a custom read plan
Read tags synchronously using the current reader configuration, skipping preparation steps in prepare_read
.
Care should be taken that any necessary preparation is performed separately before calling this function
Reboot the reader
Disconnect the reader. The connection will be restarted
Set the antenna port configuration used by the reader
Set the reader’s serial baud rate. The host’s baud rate must be changed separately
Set the value of an optional reader parameter with a given key
Return the power-consumption mode of the reader as a whole
Change the read timeout used for synchronous tag reading
Set the current TX power for reading tags in centi-dBm
Set the RF regulatory environment that the reader will operate within
Set the tag protocol used by the reader
Start a process and open a connection with the reader over UART connected via TTL / USB
Return the reader’s transport connection status
Functions
Execute the reader’s firmware from the bootloader.
get_current_program(pid) :: {:ok, :bootloader} | {:ok, :application} | {:error, term}
Return the identity of the program currently running on the device.
Return the current value of an optional reader parameter with a given key.
Get the current TX power for reading tags in centi-dBm.
Examples
iex> TM.Mercury.Reader.get_read_tx_power(pid)
{:ok, 2500} # 25 dBm
Return the tags that have accumulated in the reader’s buffer while waiting on a synchronous read timeout to expire.
Return hardware, firmware, and bootloader version details.
Catch-all handlers for op commands that don’t require any state binding or special handling
read_async_start(pid :: pid, callback :: pid) :: {:ok, term} | {:error, term}
Start reading tags asynchronously using the current reader configuration
Tags will be sent to the process provided as the callback until stop_read_async
is called.
read_async_start(pid :: pid, callback :: pid, TM.Mercury.ReadPlan.t) :: {:ok, term} | {:error, term}
Start reading tags asynchronously using a custom read plan
Tags will be sent to the process provided as the callback until stop_read_async
is called.
read_sync(pid) :: {:ok, term} | {:error, term}
read_sync(pid) :: {:ok, term} | {:error, term}
Read tags synchronously using the current reader configuration
Read tags synchronously using a custom read plan
Read tags synchronously using the current reader configuration, skipping preparation steps in prepare_read
.
Care should be taken that any necessary preparation is performed separately before calling this function.
Disconnect the reader. The connection will be restarted.
Set the reader’s serial baud rate. The host’s baud rate must be changed separately.
Set the value of an optional reader parameter with a given key.
Set the current TX power for reading tags in centi-dBm.
Examples
iex> TM.Mercury.Reader.set_read_tx_power(pid, 2500) # 25 dBm
:ok
Start a process and open a connection with the reader over UART connected via TTL / USB
Keyword List Parameters
device
- The device file for the reader serial connection (required)speed
- The port speed, e.g.:speed: 115200
(default)region
- The regulatory RF environment used by the reader:none
- Unspecified region (default):na
- North America:eu
- European Union:kr
- Korea:in
- India:jp
- Japan:prc
- People’s Republic of China:eu2
- European Union 2:eu3
- European Union 3:kr2
- Korea 2:prc2
- People’s Republic of China (840 MHz):au
- Australia:nz
- New Zealand (Experimental):na2
- Reduced FCC region:na3
- 5 MHz FCC band:open
- Open
power_mode
- The power-consumption mode of the reader as a whole:full
(default):min_save
:med_save
:max_save
:sleep
antennas
- The antenna port configuration. default: 1tag_protocol
- The tag protocol used by the reader. default: :gen2read_timeout
- The duration used byread_sync
when reading tags. default: 500