[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 25a1192..2911978 100644
--- a/gatchat/test-server.c
+++ b/gatchat/test-server.c
@@ -848,12 +848,10 @@ static void set_raw_mode(int fd)
 {
struct termios options;
 
+   memset(options, 0, sizeof(struct termios));
tcgetattr(fd, options);
-
-   /* Set TTY as raw mode to disable echo back of input characters
-* when they are received from Modem to avoid feedback loop */
-   options.c_lflag = ~(ICANON | ECHO | ECHOE | ISIG);
-
+   tcflush(fd, TCIOFLUSH);
+   cfmakeraw(options);
tcsetattr(fd, TCSANOW, options);
 }
 
-- 
1.6.3.3

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


RE: Modem emulator and DUN server side for oFono and BlueZ

2010-07-06 Thread Zhang, Zhenhua
Hi Suraj,

suraj wrote:
 Hi Zhenhua,
 
 
 On Wed, 2010-05-05 at 06:27 +0530, Zhang, Zhenhua wrote:
 Hi Padovan,
 
 Gustavo F. Padovan wrote:
 Hi Zhenhua,
 
 * Zhang, Zhenhua zhenhua.zh...@intel.com [2010-04-27 15:53:54
 +0800]: 
 
 Hi,
 
 I am now working on modem emulator and one usage is for DUN
 server role. Since Padovan is working on client role, it's
 good to share my rough thinking for server side
 implementation. Here are the simple steps I have:
 
 1. Create an oFono emulator atom in oFono. It's the emulator
 manager that could create DUN, HFP AG or SPP type emulators.
 It exposes dbus methods like CreateEmulator, DestroyEmulator,
 GetProperty, etc.
 
 2. DUN agent server in BlueZ watch oFono and call
 CreateEmulator and pass the file descriptor to oFono. This
 server could further implement HFP AG and SPP connection.
 
 
 Shouldn't the emulator register itself on the BlueZ agent server?
 
 It's fine to register the emulator like HFP client. In this
 way, we might able to share the agent with DUN server as well. Thanks.
 
 
 --
 Gustavo F. Padovan
 http://padovan.org
 ___
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono
 
 
 
 Regards,
 Zhenhua
 
 --
 To unsubscribe from this list: send the line unsubscribe
 linux-bluetooth in the body of a message to
 majord...@vger.kernel.org 
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
 Do you have DUNP server emulator implemented?
 I was thinking about implementing the same. But would like to use your
 implementation if you have already done it.
 
 Regards
 Suraj

Yes, I am working DUN server part now. (I assume 'DUNP' you mentioned is 'DUN', 
dialing up networking). I am trying to submit patches to upstream now. Hope it 
could be ready asap so you can try it if interested. Thanks.

Regards,
Zhenhua

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[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
+++ b/gatchat/gathdlc.c
@@ -278,6 +278,7 @@ void g_at_hdlc_unref(GAtHDLC *hdlc)
hdlc-record_fd = -1;
}
 
+   g_at_io_set_disconnect_function(hdlc-io, NULL, NULL);
g_at_io_unref(hdlc-io);
hdlc-io = NULL;
 
-- 
1.6.3.3

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[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;
 
+   if (ppp == NULL)
+   return;
+
is_zero = g_atomic_int_dec_and_test(ppp-ref_count);
 
if (is_zero == FALSE)
-- 
1.6.3.3

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Atmodem PPP Link establishment issues

2010-07-06 Thread Arun.Ravindran

 Hi,
 
 We are using atmodem plugin and are trying to get the PPP up and
 running.  I am able to create and activate context, but the PPP link
 establishment seems to have issues.
 
 The list-context script returns:
 
 [ /generic ]
 [ /generic/primarycontext3 ]
 Username = 
 Name = Internet access
 Settings = { Interface=ppp0 Netmask=255.255.255.255
 Method=static DomainNameServers=192.89.123.231,192.89.123.230,
 Address=109.240.91.14 }
 Active = 1
 AccessPointName = internet
 Password = 
 Type = internet
 
 But for a PPP link, there needs to be two ip addresses, one local and
 one of the peer. Here in the settings you see only one IP address.
 
 I collected the logs during the PPP link establishment, (frames and a
 brief detail about it)
 
 Sent from  Ofono:
 Frame: 0x7e 0xff   0x7d 0x23 0xc0 0x21 0x7d 0x21 0x7d 0x21 0x7d 0x20
 0x7d 0x2a 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x58 0x7b 0x7e 
 03 c021 1 (conf req) 1 (id) 0x000a (length) 2 (accm) 6 (length) 
 fcs
 
 Recv from Modem:
 Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x21 0x7d 0x21 0x7d 0x20
 0x7d 0x34 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x7d 0x25 0x7d 0x26 0xd2 0x8a 0xde 0xd2 0x7d 0x27 0x7d 0x22 0x7d 0x28
 0x7d 0x22 0xbf 0x7d 0x35 0x7e
 3 c021 1 (conf req) 1 (id) 0x0034 2 6 0 0 0 0 5(magic num) 6 d2 8a de
 d2 7(protocol compression) 2 (id) 8 (addr, control compres) 2 fcs
 
 
 Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x22 0x7d 0x21 0x7d 0x20
 0x7d 0x2a 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x31 0x7d 0x2f 0x7e
 3 c021 2 (conf ack) 1 (id) 0x000a 2 6 0 0 0 0 fcs
 
 Sent from  ofono:
 Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x22 0x7d 0x21 0x7d 0x20
 0x7d 0x34 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x7d 0x25 0x7d 0x26 0xd2 0x8a 0xde 0xd2 0x7d 0x27 0x7d 0x22 0x7d 0x28
 0x7d 0x22 0x54 0x7c 0x7e
 3 c021 2 (conf ack) 1 0x0034 2 6  5 6 d2 8a de d2 7 2 8 2 fcs
 
 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x1 0x0 0x22 0x3 0x6 0x0 0x0 0x0
 0x0 0x81 0x6 0x0 0x0 0x0 0x0 0x83 0x6 0x0 0x0 0x0 0x0 0x82 0x6 0x0 0x0
 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0x80 0x52 0x7e
 3 8021 1 (conf req) 1 (id) 0x0022 (length)  3 (ip) 6  81(dns1) 6
  83(nbns1) 6  82(dns2) 6  84 (nbns2) 6  fcs
 
 Recv from Modem:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x1 0x0 0x10 0x81 0x6 0xa 0xb 0xc
 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x4d 0x4d 0x7e
 3 8021 3(conf nak) 1 (id) 0x010 81 (dns1) 6 abcd 83 (dns2) 6 abce fcs
 
 Sent from ofono:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x2 0x0 0x22 0x3 0x6 0x0 0x0 0x0
 0x0 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x82 0x6 0x0 0x0
 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0xad 0x7a 0x7e
 3 8021 1 (conf ack) 2 (id) 0x0022 3 6  81 6 abcd 83 6 abce 82 6
  84 6  fcs
 
 Recv from Modem:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x2 0x0 0x10 0x81 0x6 0xa 0xb 0xc
 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x33 0x95 0x7e
 3 8021 3(conf nak) 2 (id) 0x010 81 (dns1) 6 abcd 83 (dns2) 6 abce fcs
 
 Sent from ofono:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x3 0x0 0x22 0x3 0x6 0x0 0x0 0x0
 0x0 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x82 0x6 0x0 0x0
 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0xce 0x3a 0x7e
 3 8021 1 (conf req) 3 (id) 0x0022 3 6  81 6 abcd 83 6 abce 82 6
  84 6  fcs
 
 Recv from Modem:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x1 0x0 0x4 0x0 0xb7 0x7e 
 3 8021 1 (conf req) 1 (id) 0 4  0 fcs
 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x4 0x3 0x0 0x10 0x82 0x6 0x0 0x0 0x0
 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0x34 0xcc 0x7e
 3 8021 4 (conf reject) 3(id) 0x0010 82 6  84 6  fcs
 
 Sent from ofono:
 Frame: 0xff 0x3 0x80 0x21 0x2 0x1 0x0 0x4 0xcd 0x92 0x7e
 3 8021 2 (conf ack) 1 (id) 0 4 
 
 Frame: 0xff 0x3 0x80 0x21 0x1 0x4 0x0 0x16 0x3 0x6 0x0 0x0 0x0 0x0
 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0xe3 0x9 0x7e 
 3 8021 1 (conf req)  4 (id) 0x0016 3 6   81 6 abcd 83 6 abce fcs
 
 Recv from modem:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x4 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0xc5
 0xf1 0x7e
 3 8021 3 (conf nak) 4 (id) 0x0016 3 (ip) 6 6d f0 40 be 81 (dns1) 6 c0
 59 7b e7 83 (dns2) 6 c0 59 7b e6 fcs
 
 Sent from ofono:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x5 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0x2
 0x9c 0x7e
 3 8021 1 (conf req) 5 (id) 0x0016 3 6 6d f0 40 be 81 6 c0 59 7b e7 83
 6 c0 59 7b e6 fcs
 
 Recv from Modem:
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x2 0x5 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0xf4
 0x6f 0x7e
 3 8021 2 (conf ack) 5 (id) 0x0016 3 6 6d f0 40 be 81 6 c0 59 7b e7 83
 6 c0 59 7b e6 fcs
 
 I could not find any issues in the state transition w.r.t the RFC, but
 I get only one IP address, what is going wrong? Could any one help?
 
 
 --
 

Re: Atmodem PPP Link establishment issues

2010-07-06 Thread Marcel Holtmann
Hi Arun,

please try to compose proper emails and not just forward or reply to
your own message to send it again.

 We are using atmodem plugin and are trying to get the PPP up and
 running.  I am able to create and activate context, but the PPP link
 establishment seems to have issues.
 
 The list-context script returns:
 
 [ /generic ] 
 [ /generic/primarycontext3 ] 
 Username = 
 Name = Internet access 
 Settings = { Interface=ppp0 Netmask=255.255.255.255
 Method=static DomainNameServers=192.89.123.231,192.89.123.230,
 Address=109.240.91.14 }
 
 Active = 1 
 AccessPointName = internet 
 Password = 
 Type = internet
 
 But for a PPP link, there needs to be two ip addresses, one local and
 one of the peer. Here in the settings you see only one IP address.

No they don't have to be. Who says so. The second address of PPP is
totally irrelevant since it is a point-to-point link and we do interface
routing (route add default dev ppp0).

 I collected the logs during the PPP link establishment, (frames and a
 brief detail about it)
 
 Sent from  Ofono: 
 Frame: 0x7e 0xff   0x7d 0x23 0xc0 0x21 0x7d 0x21 0x7d 0x21 0x7d 0x20
 0x7d 0x2a 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x58 0x7b 0x7e 
 
 03 c021 1 (conf req) 1 (id) 0x000a (length) 2 (accm) 6 (length) 
 fcs
 
 Recv from Modem: 
 Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x21 0x7d 0x21 0x7d 0x20
 0x7d 0x34 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x7d 0x25 0x7d 0x26 0xd2 0x8a 0xde 0xd2 0x7d 0x27 0x7d 0x22 0x7d 0x28
 0x7d 0x22 0xbf 0x7d 0x35 0x7e
 
 3 c021 1 (conf req) 1 (id) 0x0034 2 6 0 0 0 0 5(magic num) 6 d2 8a de
 d2 7(protocol compression) 2 (id) 8 (addr, control compres) 2 fcs
 
 
 Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x22 0x7d 0x21 0x7d 0x20
 0x7d 0x2a 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x31 0x7d 0x2f 0x7e
 
 3 c021 2 (conf ack) 1 (id) 0x000a 2 6 0 0 0 0 fcs
 
 Sent from  ofono: 
 Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x22 0x7d 0x21 0x7d 0x20
 0x7d 0x34 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
 0x7d 0x25 0x7d 0x26 0xd2 0x8a 0xde 0xd2 0x7d 0x27 0x7d 0x22 0x7d 0x28
 0x7d 0x22 0x54 0x7c 0x7e
 
 3 c021 2 (conf ack) 1 0x0034 2 6  5 6 d2 8a de d2 7 2 8 2 fcs
 
 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x1 0x0 0x22 0x3 0x6 0x0 0x0 0x0
 0x0 0x81 0x6 0x0 0x0 0x0 0x0 0x83 0x6 0x0 0x0 0x0 0x0 0x82 0x6 0x0 0x0
 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0x80 0x52 0x7e
 
 3 8021 1 (conf req) 1 (id) 0x0022 (length)  3 (ip) 6  81(dns1) 6
  83(nbns1) 6  82(dns2) 6  84 (nbns2) 6  fcs
 
 Recv from Modem: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x1 0x0 0x10 0x81 0x6 0xa 0xb 0xc
 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x4d 0x4d 0x7e 
 3 8021 3(conf nak) 1 (id) 0x010 81 (dns1) 6 abcd 83 (dns2) 6 abce fcs
 
 Sent from ofono: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x2 0x0 0x22 0x3 0x6 0x0 0x0 0x0
 0x0 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x82 0x6 0x0 0x0
 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0xad 0x7a 0x7e
 
 3 8021 1 (conf ack) 2 (id) 0x0022 3 6  81 6 abcd 83 6 abce 82 6
  84 6  fcs
 
 Recv from Modem: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x2 0x0 0x10 0x81 0x6 0xa 0xb 0xc
 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x33 0x95 0x7e 
 3 8021 3(conf nak) 2 (id) 0x010 81 (dns1) 6 abcd 83 (dns2) 6 abce fcs
 
 Sent from ofono: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x3 0x0 0x22 0x3 0x6 0x0 0x0 0x0
 0x0 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x82 0x6 0x0 0x0
 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0xce 0x3a 0x7e
 
 3 8021 1 (conf req) 3 (id) 0x0022 3 6  81 6 abcd 83 6 abce 82 6
  84 6  fcs
 
 Recv from Modem: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x1 0x0 0x4 0x0 0xb7 0x7e 
 3 8021 1 (conf req) 1 (id) 0 4  0 fcs
 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x4 0x3 0x0 0x10 0x82 0x6 0x0 0x0 0x0
 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0x34 0xcc 0x7e 
 3 8021 4 (conf reject) 3(id) 0x0010 82 6  84 6  fcs
 
 Sent from ofono: 
 Frame: 0xff 0x3 0x80 0x21 0x2 0x1 0x0 0x4 0xcd 0x92 0x7e 
 3 8021 2 (conf ack) 1 (id) 0 4 
 
 Frame: 0xff 0x3 0x80 0x21 0x1 0x4 0x0 0x16 0x3 0x6 0x0 0x0 0x0 0x0
 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0xe3 0x9 0x7e 
 
 3 8021 1 (conf req)  4 (id) 0x0016 3 6   81 6 abcd 83 6 abce fcs
 
 Recv from modem: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x4 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0xc5
 0xf1 0x7e
 
 3 8021 3 (conf nak) 4 (id) 0x0016 3 (ip) 6 6d f0 40 be 81 (dns1) 6 c0
 59 7b e7 83 (dns2) 6 c0 59 7b e6 fcs
 
 Sent from ofono: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x5 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0x2
 0x9c 0x7e
 
 3 8021 1 (conf req) 5 (id) 0x0016 3 6 6d f0 40 be 81 6 c0 59 7b e7 83
 6 c0 59 7b e6 fcs
 
 Recv from Modem: 
 Frame: 0x7e 0xff 0x3 0x80 0x21 0x2 0x5 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0xf4
 0x6f 0x7e
 

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

2010-07-06 Thread Marcel Holtmann
Hi Zhenhua,

 ---
  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;
  
 + if (ppp == NULL)
 + return;
 +
   is_zero = g_atomic_int_dec_and_test(ppp-ref_count);
  
   if (is_zero == FALSE)

since we have been safe-guarding this in other unref functions as well,
I also applied this patch.

In general the calling code is doing something wrong here if it tries to
unref a NULL pointer.

Regards

Marcel


___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


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

2010-07-06 Thread Marcel Holtmann
Hi Zhenhua,

 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 25a1192..2911978 100644
 --- a/gatchat/test-server.c
 +++ b/gatchat/test-server.c
 @@ -848,12 +848,10 @@ static void set_raw_mode(int fd)
  {
   struct termios options;
  
 + memset(options, 0, sizeof(struct termios));
   tcgetattr(fd, options);
 -
 - /* Set TTY as raw mode to disable echo back of input characters
 -  * when they are received from Modem to avoid feedback loop */
 - options.c_lflag = ~(ICANON | ECHO | ECHOE | ISIG);
 -
 + tcflush(fd, TCIOFLUSH);
 + cfmakeraw(options);
   tcsetattr(fd, TCSANOW, options);
  }

I am fine with using cfmakeraw. So patch has been applied.

Minor comment here that sizeof(options) would be better then referencing
the struct itself. And in general we have used ti as variable name for
termios options. Don't ask me really why. Just have done that in the
patch. So feel free to send an cleanup patch.

Regards

Marcel


___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: Question about set modem power state to off

2010-07-06 Thread Denis Kenzior
Hi Caiwen,

On 07/05/2010 09:51 PM, Zhang, Caiwen wrote:
 Hi all,
  
 When set modem power state to off, all atoms and interfaces except
 'org.ofono.Modem'  are
  
 removed and unregistered. So all APIs execpt 'org.ofono.Modem'  can not
 be used after that.
  
 But,  when modem power state is off (AT+CFUN=0), some feature should
 still be available. such
  
 as access SIM card(import contact from SIM) and STK.  I think maybe
 ofono should at least keep 'phonebook'
  
 and 'stk' atom after set power state to off.
  

What you're thinking of here is the 'Online' property of the Modem which
controls the RX/TX circuit status.  When Online is False and Powered is
True the modem can still access the SIM.  Once the modem is powered off,
it is truly off.

This feature is still in development and thus no driver is currently
taking advantage of this functionality.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: Reg. SMS sent status

2010-07-06 Thread Denis Kenzior
Hi Satya,

 How an application notified that SMS is sent status (i.e success or failure) ?

You should really be using the history plugin for this.  You will get
much more information about the message this way.

 
 Because storage of SMS in some database is application responsibility.
 Once SMS sent status is received according to that application shall
 take an action(status change) on the stored message (i.e. moving SMS
 from OUTBOX to SENTBOX).

Today, oFono returns from the SendMessage call only when the message has
been successfully submitted to the network or the message submission has
failed.

Please note that there is a proposal on the mailing list to change how
the SmsManager interface works.  The interface is likely to change in
the next month or two.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


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

2010-07-06 Thread Denis Kenzior
Hi Zhenhua,

 @@ -1019,9 +1019,6 @@ static void io_disconnect(gpointer user_data)
  
   if (server-user_disconnect)
   server-user_disconnect(server-user_disconnect_data);
 -
 - if (server-destroyed)
 - g_free(server);
  }
  
  static void server_wakeup_writer(GAtServer *server)

Good catch.  Patch has been applied, thanks.

Regards,
-Denis

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Voicecall gaps.

2010-07-06 Thread Denis Kenzior
Hi Pekka,

On 07/05/2010 08:40 AM, pekka.pe...@nokia.com wrote:
 From: Pekka Pessi pekka.pe...@nokia.com
 
 Missing voicecall functionality pieces from tp-ring point-of-view.
 ---
  TODO |   27 +++
  doc/voicecallmanager-api.txt |8 
  2 files changed, 31 insertions(+), 4 deletions(-)

Please don't lump TODO and documentation changes into a single patch.
Separate into two patches.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


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

2010-07-06 Thread Denis Kenzior
Hi Zhenhua,

 @@ -278,6 +278,7 @@ void g_at_hdlc_unref(GAtHDLC *hdlc)
   hdlc-record_fd = -1;
   }
  
 + g_at_io_set_disconnect_function(hdlc-io, NULL, NULL);

