Zhenhua Zhang
86b0fa3194
Fix echo command back even if don't process it
2010-03-31 08:12:55 -05:00
Zhenhua Zhang
5819927a38
Add Repeat last command support
2010-03-31 08:10:33 -05:00
Zhenhua Zhang
1390a63933
Add implementation for ATE and other basic command
2010-03-31 08:10:27 -05:00
Zhenhua Zhang
d7eb09cc05
Add implementation for S3, S4, S5 command
2010-03-31 08:10:23 -05:00
Denis Kenzior
e63840ba11
Fix: Make sure we still increment read_count
2010-03-30 22:06:12 -05:00
Zhenhua Zhang
c288921bab
Fix ignore incoming bytes during parsing
...
Server processes one command line at one time, so ignore the rest
incoming bytes during the command parsing.
2010-03-30 21:59:34 -05:00
Denis Kenzior
250c0c1ef9
Simplify the send_info API
2010-03-30 20:29:10 -05:00
Denis Kenzior
46ebde6965
Fix: Properly handle async final responses
2010-03-30 19:15:55 -05:00
Denis Kenzior
94eeab3688
Fix: We need to preserve the original line
2010-03-30 17:12:43 -05:00
Denis Kenzior
40ca3cb3f5
Fix: Record last received command
2010-03-30 15:25:50 -05:00
Denis Kenzior
a2c4c8e7b6
Fix: Send an ERROR on A/
2010-03-30 15:18:34 -05:00
Denis Kenzior
0448392a91
Refactor: Simplify extended command parsing logic
2010-03-30 14:36:02 -05:00
Denis Kenzior
882b62b640
Refactor: Add a single-line response function
2010-03-30 14:35:29 -05:00
Zhenhua Zhang
cdc13c40b6
Add API stubs for unsolicited / final responses
2010-03-30 12:37:29 -05:00
Denis Kenzior
9ed01bfecd
Refactor: Simplify parsing logic
...
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.
2010-03-24 19:41:19 -05:00
Denis Kenzior
a9c089ab34
Refactor basic command parsing
...
Make more bullet proof and efficient
2010-03-24 19:37:18 -05:00
Denis Kenzior
644d5922b2
Style: foo[0] is preferable to *foo
2010-03-24 16:28:42 -05:00
Denis Kenzior
005ecd5dd9
Fix: Be more paranoid in basic command parsing
2010-03-24 16:28:19 -05:00
Zhenhua Zhang
7c8fa919fa
Add basic command parsing
2010-03-24 16:02:10 -05:00
Denis Kenzior
a8a720d983
Fix: extract line should use S3, not hardcode CR
2010-03-22 12:59:04 -05:00
Denis Kenzior
2583ff626b
Refactor: Command line extraction
2010-03-22 12:59:04 -05:00
Denis Kenzior
c78805a91b
Refactor: Extended command parsing
...
Make the code more bullet proof and easier to follow
2010-03-22 12:59:04 -05:00
Zhenhua Zhang
7633a54ffd
Add g_at_server_register and unregister callback
2010-03-22 12:59:04 -05:00
Zhenhua Zhang
60cf097ffd
Add notify at command callback
2010-03-22 12:59:04 -05:00
Zhenhua Zhang
8850d3dc9e
Add server at command data structure
2010-03-22 12:59:04 -05:00
Zhenhua Zhang
c7828602d4
Add extended command parsing
2010-03-22 12:59:04 -05:00
Zhenhua Zhang
3d4af3eee6
Add framework of server parser
...
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.
2010-03-22 12:59:04 -05:00
Denis Kenzior
5d8bbb9e5f
Fix: Echo everything as soon as received
2010-03-18 14:47:34 -05:00
Zhenhua Zhang
73d92263a6
Refactor add is_basic_command_prefix function
2010-03-18 13:25:56 -05:00
Zhenhua Zhang
c57be559d6
Rename parse_v250_settings
...
To parse_basic_command
2010-03-18 13:24:56 -05:00
Zhenhua Zhang
05209cb701
Rename parse_at_command
...
To parse_extended_command
2010-03-18 13:24:36 -05:00
Zhenhua Zhang
171a4117fc
Rename is_at_command_prefix
...
To is_extended_command_prefix
2010-03-18 13:24:24 -05:00
Zhenhua Zhang
074c7ff920
Rename g_at_server_send_result
...
To g_at_server_send_final
2010-03-18 13:24:06 -05:00
Denis Kenzior
4cbb33fcbd
Fix: Use the proper enum type
2010-03-03 13:07:24 -06:00
Zhenhua Zhang
72851607e1
Add command echo back if ATE=1
2010-03-03 13:01:34 -06:00
Denis Kenzior
7be80ef131
Fix: Simplify write-again logic
2010-02-26 16:17:57 -06:00
Denis Kenzior
988fed5951
Fix: Don't allocate buffers if we don't need to
2010-02-26 16:16:46 -06:00
Zhenhua Zhang
c6f4d051b2
Add write server response into non-blocking IO
...
Write server response into non-blocking GIOChannel when we have
G_IO_OUT signal.
2010-02-26 16:10:19 -06:00
Zhenhua Zhang
534898f164
Add write buffer queue for non-blocking write
...
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.
2010-02-26 16:07:33 -06:00
Zhenhua Zhang
e96293d5bb
Add define for read and write buffer size
2010-02-26 16:04:52 -06:00
Zhenhua Zhang
79b480166c
Do not trigger user disconnect at g_at_shutdown
...
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.
2010-02-26 16:04:36 -06:00
Zhenhua Zhang
c4073fca00
Rename server_io to channel
...
To make it consistent with GAtChat.
2010-02-10 16:41:31 -06:00
Zhenhua Zhang
c5f962cb18
Replace sprintf with snprintf
2010-02-10 16:41:31 -06:00
Zhenhua Zhang
d80bba564e
Rename buf to read_buf in GAtServer
...
Because we may introduce write_buf for sever response buffer.
2010-02-10 16:41:31 -06:00
Zhenhua Zhang
2a58101807
Fix change state immediately when meet the slash
...
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.
2010-02-02 11:31:23 -06:00
Denis Kenzior
a4b681f02f
Fix: Remove unused label
2010-02-01 18:02:40 -06:00
Denis Kenzior
321bb02ee3
Fix: Skip whitespace in AT command line
2010-02-01 17:59:29 -06:00
Denis Kenzior
57d62a0b42
Refactor: Use more flexible parser framework
2010-02-01 17:59:29 -06:00
Denis Kenzior
263044721e
Fix: Don't set variables to NULL/0
...
These were already set to 0 by g_try_new0
2010-02-01 17:59:28 -06:00
Denis Kenzior
b6961b0d68
Refactor: Support max_read attempts like GAtChat
2010-02-01 17:59:28 -06:00