return FALSE;
}
-static void sim_state_watch(void *user, enum ofono_sim_state new_state)
+static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct sim_poll_data *spd = user;
spd->sim_state_watch = ofono_sim_add_state_watch(spd->sim,
sim_state_watch, spd, NULL);
- sim_state_watch(spd, ofono_sim_get_state(spd->sim));
+ sim_state_watch(ofono_sim_get_state(spd->sim), spd);
sim_status_poll(spd);
typedef void (*ofono_sim_imsi_cb_t)(const struct ofono_error *error,
const char *imsi, void *data);
-typedef void (*ofono_sim_state_event_notify_cb_t)(void *data,
- enum ofono_sim_state new_state);
+typedef void (*ofono_sim_state_event_cb_t)(enum ofono_sim_state new_state,
+ void *data);
typedef void (*ofono_sim_file_read_cb_t)(int ok, int total_length, int record,
const unsigned char *data,
const unsigned char *ofono_sim_get_cphs_service_table(struct ofono_sim *sim);
unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim,
- ofono_sim_state_event_notify_cb_t cb,
- void *data, ofono_destroy_func destroy);
+ ofono_sim_state_event_cb_t cb,
+ void *data, ofono_destroy_func destroy);
void ofono_sim_remove_state_watch(struct ofono_sim *sim, unsigned int id);
g_free(modems);
}
-static void modem_sim_ready(void *user, enum ofono_sim_state new_state)
+static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct ofono_modem *modem = user;
modem->sim = __ofono_atom_get_data(atom);
modem->sim_ready_watch = ofono_sim_add_state_watch(modem->sim,
- modem_sim_ready,
- modem, NULL);
+ sim_state_watch,
+ modem, NULL);
}
int ofono_modem_register(struct ofono_modem *modem)
memcpy(efimg, &data[1], 9);
}
-static void sim_ready(void *user, enum ofono_sim_state new_state)
+static void sim_ready(enum ofono_sim_state new_state, void *user)
{
struct ofono_sim *sim = user;
void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
{
- ofono_sim_state_event_notify_cb_t notify;
+ ofono_sim_state_event_cb_t notify;
GSList *l;
if (inserted == TRUE && sim->state == OFONO_SIM_STATE_NOT_PRESENT)
struct ofono_watchlist_item *item = l->data;
notify = item->notify;
- notify(item->notify_data, sim->state);
+ notify(sim->state, item->notify_data);
}
if (inserted)
}
unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim,
- ofono_sim_state_event_notify_cb_t notify,
- void *data, ofono_destroy_func destroy)
+ ofono_sim_state_event_cb_t notify,
+ void *data, ofono_destroy_func destroy)
{
struct ofono_watchlist_item *item;
static void sim_set_ready(struct ofono_sim *sim)
{
GSList *l;
- ofono_sim_state_event_notify_cb_t notify;
+ ofono_sim_state_event_cb_t notify;
if (sim == NULL)
return;
struct ofono_watchlist_item *item = l->data;
notify = item->notify;
- notify(item->notify_data, sim->state);
+ notify(sim->state, item->notify_data);
}
}
return vc;
}
-static void sim_state_watch(void *user, enum ofono_sim_state new_state)
+static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct ofono_voicecall *vc = user;
sim_state_watch,
vc, NULL);
- sim_state_watch(vc, ofono_sim_get_state(sim));
+ sim_state_watch(ofono_sim_get_state(sim), vc);
}
void ofono_voicecall_register(struct ofono_voicecall *vc)