View Source Jeff (jeff v0.5.1)

Control an Access Control Unit (ACU) and send commands to a Peripheral Device (PD)

Link to this section Summary

Functions

Register a peripheral device on the ACU communication bus.

Requests the PD to return a list of its functional capabilities, such as the type and number of input points, outputs points, reader ports, etc.

Disable OSDP packet tracing

Enable OSDP packet tracing

Requests the return of the PD ID Report.

Instructs the PD to reply with an input status report.

Instructs the PD to reply with a local status report.

Sends a manufacturer-specific command to the PD.

Instructs the PD to reply with an output status report.

Remove a peripheral device from the ACU communication bus.

Defines commands to a single, monotone audible annunciator (beeper or buzzer) that may be associated with a reader.

Sets the PD's communication parameters.

Controls the LEDs associated with one or more readers.

Start an ACU process.

Link to this section Types

@type acu() :: GenServer.server()
@type cmd_err() :: {:error, :timeout | Jeff.Reply.ErrorCode.t()}
@type device_opt() :: Jeff.ACU.device_opt()
@type osdp_address() :: 0..127
@type vendor_code() :: 0..16_777_215

Link to this section Functions

Link to this function

add_pd(acu, address, opts \\ [])

View Source
@spec add_pd(acu(), osdp_address(), [device_opt()]) :: Jeff.Device.t()

Register a peripheral device on the ACU communication bus.

Link to this function

capabilities(acu, address)

View Source
@spec capabilities(acu(), osdp_address()) :: Jeff.Reply.Capabilities.t() | cmd_err()

Requests the PD to return a list of its functional capabilities, such as the type and number of input points, outputs points, reader ports, etc.

@spec disable_trace(acu()) :: :ok | {:error, File.posix()}

Disable OSDP packet tracing

Link to this function

enable_trace(acu, opts \\ [])

View Source
@spec enable_trace(acu(), [Jeff.Tracer.option()]) :: :ok | {:error, File.posix()}

Enable OSDP packet tracing

Use log level :debug

Available options:

  • :ignore_polls - OSDP polling has to occur at minimum every 200ms which can be noisy in the logs. When this is set, poll commands and ACK messages are ignored when tracing. Default true

  • :ignore_partials - Partial packets should be rare, but do occur when there is noise on the lines or during other communication synchronization problems. This ignores partial, incomplete packets when enabled. Default false

  • :ignore_marks - Before sending data, the the line is driven with a 0xFF byte to mark it for sending. This happens on ACU and PD. This is not always useful when tracing, so they can be ignored if all the partial bytes are 0xFF. Default true

  • :partials_limit - Limit of partial packets to store in a buffer. This is most typically not used since partials get logged on next valid packet. However, it protects against cases where valid packets may not be happening and prevents the partial buffer from growing unbounded. Default 100

Tracing can also be configuraed in the application config with the same values using the :tracer key:

config :jeff, :tracer,
  enabled: true,
  ignore_polls: true,
  ignore_partials: false,
  ignore_marks: true
@spec id_report(acu(), osdp_address()) :: Jeff.Reply.IdReport.t() | cmd_err()

Requests the return of the PD ID Report.

Link to this function

input_status(acu, address)

View Source
@spec input_status(acu(), osdp_address()) :: Jeff.Reply.InputStatus.t() | cmd_err()

Instructs the PD to reply with an input status report.

Link to this function

local_status(acu, address)

View Source
@spec local_status(acu(), osdp_address()) :: Jeff.Reply.LocalStatus.t() | cmd_err()

Instructs the PD to reply with a local status report.

Link to this function

mfg(acu, address, mfg_command)

View Source

Sends a manufacturer-specific command to the PD.

Link to this function

output_status(acu, address)

View Source
@spec output_status(acu(), osdp_address()) :: Jeff.Reply.OutputStatus.t() | cmd_err()

Instructs the PD to reply with an output status report.

@spec remove_pd(acu(), osdp_address()) :: Jeff.Device.t()

Remove a peripheral device from the ACU communication bus.

Link to this function

set_buzzer(acu, address, params)

View Source
@spec set_buzzer(acu(), osdp_address(), [Jeff.Command.BuzzerSettings.param()]) ::
  Jeff.Reply.ACK | cmd_err()

Defines commands to a single, monotone audible annunciator (beeper or buzzer) that may be associated with a reader.

Link to this function

set_com(acu, address, params)

View Source

Sets the PD's communication parameters.

Link to this function

set_led(acu, address, params)

View Source
@spec set_led(acu(), osdp_address(), [Jeff.Command.LedSettings.param()]) ::
  Jeff.Reply.ACK | cmd_err()

Controls the LEDs associated with one or more readers.

@spec start_acu([Jeff.ACU.start_opt()]) :: GenServer.on_start()

Start an ACU process.