All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: SIM Insertion Notification
Date: Sat, 14 Jul 2012 06:02:22 -0500	[thread overview]
Message-ID: <500151BE.5010102@gmail.com> (raw)
In-Reply-To: <AC43737FA4508F468C9A8245BF95DAE652C7B08F9A@RIMAILMBX1.gtk.gtech.com>

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

Hi Brian,

On 07/14/2012 11:31 AM, Ruptash, Brian wrote:
> I'm running ofono 1.7, with a Cinterion PH8-P plugin I wrote and will submit once I've fully tested it.  One problem I have is I never receive notification of SIM insertion, i.e. the Present propertyChanged.  Looking at the code it seems pretty obvious why, unless I'm (probably) missing something.
>
> All the plugins, including mine, do similar to the following:
>
>      static void ph8_pre_sim(struct ofono_modem *modem)
>      {
>          struct ph8_data *data = ofono_modem_get_data(modem);
>          struct ofono_sim *sim;
>
>          ofono_devinfo_create(modem, 0, "atmodem", data->app);
>          sim = ofono_sim_create(modem, OFONO_VENDOR_CINTERION_PH8,
>                      "atmodem", data->app);
>
>          if (sim&&  data->have_sim == TRUE)
>              ofono_sim_inserted_notify(sim, TRUE);
>      }
>
> The call to ofono_sim_create() probes the atmodem driver, which ends with:
>
>      g_idle_add(at_sim_register, sim);
>
> So the subsequent call to ofono_sim_inserted_notify() will fail, as at_sim_register() is called later when it is scheduled.
>
> The logs bear this out, so I'm at a loss to understand how anyone receives a SIM notification... What am I missing here?
>

Everything is working as it should, what exactly is the problem?  You 
can call ofono_sim_inserted_notify before the atom is registered, but 
that means the Present property will be 'True' when you perform the 
initial GetProperties call.

This is meant for devices which do not support SIM hot-swap (e.g. most 
USB devices and many earlier phones where the SIM is behind the battery).

Regards,
-Denis

  reply	other threads:[~2012-07-14 11:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-14 16:31 SIM Insertion Notification Ruptash, Brian
2012-07-14 11:02 ` Denis Kenzior [this message]
2012-07-15 12:42   ` Brian Ruptash
2012-07-15 16:01     ` Marcel Holtmann

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=500151BE.5010102@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 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.