From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7300854487931046880==" MIME-Version: 1.0 From: Ryan Raasch Subject: Re: [PATCH] When setting the serial port, the previous settings need to be preserved. Date: Wed, 21 Oct 2009 10:43:36 +0200 Message-ID: <4ADEC9B8.2050701@gmail.com> In-Reply-To: <200910201036.03028.denkenz@gmail.com> List-Id: To: ofono@ofono.org --===============7300854487931046880== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hello, I have attached a small patch which allows gattty.c to enable/disable = the read functionality on the serial port. Cheers, Ryan Denis Kenzior wrote: > Hi Ryan, > = >>> You're blowing away the result of cfmakeraw. Most of the devices are n= ot >>> true serial devices and so do not need any of the special options. = >>> Passing a NULL options GHashTable should result in cfmakeraw. Why don't >>> you just pass all the options you need instead of using tcgetattr? >> Should i just move the tcgetattr() to happen before cfmakeraw()? > = > Only one (executed last) will have effect, and I want it to be the cfmake= raw. = > So simply get rid of tcgetattr. > = >>> The other parts of the patch look good to me. >> Ok. Why don't i just add the string options ("read", others...) in >> gattty.c? > = > This is what I would prefer. > = > Regards, > -Denis > _______________________________________________ > ofono mailing list > ofono(a)ofono.org > http://lists.ofono.org/listinfo/ofono --===============7300854487931046880== Content-Type: text/x-patch MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="serial_port_enable_CREAD.patch" ZGlmZiAtLWdpdCBhL2dhdGNoYXQvZ2F0dHR5LmMgYi9nYXRjaGF0L2dhdHR0eS5jCmluZGV4IDYz ZDI2ZDQuLmYxOGVjYTQgMTAwNjQ0Ci0tLSBhL2dhdGNoYXQvZ2F0dHR5LmMKKysrIGIvZ2F0Y2hh dC9nYXR0dHkuYwpAQCAtOTcsNiArOTcsMTggQEAgc3RhdGljIGdib29sZWFuIHNldF9iYXVkKGNv bnN0IGNoYXIgKmJhdWQsIHN0cnVjdCB0ZXJtaW9zICp0aSkKIAlyZXR1cm4gVFJVRTsKIH0K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