SYNOPSIS
event = handle:ttnEvent()
DESCRIPTION
Reads a diagnostic event from the interface event queue.
Before this can be used, event reporting must be enabled by calling rawio:ttnEnableEvents().
Each call returns one table with the event data.
Link state has changed
{
event = "StateChange",
state = "…", -- Station link state
}
For the link state, see rawio:ttnInfo().
List of active stations has changed
{
event = "PopulationReport",
before = …, -- Integer bitmask, each 1 bit indicates this TID was active before
after = …, -- Integer bitmask, each 1 bit indicates this TID is now active
}
Sending out probes for inactive stations
{
event = "Probing",
mac = "XX:XX:XX:XX:XX:XX", -- MAC address being probed for
bits = …, -- How many bits to match, counted from the right
}
Being probed by another station while inactive
{
event = "BeingProbed"
mac = "XX:XX:XX:XX:XX:XX", -- MAC address being probed for
bits = …, -- How many bits to match, counted from the right
}
Getting a TTN network ID assigned
{
event = "BeingAssigned",
from_tid = …, -- ID of station that sent the assignment
tid = …, -- The ID that this station got assigned
next_tid = …, -- The ID that this station must pass the token to
mac = "XX:XX:XX:XX:XX:XX", -- MAC address of this station
}
The station number responsible for probing for inactive stations has changed
{
event = "ProbingHost",
tid = …, -- ID of station doing the probing
}
See rawio:ttnProbe() about becoming the probing host.
Data packet seen
{
event = "Traffic",
sid = …, -- Source station ID
did = …, -- Destination station ID
}
Buzz command received
{
event = "Buzzed",
tid = …, -- Sender of the buzz command
}
See rawio:ttnBuzz() about sending out buzz commands.
RETURN VALUE
On success, returns a table with event data.
When there are no events, returns false.
On failure, returns nil. In case of an error, the error can
be retrieved using rawio:lastError().