[PATCH v3 1/1] Add telephony_str_to_error to decode error code

2012-08-21 Thread Zhenhua Zhang
Use to decode a final error string to error code. --- drivers/atmodem/atutil.c |7 ++--- src/common.c | 48 ++ src/common.h |1 + 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/drivers/atmodem/atutil.c

[PATCH 01/21] bluetooth: Add reference count for bluetooth utils

2010-09-29 Thread Zhenhua Zhang
Add bluetooth_ref()/bluetooth_unref() to support reference count in bluetooth utils. --- plugins/bluetooth.c | 62 +-- 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index

[PATCH 00/21] Add DUN server for oFono

2010-09-29 Thread Zhenhua Zhang
Hi, I rebase my DUN patches with latest git tree and combine them here. For some reason, I cann't continue to work on this feature. I hope someone interested about it could pick up these patches and continue this work. Please feel free to give your comments. Thanks, Zhenhua

[PATCH 03/21] bluetooth: Add bluetooth server support for DUN

2010-09-29 Thread Zhenhua Zhang
It watches Bluetooth adapter property changes and addes DUN record to listen DUN client connection request. --- plugins/bluetooth.c | 379 +++ plugins/bluetooth.h | 14 ++ 2 files changed, 393 insertions(+), 0 deletions(-) diff --git

[PATCH 04/21] emulator: Add emulator atom in oFono

2010-09-29 Thread Zhenhua Zhang
Create emulator atom when modem state changes to online. The emulator driver probes each driver to create specific emulator like DUN, HFP AG, etc. Once get client connection request, create GAtServer to talk AT commands with client side. --- Makefile.am|4 +- include/emulator.h | 54

[PATCH 08/21] emulator: Add emulator status watches in gprs atom

2010-09-29 Thread Zhenhua Zhang
Add dun_watch to watch emulator status update in gprs atom. So that gprs atom could get notified when we get request to create new PPP connection from DUN client; --- src/gprs.c | 60 1 files changed, 60 insertions(+), 0 deletions(-)

[PATCH 07/21] emulator: Add status watches for ofono emulator

2010-09-29 Thread Zhenhua Zhang
The status watches monitor the emulator activities. Other atoms like gprs, netreg could register notification to watch emulator status changes. --- include/emulator.h |6 + src/emulator.c | 54 src/ofono.h| 11 ++

[PATCH 05/21] dun_gw: Add DUN server plugin for oFono

2010-09-29 Thread Zhenhua Zhang
DUN server is probed when modem state changes to online. It registers DUN record to Bluetooth adapter and wait for incoming DUN connection. --- Makefile.am |3 + plugins/dun_gw.c | 113 ++ 2 files changed, 116 insertions(+), 0

[PATCH 12/21] gprs: ignore the case of proto str when comparing

2010-09-29 Thread Zhenhua Zhang
Use g_ascii_strcasecmp in gprs_proto_from_string when getting the GPRS protocol from string. --- src/gprs.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index f3f86ec..b39e361 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -159,10 +159,10 @@

[PATCH 06/21] gprs: Rename status_watch to netreg_status_watch

2010-09-29 Thread Zhenhua Zhang
To be more precise and avoid name conflict with dun_status_watch. --- src/gprs.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 3f085ed..6e71b50 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -75,7 +75,7 @@ struct ofono_gprs {

[PATCH 14/21] gprs: Refactor to share remove_context method

2010-09-29 Thread Zhenhua Zhang
Remove duplicated code in gprs_deactivate_for_remove and gprs_remove_context. So they could share the same remove_context method. --- src/gprs.c | 58 -- 1 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/gprs.c

[PATCH 11/21] gprs: Make gprs_proto_to/from_string non-static

2010-09-29 Thread Zhenhua Zhang
So DUN server could share gprs_proto_to_string and gprs_proto_from_string. --- include/gprs-context.h |3 +++ src/gprs.c |5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/gprs-context.h b/include/gprs-context.h index f4c7321..de170b8 100644 ---

[PATCH 17/21] gprs: Add DUN server GPRS connect support

2010-09-29 Thread Zhenhua Zhang
Implement dial up networking in GPRS atom. --- src/gprs.c | 232 +++- 1 files changed, 229 insertions(+), 3 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 617ed05..eabc825 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -51,6 +51,10

[PATCH 19/21] gprs: Add gprs_get_status

2010-09-29 Thread Zhenhua Zhang
DUN server want to get latest GPRS status. --- include/gprs.h |2 ++ src/gprs.c |8 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/gprs.h b/include/gprs.h index 7985115..05cc086 100644 --- a/include/gprs.h +++ b/include/gprs.h @@ -86,6 +86,8 @@

[PATCH 15/21] gprs: Add DUN +CGATT support in gprs atom

2010-09-29 Thread Zhenhua Zhang
DUN client may request to attach/deattach GPRS network. Use gprs_netreg_update to set attach/deattach status. --- src/gprs.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index ccc6ca5..01babdc 100644 --- a/src/gprs.c +++

[PATCH 16/21] gprs: Add DUN +CGDCONT support in gprs atom

2010-09-29 Thread Zhenhua Zhang
DUN client may request to define the APN of context. Find the existing context and update the APN. --- src/gprs.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 01babdc..617ed05 100644 ---

[PATCH V2 1/5] bluetooth: Add reference count for bluetooth utils

2010-09-14 Thread Zhenhua Zhang
Add bluetooth_ref()/bluetooth_unref() to support reference count in bluetooth utils. --- plugins/bluetooth.c | 62 +-- 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index

[PATCH V2 3/5] bluetooth: Add bluetooth server support for DUN

2010-09-14 Thread Zhenhua Zhang
It watches Bluetooth adapter property changes and addes DUN record to listen DUN client connection request. --- plugins/bluetooth.c | 379 +++ plugins/bluetooth.h | 14 ++ 2 files changed, 393 insertions(+), 0 deletions(-) diff --git

[PATCH V2 4/5] emulator: Add emulator atom in oFono

2010-09-14 Thread Zhenhua Zhang
Create emulator atom when modem state changes to online. The emulator driver probes each driver to create specific emulator like DUN, HFP AG, etc. Once get client connection request, create GAtServer to talk AT commands with client side. --- Makefile.am|4 +- include/emulator.h | 54

[PATCH V2 5/5] dun_gw: Add DUN server plugin for oFono

2010-09-14 Thread Zhenhua Zhang
DUN server is probed when modem state changes to online. It registers DUN record to Bluetooth adapter and wait for incoming DUN connection. --- Makefile.am |3 + plugins/dun_gw.c | 113 ++ 2 files changed, 116 insertions(+), 0

[PATCH V2 0/5] Add DUN server for oFono

2010-09-14 Thread Zhenhua Zhang
Hi, I updated the DUN server patches according to the comments, mainly patch 4/5 and 5/5. It's quite similar with history/nettime plugins, which to probe the plugin when modem state changes to 'online'. Please review them. Thanks. Regards, Zhenhua

[PATCH 1/6] bluetooth: Add reference count for bluetooth utils

2010-09-12 Thread Zhenhua Zhang
Add bluetooth_ref()/bluetooth_unref() to support reference count in bluetooth utils. --- plugins/bluetooth.c | 62 +-- 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index

[PATCH 2/6] bluetooth: Add Btio library for DUN

2010-09-12 Thread Zhenhua Zhang
Btio library is the low level socket API for BT RFCOMM connection. We share the same library among BlueZ, Obex and oFono. So make sure you synchronize to other two projects when you make changes to btio.[ch]. --- Makefile.am |8 +- btio/btio.c | 1299

[PATCH 3/6] bluetooth: Add bluetooth server support for DUN

2010-09-12 Thread Zhenhua Zhang
It watches Bluetooth adapter property changes and addes DUN record to listen DUN client connection request. --- plugins/bluetooth.c | 379 +++ plugins/bluetooth.h | 14 ++ 2 files changed, 393 insertions(+), 0 deletions(-) diff --git

[PATCH 4/6] modem: Add method to get modem by path

2010-09-12 Thread Zhenhua Zhang
Return modem instance by searching modem path. --- include/modem.h |1 + src/modem.c | 15 +++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/modem.h b/include/modem.h index 8f8119e..600e875 100644 --- a/include/modem.h +++ b/include/modem.h @@ -36,6

[PATCH 6/6] emulator: Add emulator atom in oFono

2010-09-12 Thread Zhenhua Zhang
DUN server could create emulator and use GAtServer to talk AT commands to DUN client side. --- Makefile.am|4 +- include/emulator.h | 41 ++ plugins/dun_gw.c |8 +++ src/emulator.c | 121 src/ofono.h

[PATCH 0/6]Add DUN emulator in oFono

2010-09-12 Thread Zhenhua Zhang
Hi, I rebased the 1st series of DUN server patches with latest git tree and use bio library for BT RFCOMM connection. The btio library is exactly the same as the copies in bluez and obex. Comments are welcome! Regards, Zhenhua ___ ofono mailing list

[PATCH 5/6] dun_gw: Add DUN server plugin for oFono

2010-09-12 Thread Zhenhua Zhang
DUN server plug-in watches ofono modem status. When the modem comes to ONLINE state, it registers itself on Bluetooth adapter and want for incoming DUN connection. --- Makefile.am |3 + plugins/dun_gw.c | 141 ++ 2 files changed, 144

[PATCH 1/1] Add support to enable/disable specific plugin

2010-09-11 Thread Zhenhua Zhang
Support to load or not load specific plugin when ofono is started. E.g., use 'ofonod -P hfp' to disable hfp plugin. --- src/main.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/main.c b/src/main.c index d8df2f2..20bf0d7 100644 --- a/src/main.c +++

[PATCH] voicecall: Add check in dial_request_finish

2010-08-30 Thread Zhenhua Zhang
To avoid signal 11 if no dial_req exists. --- src/voicecall.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 6ad58ad..1313129 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -220,6 +220,9 @@ static void

[PATCH 1/1] hfp: Add faked sim driver to support SIM ready

2010-08-30 Thread Zhenhua Zhang
HFP modem doesn't have IMSI at all. In order to notify SIM ready to the core, we create a special sim driver with a faked IMSI number. --- Makefile.am |3 +- drivers/hfpmodem/hfpmodem.c |2 + drivers/hfpmodem/hfpmodem.h |3 + drivers/hfpmodem/sim.c | 114

[PATCH 0/1] Add faked sim driver for hfp modem

2010-08-30 Thread Zhenhua Zhang
Hi, The hfp modem driver doesn't work after recent sim related changes. So that I fake a sim driver for hfpmodem. Please review it. Thanks! Regards, Zhenhua ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono

[PATCH] udev: Add check for serial before string operation

2010-08-19 Thread Zhenhua Zhang
'serial' could be NULL in some case. So it need to add check before doing string operation. --- plugins/udev.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/plugins/udev.c b/plugins/udev.c index 84399de..6720a0c 100644 --- a/plugins/udev.c +++ b/plugins/udev.c @@ -86,7

[PATCH 02/10] gprs: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing gprs driver. --- drivers/atmodem/gprs.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c index bf82d06..dcf9759 100644 --- a/drivers/atmodem/gprs.c +++ b/drivers/atmodem/gprs.c

[PATCH 04/10] cbs: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing cbs driver. --- drivers/atmodem/cbs.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/atmodem/cbs.c b/drivers/atmodem/cbs.c index a1c4037..ef312e9 100644 --- a/drivers/atmodem/cbs.c +++ b/drivers/atmodem/cbs.c @@

[PATCH 05/10] ussd: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Add struct ussd_data to hold gatchat and cusd_id. So that we could unregister AT notifications in driver removing phase. --- drivers/atmodem/ussd.c | 33 ++--- 1 files changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/atmodem/ussd.c

[PATCH 07/10] stk: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing stk driver. --- drivers/atmodem/stk.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/atmodem/stk.c b/drivers/atmodem/stk.c index d6c19da..de687f8 100644 --- a/drivers/atmodem/stk.c +++ b/drivers/atmodem/stk.c @@

[PATCH 08/10] sms: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing sms driver. --- drivers/atmodem/sms.c | 31 +-- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c index ba98c12..335f456 100644 --- a/drivers/atmodem/sms.c +++

[PATCH 09/10] call-meter: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing call-meter at modem driver. --- drivers/atmodem/call-meter.c | 55 - 1 files changed, 37 insertions(+), 18 deletions(-) diff --git a/drivers/atmodem/call-meter.c b/drivers/atmodem/call-meter.c index 38774d4..f36ff3c

[PATCH 10/10] voicecall: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifiers when removing voicecall driver. --- drivers/atmodem/voicecall.c | 40 +++- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/drivers/atmodem/voicecall.c b/drivers/atmodem/voicecall.c index fce9144..16b3069 100644 ---

[PATCH 03/10] netreg: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing network registeration driver. --- drivers/atmodem/network-registration.c | 49 --- 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/drivers/atmodem/network-registration.c

[PATCH 06/10] ssn: Unregister AT notifiers when removing

2010-08-10 Thread Zhenhua Zhang
Unregister AT notifications when removing ssn driver. --- drivers/atmodem/ssn.c | 30 ++ 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/atmodem/ssn.c b/drivers/atmodem/ssn.c index f219cde..ce8f1e0 100644 --- a/drivers/atmodem/ssn.c +++

[PATCH 00/16] Implement DUN server for oFono

2010-08-10 Thread Zhenhua Zhang
Hi, These patches are based my 6 patches sent on Aug 5th. It implements DUN server logic to manage GPRS context create/destroy per DUN client requests. On DUN client side, you can use 'rfcomm bind 0 xx:xx:xx:xx:xx:xx 1' and then 'gsmdial -n /dev/rfcomm0 -c 1 -a cid -l' to test it. Review

[PATCH 02/16] emulator: Add status watches for ofono emulator

2010-08-10 Thread Zhenhua Zhang
The status watches monitor the emulator activities. Other atoms like gprs, netreg could register notification to watch emulator status changes. --- include/emulator.h |6 + src/emulator.c | 60 src/ofono.h| 11 +

[PATCH 06/16] gprs: Make gprs_proto_to/from_string non-static

2010-08-10 Thread Zhenhua Zhang
So DUN server could share gprs_proto_to_string and gprs_proto_from_string. --- include/gprs-context.h |3 +++ src/gprs.c |5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/gprs-context.h b/include/gprs-context.h index f4c7321..de170b8 100644 ---

[PATCH 09/16] gprs: Add DUN +CGATT support in gprs atom

2010-08-10 Thread Zhenhua Zhang
DUN client may request to attach/deattach GPRS network. Use gprs_netreg_update to set attach/deattach status. --- src/gprs.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index f91d0dc..5d850df 100644 --- a/src/gprs.c +++

[PATCH 11/16] gprs: Add DUN +CGDCONT support in gprs atom

2010-08-10 Thread Zhenhua Zhang
DUN client may request to create a new context. Call ofono_gprs_create_context to create it. --- src/gprs.c | 53 + 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 7e85d39..2313f52 100644 ---

[PATCH 12/16] gprs: Add DUN server GPRS connect support

2010-08-10 Thread Zhenhua Zhang
Implement dial up networking in GPRS atom. --- src/gprs.c | 232 +++- 1 files changed, 229 insertions(+), 3 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 2313f52..95f7ab2 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -49,6 +49,10

[PATCH 15/16] emulator: Watch GPRS status changes

2010-08-10 Thread Zhenhua Zhang
Watch GPRS status update to notify DUN client, such as +CGREG unsolicited result. --- src/emulator.c | 94 1 files changed, 94 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index 8811f6c..c8f3d65 100644 ---

[PATCH 13/16] gprs: Add status watch functions

2010-08-10 Thread Zhenhua Zhang
So DUN server could watch GPRS status changes and notify client unsolicited results like +CGREG. --- include/gprs.h |9 + src/gprs.c | 55 +++ 2 files changed, 64 insertions(+), 0 deletions(-) diff --git a/include/gprs.h

[PATCH 14/16] gprs: Add gprs_get_status

2010-08-10 Thread Zhenhua Zhang
So that DUN server could get latest GPRS status. --- include/gprs.h |2 ++ src/gprs.c |8 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/gprs.h b/include/gprs.h index c0a0e2f..ca23c45 100644 --- a/include/gprs.h +++ b/include/gprs.h @@ -76,6 +76,8 @@

[PATCH 16/16] emulator: Watch netreg status changes

2010-08-10 Thread Zhenhua Zhang
Watch netreg status update to notify DUN client, such as +CREG unsolicited result. --- src/emulator.c | 106 1 files changed, 106 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index c8f3d65..56edab6 100644 ---

[PATCH 5/6] dun_gw: Add DUN server plugin for oFono

2010-08-04 Thread Zhenhua Zhang
DUN server plug-in watches ofono modem status. When the modem comes to ONLINE state, it registers itself on Bluetooth adapter and want for incoming DUN connection. --- Makefile.am |4 ++ plugins/dun_gw.c | 143 ++ 2 files changed, 147

[PATCH 2/6] bluetooth: Add Btio library for DUN

2010-08-04 Thread Zhenhua Zhang
Btio library is the low level socket API for BT RFCOMM connection. --- plugins/btio.c | 479 plugins/btio.h | 118 ++ 2 files changed, 597 insertions(+), 0 deletions(-) create mode 100644 plugins/btio.c create mode 100644

[PATCH 1/6] bluetooth: Add reference count for bluetooth utils

2010-08-04 Thread Zhenhua Zhang
Add bluetooth_ref()/bluetooth_unref() to support reference count in bluetooth utils. --- plugins/bluetooth.c | 62 +-- 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index

[PATCH 4/6] modem: Add method to get modem by path

2010-08-04 Thread Zhenhua Zhang
Return modem instance by searching modem path. --- include/modem.h |1 + src/modem.c | 15 +++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/modem.h b/include/modem.h index e1cd049..34c3fbf 100644 --- a/include/modem.h +++ b/include/modem.h @@ -36,6

[PATCH 3/6] bluetooth: Add bluetooth server support for DUN

2010-08-04 Thread Zhenhua Zhang
It watches Bluetooth adapter property changes and addes DUN record to listen DUN client connection request. --- plugins/bluetooth.c | 379 +++ plugins/bluetooth.h | 14 ++ 2 files changed, 393 insertions(+), 0 deletions(-) diff --git

[PATCH v3] Fix busylooped in ppp_disconnect for huawei modem

2010-07-27 Thread Zhenhua Zhang
Huawei modem closes the modem port after PPP disconnect. So the channel of gatchat is NULL in ppp_disconnect. In such case, we resume the chat and it causes huawei_disconnect() get called and the gprs context is removed later. Before removing this gprs context, we should reply the pending DBus

[PATCH] Fix busylooped in ppp_disconnect for huawei modem

2010-07-26 Thread Zhenhua Zhang
Huawei modem closes the modem port after PPP disconnect. So the channel of gatchat is NULL in ppp_disconnect. In such case, we should not resume the chat and call disconnect function when removing the context. Secondly, before removing the gprs context, we should reply the pending DBus message to

[PATCH v2] Fix busylooped in ppp_disconnect for huawei modem

2010-07-26 Thread Zhenhua Zhang
Huawei modem closes the modem port after PPP disconnect. So the channel of gatchat is NULL in ppp_disconnect. In such case, we resume the chat and it causes huawei_disconnect() get called and the gprs context is removed later. Before removing this gprs context, we should reply the pending DBus

[PATCH] watch: Free service data in service_reply

2010-07-23 Thread Zhenhua Zhang
Avoid the memory leak of server_data. --- gdbus/watch.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/gdbus/watch.c b/gdbus/watch.c index 1d479fa..ccdbb64 100644 --- a/gdbus/watch.c +++ b/gdbus/watch.c @@ -468,8 +468,10 @@ static void service_reply(DBusPendingCall

[PATCH 1/5] bluetooth: Add reference count for bluetooth utils

2010-07-23 Thread Zhenhua Zhang
Add bluetooth_ref()/bluetooth_unref() to support reference count in bluetooth utils. --- plugins/bluetooth.c | 62 +-- 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index

[PATCH 0/5] Add oFono DUN emulator

2010-07-23 Thread Zhenhua Zhang
Hi, These are the updated patches for DUN emulator. First, it listens modem Online signal to register itself to bluetooth library. Second, it register DUN record through D-Bus interface. Btio library from Obex is simplified to only keep RFCOMM part. Thanks, Zhenhua

[PATCH 2/5] bluetooth: Add bluetooth server support for DUN

2010-07-23 Thread Zhenhua Zhang
It watches Bluetooth adapter property changes and added DUN record to listen client connection request. Btio library is the low level socket API for RFCOMM connection. --- plugins/bluetooth.c | 379 plugins/bluetooth.h | 14 ++ plugins/btio.c |

[PATCH 3/5] modem: Add method to get modem by path

2010-07-23 Thread Zhenhua Zhang
Return modem instance by searching modem path. --- include/modem.h |1 + src/modem.c | 15 +++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/include/modem.h b/include/modem.h index e1cd049..34c3fbf 100644 --- a/include/modem.h +++ b/include/modem.h @@ -36,6

[PATCH 5/5] emulator: Add emulator atom in oFono

2010-07-23 Thread Zhenhua Zhang
DUN server could create emulator and use GAtServer to talk AT commands to DUN client side. --- Makefile.am|4 +- include/emulator.h | 41 ++ plugins/dun_gw.c |8 +++ src/emulator.c | 121 src/ofono.h

[PATCH] Fix: Free modem name in ofono_modem_remove

2010-07-21 Thread Zhenhua Zhang
Avoid the memory leak of modem name. --- src/modem.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/modem.c b/src/modem.c index ccbbc27..79a5d58 100644 --- a/src/modem.c +++ b/src/modem.c @@ -1495,6 +1495,7 @@ void ofono_modem_remove(struct ofono_modem *modem)

[PATCH 0/1] Avoid timeout too quickly in PPP handshaking

2010-07-09 Thread Zhenhua Zhang
Hi, The patch is to increase the Max-Failure count for NAKs in IPCP handshaking. It is inspired by the similar implementation in pppd. Our PPP server uses IPCP NAKs to stall until acquiring the client IP address from DHCP server, so we need to increase the max failure count (default is 5) in

[PATCH 1/1] ppp: Add MAX_IPCP_FAILURE to avoid timeout quickly

2010-07-09 Thread Zhenhua Zhang
We use IPCP NAK response to stall the progress of acquiring the client IP address from DHCP server. So we need to increase the max failure of NAKs in IPCP handshaking. --- gatchat/ppp_cp.c |8 ++-- gatchat/ppp_cp.h |2 +- gatchat/ppp_ipcp.c | 10 +- gatchat/ppp_lcp.c |

[PATCH] huawei: recreate the GPRS atom on hup

2010-07-08 Thread Zhenhua Zhang
System is either crashed or usb_serial module reports warnings after activate/deactivate GPRS context several times. Handle this by remove and recreate the GPRS atom in oFono. Tested with Huawei E1552, EM770W. System: Ubuntu 9.10. Kernel: 2.6.31-16-generic #53-Ubuntu SMP --- plugins/huawei.c |

[PATCH 03/15] emulator: Add status watches for ofono emulator

2010-07-07 Thread Zhenhua Zhang
The status watches monitor the emulator activities. Other atoms like gprs, netreg could register notification to watch emulator status changes. --- include/emulator.h |6 + src/emulator.c | 55 src/ofono.h| 11 ++

[PATCH 06/15] emulator: Add emulator status watches in gprs atom

2010-07-07 Thread Zhenhua Zhang
Add dun_watch to watch emulator status update in gprs atom. So that gprs atom could get notified when we get request to create new PPP connection from DUN client; --- src/gprs.c | 63 1 files changed, 63 insertions(+), 0 deletions(-)

[PATCH 04/15] emulator: Add get properities for emulator

2010-07-07 Thread Zhenhua Zhang
oFono properties: Powered: Whether the emulator is powered on. Type: Type could be one of supported emulator type, default is DUN. --- src/emulator.c | 28 +++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index

[PATCH 07/15] emulator: Add emulator status watches in netreg

2010-07-07 Thread Zhenhua Zhang
Add dun_watch to watch emulator status update for netreg atom. --- src/network.c | 58 + 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/src/network.c b/src/network.c index c6410a8..b9f0a08 100644 --- a/src/network.c +++

[PATCH 09/15] emulator: Implement dialing up for DUN

2010-07-07 Thread Zhenhua Zhang
It handles client ATD*99# request and complete GPRS connection. Pass client IP address through IPCP packet to client side. --- include/emulator.h | 34 src/emulator.c | 226 2 files changed, 260 insertions(+), 0 deletions(-)

[PATCH 10/15] emulator: Add emulator dial up support in GPRS

2010-07-07 Thread Zhenhua Zhang
Implement dial up support in GPRS atom. --- src/gprs.c | 439 +++- 1 files changed, 437 insertions(+), 2 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index dd58c51..cb83e23 100644 --- a/src/gprs.c +++ b/src/gprs.c @@ -39,6 +39,7 @@

[PATCH 12/15] emulator: Watch GPRS status changes

2010-07-07 Thread Zhenhua Zhang
Watch GPRS status changes to notify DUN client any unsolicited result, like +CGREG status changes. --- include/gprs.h | 11 +++ src/emulator.c | 88 src/gprs.c | 64 3 files changed,

[PATCH 13/15] emulator: Watch netreg status changes

2010-07-07 Thread Zhenhua Zhang
Watch netreg status changes to notify DUN client any unsolicited result, like +CREG status changes. --- src/emulator.c | 94 1 files changed, 94 insertions(+), 0 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index

[PATCH 14/15] gprs: Add DUN +CGATT support in gprs atom

2010-07-07 Thread Zhenhua Zhang
DUN client may request us to attach/deattach GPRS network. In such case, use gprs_netreg_update to update gprs status. --- src/gprs.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/src/gprs.c b/src/gprs.c index 3ed056a..1f9e396 100644 --- a/src/gprs.c +++

[PATCH] test-server: Use cfmakeraw to set TTY raw mode

2010-07-06 Thread Zhenhua Zhang
Use cfmakeraw to disable echoing and special characters processing. If we don't turn off ICRNL, TTY layer translates \r\n to \n\n. --- gatchat/test-server.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gatchat/test-server.c b/gatchat/test-server.c index

[PATCH 2/2] gathdlc: Unset disconnect function in unref

2010-07-06 Thread Zhenhua Zhang
If we destroy PPP instance from g_at_ppp_unref, we should not invoke io disconnect function. --- gatchat/gathdlc.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c index 08a1939..0186e46 100644 --- a/gatchat/gathdlc.c +++

[PATCH 1/2] gatppp: Check ppp instance before unref it

2010-07-06 Thread Zhenhua Zhang
--- gatchat/gatppp.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c index 1d41ded..d9b1627 100644 --- a/gatchat/gatppp.c +++ b/gatchat/gatppp.c @@ -446,6 +446,9 @@ void g_at_ppp_unref(GAtPPP *ppp) { gboolean is_zero; +

[PATCH] test-server: Refactor set_raw_mode

2010-07-06 Thread Zhenhua Zhang
Rename variable 'options' to 'ti' and use sizeof(ti). --- gatchat/test-server.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gatchat/test-server.c b/gatchat/test-server.c index 2911978..49012dc 100644 --- a/gatchat/test-server.c +++ b/gatchat/test-server.c @@

[PATCH] gatserver: Don't free twice after user disconnect

2010-07-04 Thread Zhenhua Zhang
It's possible to free gatserver in user disconnect function. So we should not free it again. --- gatchat/gatserver.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 3fa26a0..c63f04b 100644 --- a/gatchat/gatserver.c +++

[PATCH 3/6] dun_gw: Add DUN emulator plugin

2010-07-04 Thread Zhenhua Zhang
It implements DUN server role and register itself as agent to BlueZ interface. --- Makefile.am |3 + plugins/dun_gw.c | 274 ++ 2 files changed, 277 insertions(+), 0 deletions(-) create mode 100644 plugins/dun_gw.c diff --git

[PATCH 5/6] emulator: Add test case for ofono emulator

2010-07-04 Thread Zhenhua Zhang
Add gatchat/test-emulator to test DUN emulator. 1. Start ofonod and power on phonesim modem. 2. Run gatchat/test-emulator. It could find dun emulator and create pty terminal. Use minicom to talk to the DUN emulator. --- Makefile.am |7 +- gatchat/test-emulator.c | 654

[PATCH 6/6] dun_gw: Probe emulator when we have new adapter

2010-07-04 Thread Zhenhua Zhang
Create emulator when we receive Bluetooth adapter property changes. In order to do that, we iterate all active modems. If it has GPRS atom and has not associated DUN emulator yet, create new emulator for it. --- include/emulator.h |4 plugins/dun_gw.c | 29

[PATCH 0/6] Add oFono DUN emulator

2010-07-04 Thread Zhenhua Zhang
Hi, This series are the initial patches for ofono DUN emulator. 1. src/emulator.c handles emulator create, remove, enable, disable and etc.. 2. plugins/dun_gw.c is the plugin similar to hfp.c. It's the interface with BlueZ serial DUN agent. 3. gatchat/test-emulator.c is the test case to test

[PATCH 1/6] emulator: Add ofono_emulator framework

2010-07-04 Thread Zhenhua Zhang
Each type of emulator can be register through emulator drivers statically. When modem powers up, oFono probes emulator driver to create emulator for each modem. --- Makefile.am|4 +- include/dbus.h |1 + include/emulator.h | 63 src/emulator.c | 271

[PATCH 2/6] bluetooth: Add register service for bluetooth

2010-07-04 Thread Zhenhua Zhang
Add bluetooth_register_service() and bluetooth_unregister_service() where bluetooth profiles plugins like DUN GW can register themselves per adapter. It shares existing bluetooth framework to listen bluetooth events (new adapters, bluetoothd shutdown, etc..) --- plugins/bluetooth.c | 125

[PATCH 1/2] huawei: Remove existing Huawei EM770 plugin

2010-07-01 Thread Zhenhua Zhang
--- Makefile.am |3 - plugins/em770.c | 229 --- plugins/ofono.rules |2 - plugins/udev.c | 26 -- 4 files changed, 0 insertions(+), 260 deletions(-) delete mode 100644 plugins/em770.c diff --git a/Makefile.am

[PATCH 0/3] Merge Huawei EM770 into plugins/huawei.c

2010-06-29 Thread Zhenhua Zhang
This series merges existing plugins/em770.c with plugins/huawei.c. The most part of EM770 is the same as plugins/huawei.c, except EM770 has voicecall capability. The idea is to get modem model from udev. If it is EM770, we enable voicecall and related features for EM770 only. Best Regards,

[PATCH 1/3] huawei: Remove existing Huawei EM770 plugin

2010-06-29 Thread Zhenhua Zhang
--- Makefile.am |3 - plugins/em770.c | 229 --- plugins/ofono.rules |2 - plugins/udev.c | 26 -- 4 files changed, 0 insertions(+), 260 deletions(-) delete mode 100644 plugins/em770.c diff --git a/Makefile.am

[PATCH 2/3] huawei: Add Huawei EM770 modem support

2010-06-29 Thread Zhenhua Zhang
Huawei EM770W is a 3G WCDMA modem that supports HSPA/UMTS/EDGE/GPRS/GSM data service and WCDMA/GSM short message services. It also has voice call capability that supports both 2G and 3G network. --- plugins/huawei.c| 31 ++- plugins/ofono.rules |3 +++

[PATCH 3/3] huawei: Remove call meter support for EM770

2010-06-29 Thread Zhenhua Zhang
EM770W returns COMMAND NOT SUPPORT when we send AT+CCWE=1 to initialize call meter atom. So disable it. --- plugins/huawei.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/plugins/huawei.c b/plugins/huawei.c index 0dc6ae4..98ce65b 100644 --- a/plugins/huawei.c +++

[PATCH 3/5] test-server: Add PPP server support

2010-06-24 Thread Zhenhua Zhang
So that gsmdial and wvdial could talk to test-server and establish PPP connection. --- gatchat/test-server.c | 131 ++--- 1 files changed, 123 insertions(+), 8 deletions(-) diff --git a/gatchat/test-server.c b/gatchat/test-server.c index

[PATCH 0/5] Add PPP server support

2010-06-24 Thread Zhenhua Zhang
Hi, I updated the patch according to the comments. Please review them. Thanks! Best Regards, Zhenhua ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono

[PATCH 4/5] test-server: Configure network interface

2010-06-24 Thread Zhenhua Zhang
Require ROOT priviledge to: 1. Run external command to configure and bring up network interface. 2. Enable kernel IP forwarding. --- gatchat/test-server.c | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/gatchat/test-server.c

[PATCH 5/5] gsmdial: Configure network interface for PPP

2010-06-24 Thread Zhenhua Zhang
--- gatchat/gsmdial.c | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c index a69a610..59f1a5c 100644 --- a/gatchat/gsmdial.c +++ b/gatchat/gsmdial.c @@ -38,6 +38,8 @@ #include gattty.h #include gatppp.h

[PATCH 1/5] gatppp: Add PPP server extension

2010-06-24 Thread Zhenhua Zhang
1. Add interface to set PPP server info by g_at_ppp_set_server_info. 2. Pass local and peer address through IPCP handshaking. --- gatchat/gatppp.c | 11 ++- gatchat/gatppp.h |6 +- gatchat/ppp.h |5 +- gatchat/ppp_ipcp.c | 239

  1   2   3   >