Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/4] Add gatutil.c to share common APIs with GAtServer
Date: Thu, 14 Jan 2010 09:49:08 -0600	[thread overview]
Message-ID: <201001140949.09231.denkenz@gmail.com> (raw)
In-Reply-To: <1263207230-22036-1-git-send-email-zhenhua.zhang@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]

Hi Zhenhua,

> +gboolean g_at_util_set_io(GIOChannel *io)

Rename this g_at_util_setup_io

> +{
> +	GIOFlags io_flags;
> +
> +	if (g_io_channel_set_encoding(io, NULL, NULL) !=
> +			G_IO_STATUS_NORMAL)
> +		return FALSE;
> +
> +	io_flags = g_io_channel_get_flags(io);
> +
> +	io_flags |= G_IO_FLAG_NONBLOCK;
> +	io_flags |= G_IO_FLAG_IS_READABLE;
> +	io_flags |= G_IO_FLAG_IS_WRITEABLE;

According to GLib docs the READABLE and WRITEABLE flags are not settable.  
Don't see the point in setting them anyway, please get rid of this.

> +
> +	if (g_io_channel_set_flags(io, io_flags, NULL) !=
> +			G_IO_STATUS_NORMAL)
> +		return FALSE;
> +
> +	g_io_channel_set_close_on_unref(io, TRUE);
> +
> +	return TRUE;
> +}
> +
> diff --git a/gatchat/gatutil.h b/gatchat/gatutil.h
> new file mode 100644
> index 0000000..63bbfff
> --- /dev/null
> +++ b/gatchat/gatutil.h
> @@ -0,0 +1,46 @@
> +/*
> + *
> + *  AT chat library with GLib integration
> + *
> + *  Copyright (C) 2008-2010  Intel Corporation. All rights reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
>  USA + *
> + */
> +
> +#ifndef __GATUTIL_H
> +#define __GATUTIL_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#include "gatresult.h"

Get rid of this include

> +
> +typedef void (*GAtResultFunc)(gboolean success, GAtResult *result,
> +				gpointer user_data);
> +typedef void (*GAtNotifyFunc)(GAtResult *result, gpointer user_data);

The GAtNotify and GAtResultFunc should stay in gatchat.h

> +typedef void (*GAtDisconnectFunc)(gpointer user_data);
> +typedef void (*GAtDebugFunc)(const char *str, gpointer user_data);

These don't belong here, create a new file called gat.h and put them there.

Regards,
-Denis

  parent reply	other threads:[~2010-01-14 15:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 10:53 [PATCH 1/4] Add gatutil.c to share common APIs with GAtServer Zhenhua Zhang
2010-01-11 10:53 ` [PATCH 2/4] Add GAtServer basic parsing support Zhenhua Zhang
2010-01-11 10:53   ` [PATCH 3/4] Add AT command parsing support and interface Zhenhua Zhang
2010-01-11 10:53     ` [PATCH 4/4] Add test-server test application for GAtServer Zhenhua Zhang
2010-01-14 17:24   ` [PATCH 2/4] Add GAtServer basic parsing support Denis Kenzior
2010-01-14 21:53     ` Marcel Holtmann
2010-01-14 20:57       ` Denis Kenzior
2010-01-14 15:49 ` Denis Kenzior [this message]
2010-01-15  1:24   ` [PATCH 1/4] Add gatutil.c to share common APIs with GAtServer Zhang, Zhenhua
2010-01-20 20:23     ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001140949.09231.denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox