It isn't actually necessary to check the basic command prefixes, if the
extended prefix doesn't match we try to parse it like a basic command.
That one does the same exact check anyway. If that fails, then this is
not a recognized command line anyway.
a. The parser fetch and parse one command per loop. The prefix is
the command prefix without parameter. For example, the prefix of
"AT+CLIP=1" is "+CLIP".
b. Search registered notification node in command_list. Invoke the
callback if found.
c. Termiate the execution if the result is an error. Otherwise,
parse next command.
The head of the queue is the data to be written, the tail is the
free buffer to cache data into.
If the tail of queue is full, allocate a new free buffer and
append it at the tail.
Similar to gatchat, introduce read_watcher_destroy_notify and do
not trigger user disconnect at g_at_shutdown. Delay destroy of
gatserver until read_watcher is destroyed.
According to V.250 spec section 5.2.4 Repeating a command line, if
the prefix "A/" or "a/" is received, we should execute the last
command immediately. No need to meet \r.
It's the basic skeleton of GAtServer, including new/shutdown, ref/
unref, received_data/parse_buffer and set_discuss/set_debug.
GAtServer is to emulate the server side of AT conversation. It
complies with V.250 and 27.007 spec to accept AT command like
ATV1, ATE0 and extended command like AT+CLCC. Upper layer could
create customize server to expose TTY, tcp or unix socket to
client side application.