From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5892257996637658698==" MIME-Version: 1.0 From: Ryan Raasch Subject: Re: [PATCH] When setting the serial port, the previous settings need to be preserved. Date: Tue, 20 Oct 2009 11:10:22 +0200 Message-ID: <4ADD7E7E.8030903@gmail.com> In-Reply-To: <4ADD6A05.8060301@gmail.com> List-Id: To: ofono@ofono.org --===============5892257996637658698== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sorry. I have had a long few days. The last patch was just COMPLETELY = wrong :( I think i got it right this time... Apologies, Ryan Ryan Raasch wrote: > = > Denis Kenzior wrote: >> Hi Ryan, >> >>> This took a while to locate. Shouldn't it be possible to use stty >>> outside the daemon, and then daemon would just continue as usual? >>> >>> In my case, the cread was being removed, so no input data could be read. >> >> Sorry but the patch is wrong, since you're blowing away all options = >> that have been set via the GHashTable. > = > Yea. Sorry. Put it in the wrong place, uggh. It should go before setting = > the options, since the switches are or'ing and xor'ing. > = >> >> GAtTty is really a convenience method, if you need something specific, = >> pass the option in the GHashTable or setup the fd however you wish by = >> yourself. >> >> Regards, >> -Denis > = > But, there is a problem with the opening of the serial port b/c the = > CREAD flag is destroyed if it is active, making the serial port unreadabl= e. > = > Ryan > = >> _______________________________________________ >> ofono mailing list >> ofono-bdc2hr5oBkPYtjvyW6yDsg(a)public.gmane.org >> http://lists.ofono.org/listinfo/ofono >=20 --===============5892257996637658698== Content-Type: text/x-patch MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="serial_port_enable_CREAD.patch" ZGlmZiAtLWdpdCBhL2dhdGNoYXQvZ2F0dHR5LmMgYi9nYXRjaGF0L2dhdHR0eS5jCmluZGV4IDYz ZDI2ZDQuLmQ2MjQzMzYgMTAwNjQ0Ci0tLSBhL2dhdGNoYXQvZ2F0dHR5LmMKKysrIGIvZ2F0Y2hh dC9nYXR0dHkuYwpAQCAtOTcsNiArOTcsMTkgQEAgc3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