Since GAtHDLC does not set the disconnect function, this really belongs
in GAtPPP.

   g_at_io_unref(hdlc-io);
   hdlc-io = NULL;
  

However, I really question why this patch is necessary.  The only way
the disconnect function is not reset today is if the GAtIO is refed and
g_at_chat_resume is not called.

We do call g_at_io_set_disconnect function in g_at_chat_resume.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


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

2010-07-06 Thread Denis Kenzior
Hi Zhenhua,

 Here the problem is that disconnect function could be invoked if remote IO is 
 disconnected after our ppp instance is freed. So we should avoid to invoke 
 io_disconnect() in below case.
 
 Entering new phase: 5
 PPP: lcp: pppcp_timeout: current state 5:STOPPING
 PPP: lcp: pppcp_generate_event: current state 5:STOPPING
 PPP: event: 5 (TO-), action: 803, new_state: 3 (STOPPED)
 PPP: lcp: pppcp_this_layer_finished: current state 3:STOPPED
 Entering new phase: 0
 ofonod[3114]: src/emulator.c:ppp_disconnect() 
 Server:  \r\nNO CARRIER\r\n
 ofonod[3114]: Pcui: \r\n^BOOT:20291346,0,0,0,20\r\n
 Server:  AT+CFUN=0\r
 ofonod[3114]: src/emulator.c:cfun_cb() set CFUN to 0
 Server:  \r\nOK\r\n
 
 
 (gdb) bt
 #0  0x0806faf6 in pppcp_generate_event (data=0x95bfde0, event_type=DOWN, 
 packet=0x0, len=0)
 at gatchat/ppp_cp.c:638
 #1  0x0806e9cd in io_disconnect (user_data=0x95bfde8) at gatchat/gatppp.c:349
 #2  0x001ea504 in g_source_callback_unref (cb_data=0x95a8678)
 at /build/buildd/glib2.0-2.22.3/glib/gmain.c:1077
 #3  0x001eaace in g_source_destroy_internal (source=0x95a86b0, context=value 
 optimized out, have_lock=1)
 at /build/buildd/glib2.0-2.22.3/glib/gmain.c:856
 #4  0x001eaedb in g_main_dispatch (context=0x95a5f80) at 
 /build/buildd/glib2.0-2.22.3/glib/gmain.c:1985
 #5  IA__g_main_context_dispatch (context=0x95a5f80) at 
 /build/buildd/glib2.0-2.22.3/glib/gmain.c:2513
 #6  0x001ee730 in g_main_context_iterate (context=0x95a5f80, block=value 
 optimized out, dispatch=1, 
 self=0x95a6c58) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2591
 #7  0x001eeb9f in IA__g_main_loop_run (loop=0x95a5ef0) at 
 /build/buildd/glib2.0-2.22.3/glib/gmain.c:2799
 #8  0x08094548 in main (argc=1, argv=0xbffb8ba4) at src/main.c:227
 (gdb) frame 1
 #1  0x0806e9cd in io_disconnect (user_data=0x95bfde8) at gatchat/gatppp.c:349
 349   pppcp_signal_down(ppp-lcp);
 (gdb) p ppp
 $6 = value optimized out
 (gdb) info local
 No locals.
 (gdb) 

