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

Link to this section Functions

Link to this function

handle_response(command_list, response)

View Source
handle_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

Link to this function

next_command(command_list)

View Source
next_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

Link to this function

put(command_list, command)

View Source
put(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