vintage_net_mobile v0.1.2 VintageNetMobile.ATRunner.CommandList View Source
Functions for working with commands to send to a modem
This data structure provides queueing of commands while a command is currently in process.
Link to this section Summary
Functions
Handle a response from the modem
Get the next command from the queued ones
Put a new Command.t()
into the command list
Link to this section Types
t()
View Sourcet() :: %VintageNetMobile.ATRunner.CommandList{ current_command: VintageNetMobile.ATRunner.CommandList.Command.t() | nil, queue: :queue.queue(VintageNetMobile.ATRunner.CommandList.Command.t()) }
Link to this section Functions
handle_response(command_list, response)
View Sourcehandle_response(t(), binary()) :: {:complete, VintageNetMobile.ATRunner.CommandList.Command.t(), t()} | :continue
Handle a response from the modem
If it is determined that the current command has received the correct
response it will return {:complete, command, new_command_list}
If it is not able to determined the current command can be completed then
this function will return :continue
to let the caller know to keep waiting
next_command(command_list)
View Sourcenext_command(t()) :: {VintageNetMobile.ATRunner.CommandList.Command.t(), t()} | nil
Get the next command from the queued ones
If there are more commands available to run this will return
{Command.t(), new_command_list}
. That is the new command list with the next
command dequeued.
If there is no more commands to run this return nil
put(command_list, command)
View Sourceput(t(), VintageNetMobile.ATRunner.CommandList.Command.t()) :: t() | {:queued, t()}
Put a new Command.t()
into the command list
If the command list already has a command, it will queue the new
command which that new command can be accessed via next_command/1