It seems the real culprit is that GAtServer is not restoring the
io_disconnect on the GAtIO object in g_at_server_resume.  Why are we not
seeing this crash in test-server?

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/2] Voicecall gaps.

2010-07-06 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

Missing voicecall functionality pieces from tp-ring point-of-view.
---
 TODO |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index 470d4a6..fc539a7 100644
--- a/TODO
+++ b/TODO
@@ -265,6 +265,33 @@ Supplementary Services
   Complexity: C8
 
 
+Voicecall
+=
+
+- Supplementary service notifications on remote party actions:
+  - call has been put on hold (+CSSU: 2)
+  - call has been retrieved (+CSSU: 3), and
+  - joining call to a multiparty conference (+CSSU: 4)
+
+  Priority: Medium
+  Complexity: C1
+  Owner: Pekka Pessi pekka.pe...@nokia.com
+
+- Dial strings. Include CLIR prefixes and 2nd stage dial strings in the
+  DialString call property. Add dialstring accessor method to C API.
+
+  Priority: Medium
+
+- Provide feedback of sent DTMF tones. Emit SendingTones signal if modem can
+  provide approximate starting and stopping times for DTMF tones. Signal
+  argument contains a string of DTMF tones to be sent, or empty string when
+  all tones has been sent.
+
+  Priority: Medium
+  Complexity: C2
+  Owner: Pekka Pessi pekka.pe...@nokia.com
+
+
 Miscellaneous
 =
 
