FloorPoller (ElevatorProject v0.1.0)
Monitors the state of the floor sensor, and signals ElevatorOperator
if
the elevator arrives at a floor.
Uses the following modules:
- Driver
- ElevatorOperator
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Calls ElevatorOperator.floor_arrival/1
when the elevator is
arriving at a new floor.
Link to this section Functions
Link to this function
child_spec(arg)
Returns a specification to start this module under a supervisor.
arg
is passed as the argument to Task.start_link/1
in the :start
field
of the spec.
For more information, see the Supervisor
module,
the Supervisor.child_spec/2
function and the Supervisor.child_spec/0
type.
Link to this function
poller(prev_state)
Calls ElevatorOperator.floor_arrival/1
when the elevator is
arriving at a new floor.
Parameters
- prev_state: State of the floor sensor. Can be the floor number or :in_between_floors :: integer() | atom()
Return
- no_return