Menu
Contents

LocoNet interface

Interface for communicating with a LocoNet network.

Properties

id
Object id, each object has a unique id.
name
Interface name
online
true if interface is online, false otherwise. Read status for more information.
output_channels
Supported output channels, a table containing output channel values.
status
Interface status object.

Methods

get_output

get_output(channel, address)

Get an output object.

Parameters

channel
Output channel, a Output channel value.
address
Output address, valid range depends on channel.

Return values

Single output, Pair output or Aspect output object depending on channel or nil if channel/address combination is invalid.

imm_packet

imm_packet(dcc_packet [, repeat = 2])

Request the LocoNet command station to send a DCC packet to the track (OPC_IMM_PACKET). This isn't supported by all LocoNet command stations.

Parameters

dcc_packet
Table containing up to five DCC packet bytes to send excluding checksum byte.
repeat
Number of times to repeat the packet on the track. (1...7)

Return values

true if send to the command station, false otherwise.

send

send(packet)

Send LocoNet packet

Parameters

packet
LocoNet packet bytes, excluding checksum.

Return values

true if send, false otherwise.