-- 
1.7.0.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/2] Voicecall gaps.

2010-07-06 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

Missing voicecall functionality pieces from tp-ring point-of-view.
---
 TODO |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index 470d4a6..fc539a7 100644
--- a/TODO
+++ b/TODO
@@ -265,6 +265,33 @@ Supplementary Services
   Complexity: C8
 
 
+Voicecall
+=
+
+- Supplementary service notifications on remote party actions:
+  - call has been put on hold (+CSSU: 2)
+  - call has been retrieved (+CSSU: 3), and
+  - joining call to a multiparty conference (+CSSU: 4)
+
+  Priority: Medium
+  Complexity: C1
+  Owner: Pekka Pessi pekka.pe...@nokia.com
+
+- Dial strings. Include CLIR prefixes and 2nd stage dial strings in the
+  DialString call property. Add dialstring accessor method to C API.
+
+  Priority: Medium
+
+- Provide feedback of sent DTMF tones. Emit SendingTones signal if modem can
+  provide approximate starting and stopping times for DTMF tones. Signal
+  argument contains a string of DTMF tones to be sent, or empty string when
+  all tones has been sent.
+
+  Priority: Medium
+  Complexity: C2
+  Owner: Pekka Pessi pekka.pe...@nokia.com
+
+
 Miscellaneous
 =
 
