Commit Graph

163 Commits

Author SHA1 Message Date
Kristen Carlson Accardi fb40115bf2 switch to g_timeout_add_seconds()
we don't care that much about the exactness of our timer, so use
the more power efficient call.
2010-03-24 23:04:42 -05:00
Denis Kenzior 1905d4deda Fix: Make CONNECT <baud> responses work 2010-03-24 19:42:16 -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 1f99435a42 Fix: Use SO_REUSEADDR in test_server 2010-03-24 19:34:33 -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 c1c3b5502e Style: No point to write a function to wrap g_free
Using casting magic works well enough, and more consistent with the rest
of the library.
2010-03-24 15:24:06 -05:00
Kristen Carlson Accardi efb95941be fix memory leak in ppp_auth
Free packet after calling ppp_transmit()
2010-03-24 13:21:32 -07:00
Kristen Carlson Accardi 7dbd19e441 fix memory leaks after ppp_transmit
Free packets in ppp_cp after calling ppp_transmit()
2010-03-24 13:21:31 -07:00
Kristen Carlson Accardi 954e114507 fix memory leaks in option handling
free the data as well as the link when deleting options lists.
2010-03-24 13:21:31 -07:00
Marcel Holtmann b4267dc624 Remove pointless optimization attempt with g_list_length() 2010-03-22 21:43:46 -07:00
Marcel Holtmann 39476a2b54 Use password instead of passwd as variable name 2010-03-22 20:13:55 -07:00
Marcel Holtmann 6cbfe5fa1e The g_free() function checks for NULL pointers
And so does even the free() function from glibc ;)
2010-03-22 20:10:17 -07:00
Marcel Holtmann e396b7d5af Unnest some more functions in PPP CP implementation 2010-03-22 20:07:13 -07:00
Marcel Holtmann 91b742730a Some additional whitespace cleanup for PPP code 2010-03-22 20:01:28 -07:00
Marcel Holtmann 8667c8694d Fix the broken PPP CP debug trace function 2010-03-22 19:56:53 -07:00
Marcel Holtmann a09d38643b Remove some heavy nesting that is not needed at all 2010-03-22 19:32:47 -07:00
Marcel Holtmann c59a93e6fb Fix another pointer casting issue on 32-bit systems 2010-03-22 19:29:34 -07:00
Marcel Holtmann abbd1640f4 Fix pointer casting with uint16 protocol variable 2010-03-22 19:13:22 -07:00
Kristen Carlson Accardi 8cae71ef5c Add PPP option to gsmdial
Implement new options for gsmdial to use PPP and set the user name and
password for authentication if needed.
2010-03-22 17:28:23 -07:00
Kristen Carlson Accardi a84fc350b4 IP support for PPP
Adds IPCP support, and creates a TUN interface for sending/receiving IP
packets.
2010-03-22 17:28:23 -07:00
Kristen Carlson Accardi 6cb22fe096 CHAP with MD5 authentication support
Authentication support with CHAP and MD5
2010-03-22 17:28:23 -07:00
Kristen Carlson Accardi cd5ddc2bee PPP LCP support
Implement LCP support for the PPP protocol.
2010-03-22 17:28:23 -07:00
Kristen Carlson Accardi 31e99d9d78 Generic PPP control protocol support
Implement a generic protocol that can be shared by both the LCP and the
NCP implementation.
2010-03-22 17:28:23 -07:00
Kristen Carlson Accardi d38443482f Basic PPP protocol support
This patch implements the basic PPP protocol.  LCP, NCP etc. are handled in
a different patch.
2010-03-22 17:28:23 -07: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 f9991f929a Add G_AT_SERVER_RESULT_EXT_ERROR 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 12d97c18a0 Add support for IP based connections to gsmdial 2010-03-18 16:05:47 -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 8d9f7fda2e Fix: Use g_try_malloc in gatutil 2010-03-16 17:22:56 -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