From: Gustavo F. Padovan <padovan@profusion.mobi>
To: ofono@ofono.org
Subject: Re: [PATCH] Add CNAP support (callerid name presentation) to isimodem
Date: Tue, 22 Feb 2011 18:22:24 -0300 [thread overview]
Message-ID: <20110222212224.GD2249@joana> (raw)
In-Reply-To: <1298403084-6119-1-git-send-email-a.reversat@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4487 bytes --]
Hi Antoine,
* Antoine Reversat <a.reversat@gmail.com> [2011-02-22 14:31:24 -0500]:
> ---
> drivers/isimodem/voicecall.c | 39 ++++++++++++++++++++++++++++++++++++++-
> src/voicecall.c | 4 ++--
> 2 files changed, 40 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
> index 0a32f27..e778f23 100644
> --- a/drivers/isimodem/voicecall.c
> +++ b/drivers/isimodem/voicecall.c
> @@ -56,8 +56,10 @@ struct isi_call {
> uint8_t cause;
> uint8_t addr_type;
> uint8_t presentation;
> + uint8_t name_presentation;
> uint8_t reason;
> char address[20];
> + char name[20];
> char addr_pad[4];
> };
>
> @@ -231,6 +233,7 @@ static void isi_call_origin_address_sb_proc(struct isi_voicecall *ivc,
> isi_call_any_address_sb_proc(ivc, call, sb);
> }
>
> +
Unrelated change here. Please remove.
> static void isi_call_destination_address_sb_proc(struct isi_voicecall *ivc,
> struct isi_call *call,
> GIsiSubBlockIter *sb)
> @@ -239,6 +242,29 @@ static void isi_call_destination_address_sb_proc(struct isi_voicecall *ivc,
> isi_call_any_address_sb_proc(ivc, call, sb);
> }
>
> +static void isi_call_origin_info_sb_proc(struct isi_voicecall *ivc,
> + struct isi_call *call,
> + GIsiSubBlockIter *sb)
> +{
> + uint8_t pres;
> + uint8_t id;
> + uint8_t len;
> + char *name;
> +
Spaces here.
> + if (!g_isi_sb_iter_get_byte(sb, &pres, 2) ||
> + !g_isi_sb_iter_get_byte(sb, &id, 6) ||
> + !g_isi_sb_iter_get_byte(sb, &len, 7) ||
> + !g_isi_sb_iter_get_alpha_tag(sb, &name, 2 * len, 8))
> + return;
Isn't this better:
if (!g_isi_sb_iter_get_byte())
return;
if (!g_isi_sb_iter_get_byte())
return;
if (!g_isi_sb_iter_get_byte())
return;
if (!g_isi_sb_iter_get_alpha_tag())
return;
> +
spaces here.
> +
> + DBG("Got name %s", name);
and here.
> + call->name_presentation = pres;
> + strncpy(call->name, name, sizeof(call->name));
> +
> + g_free(name);
> +}
> +
> static void isi_call_mode_sb_proc(struct isi_voicecall *ivc,
> struct isi_call *call,
> GIsiSubBlockIter *sb)
> @@ -396,13 +422,19 @@ static struct ofono_call isi_call_as_ofono_call(const struct isi_call *call)
> ocall.status = isi_call_status_to_clcc(call);
>
> memcpy(number->number, call->address, sizeof(number->number));
> + memcpy(ocall.name, call->name, sizeof(ocall.name));
> +
Extra blank line here.
>
> number->type = 0x80 | call->addr_type;
> ocall.clip_validity = call->presentation & 3;
> + ocall.cnap_validity = call->name_presentation & 3;
spaces here.
>
> if (ocall.clip_validity == 0 && strlen(number->number) == 0)
> ocall.clip_validity = 2;
>
> + if (ocall.cnap_validity == 0 && strlen(call->name) == 0)
> + ocall.cnap_validity = 2;
> +
> return ocall;
> }
>
> @@ -513,11 +545,12 @@ static void isi_call_notify(struct ofono_voicecall *ovc, struct isi_call *call)
>
> ocall = isi_call_as_ofono_call(call);
>
> - DBG("id=%u,%s,%u,\"%s\",%u,%u",
> + DBG("id=%u,%s,%u,\"%s\",\"%s\",%u,%u",
> ocall.id,
> ocall.direction ? "terminated" : "originated",
> ocall.status,
> ocall.phone_number.number,
> + ocall.name,
Spaces here.
> ocall.phone_number.type,
> ocall.clip_validity);
>
> @@ -622,6 +655,10 @@ static void isi_call_status_ind_cb(const GIsiMessage *msg, void *data)
> isi_call_origin_address_sb_proc(ivc, call, &iter);
> break;
>
> + case CALL_ORIGIN_INFO:
Extra spaces here.
> + isi_call_origin_info_sb_proc(ivc, call, &iter);
> + break;
> +
> case CALL_GSM_DETAILED_CAUSE:
> case CALL_DESTINATION_PRE_ADDRESS:
> case CALL_DESTINATION_POST_ADDRESS:
> diff --git a/src/voicecall.c b/src/voicecall.c
> index 4606668..b608394 100644
> --- a/src/voicecall.c
> +++ b/src/voicecall.c
> @@ -1951,8 +1951,8 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
> struct ofono_call *newcall;
>
> DBG("Got a voicecall event, status: %d, id: %u, number: %s"
> - " called_number: %s", call->status, call->id,
> - call->phone_number.number, call->called_number.number);
> + " called_number: %s, name: %s", call->status, call->id,
> + call->phone_number.number, call->called_number.number, call->name);
Code over 80 characters.
--
Gustavo F. Padovan
http://profusion.mobi
next prev parent reply other threads:[~2011-02-22 21:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 19:31 [PATCH] Add CNAP support (callerid name presentation) to isimodem Antoine Reversat
2011-02-22 21:22 ` Gustavo F. Padovan [this message]
2011-02-22 21:34 ` Antoine Reversat
2011-02-25 16:28 ` [PATCH] Add CNAP support for isimodem Antoine Reversat
2011-02-25 16:33 ` Antoine Reversat
2011-02-25 16:34 ` Antoine Reversat
2011-02-25 16:53 ` Gustavo F. Padovan
2011-02-25 17:04 ` Antoine Reversat
2011-02-25 17:10 ` [PATCH 1/2] Clean up isi_call_any_address_sb_proc Antoine Reversat
2011-02-25 18:43 ` Denis Kenzior
2011-02-25 17:10 ` [PATCH 2/2] Add CNAP support for isimodem Antoine Reversat
2011-02-25 18:45 ` 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=20110222212224.GD2249@joana \
--to=padovan@profusion.mobi \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.