-- 
1.7.0.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/2] Clarified VoiceCallManager.SendTones documentation.

2010-07-06 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

---
 doc/voicecallmanager-api.txt |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/voicecallmanager-api.txt b/doc/voicecallmanager-api.txt
index 7877ac5..bc79fc3 100644
--- a/doc/voicecallmanager-api.txt
+++ b/doc/voicecallmanager-api.txt
@@ -108,10 +108,10 @@ Methods   dict GetProperties()
 
void SendTones(string tones)
 
-   Sends the DTMF tones to the network.  Under GSM the
-   tones have a fixed duration.  Tones can be one of:
-   '0' - '9', '*', '#', 'A', 'B', 'C', 'D'. The last four
-   are typically not used in normal circumstances.
+   Sends the DTMF tones to the network.  The tones have
+   a fixed duration.  Tones can be one of: '0' - '9',
+   '*', '#', 'A', 'B', 'C', 'D'.  The last four are
+   typically not used in normal circumstances.
 
 SignalsPropertyChanged(string property, variant value)
 
-- 
1.7.0.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[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
@@ -846,13 +846,13 @@ static void server_destroy(gpointer user)
 
 static void set_raw_mode(int fd)
 {
-   struct termios options;
+   struct termios ti;
 
-   memset(options, 0, sizeof(struct termios));
-   tcgetattr(fd, options);
+   memset(ti, 0, sizeof(ti));
+   tcgetattr(fd, ti);
tcflush(fd, TCIOFLUSH);
-   cfmakeraw(options);
-   tcsetattr(fd, TCSANOW, options);
+   cfmakeraw(ti);
+   tcsetattr(fd, TCSANOW, ti);
 }
 
 static gboolean create_tty(const char *modem_path)
-- 
1.6.3.3

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


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

2010-07-06 Thread Zhang, Zhenhua
Hi Marcel,

Marcel Holtmann wrote:
 Hi Zhenhua,
 
 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 25a1192..2911978 100644
 --- a/gatchat/test-server.c
 +++ b/gatchat/test-server.c
 @@ -848,12 +848,10 @@ static void set_raw_mode(int fd)  {
  struct termios options;
 
 +memset(options, 0, sizeof(struct termios));
  tcgetattr(fd, options);
 -
 -/* Set TTY as raw mode to disable echo back of input characters
 - * when they are received from Modem to avoid feedback loop */
 -options.c_lflag = ~(ICANON | ECHO | ECHOE | ISIG); -
 +tcflush(fd, TCIOFLUSH);
 +cfmakeraw(options);
  tcsetattr(fd, TCSANOW, options);
  }
 
 I am fine with using cfmakeraw. So patch has been applied.
 
 Minor comment here that sizeof(options) would be better then
 referencing the struct itself. And in general we have used ti as
 variable name for termios options. Don't ask me really why. Just have
 done that in the patch. So feel free to send an cleanup patch.

The cleanup patch has been sent. Please review it.
 
 Regards
 
 Marcel
 
 
 ___
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono

Regards,
Zhenhua

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono