Commit Graph

67 Commits

Author SHA1 Message Date
Olivier Guiter b931e77470 gatserver: ATS6 command handler added 2011-01-18 16:10:23 +01:00
Lucas De Marchi 521071a785 gatchat: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-11-29 12:05:29 -06:00
Zhenhua Zhang e70b1f0abd gatserver: Restore GAtServer disconnect handling
Restore GAtServer disconnect handling when resuming a server session
2010-07-07 11:26:55 -05:00
Zhenhua Zhang 2d219d37f9 gatserver: Don't free twice after user disconnect
It's possible to free gatserver in user disconnect function. So we
should not free it again.
2010-07-06 11:24:44 -05:00
Zhenhua Zhang 1822deba4a gatserver: Check for disconnection when resuming
If the internal GAtIO is no longer valid, treat it as if our channel was
disconnected.
2010-06-17 14:38:53 -05:00
Zhenhua Zhang 047ea0cebb gatserver: Suspend/resume GAtServer with GAtIO
Support g_at_server_suspend and g_at_server_resume operation by using
GAtIO to handle IO related function.
2010-06-17 14:38:23 -05:00
Marcel Holtmann 8f05535bb2 Add offset parameter to ring_buffer_write_ptr() function 2010-04-24 18:59:44 +02:00
Denis Kenzior 6ac0025767 Fix: busy loop in atserver 2010-04-12 22:33:42 -05:00
Marcel Holtmann a977ecf260 Remove various GDestroyNotify function casting 2010-04-12 17:48:20 -07:00
Marcel Holtmann 2dab6bc3a6 The user data pointer variable should be called user_data 2010-04-11 17:42:40 +02:00
Marcel Holtmann 764501482e Fix some cases where g_try_new should be used 2010-04-02 19:20:53 -07:00
Andrzej Zaborowski 27d0bc6ccf Fix ampersand commands check
Also remove a trailing tab.
2010-03-31 13:16:13 -05:00
Denis Kenzior b421d0756b Refactor: Simplify V250 setting command functions 2010-03-31 08:38:01 -05:00
Denis Kenzior 2ec19b67a2 Refactor: Simplify gatserver s-register functions 2010-03-31 08:22:40 -05:00
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