isimodem: use simplified client interface

This commit is contained in:
Pekka Pessi 2011-01-04 17:48:33 +02:00 committed by Aki Niemi
parent 593e74f793
commit e0b6a058a2
14 changed files with 117 additions and 118 deletions

View File

@ -139,8 +139,8 @@ static void isi_set(struct ofono_call_barring *barr, const char *lock,
if (cbd == NULL || bd == NULL)
goto error;
if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT,
set_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(bd->client, msg, sizeof(msg),
set_resp_cb, cbd, g_free))
return;
error:
@ -258,8 +258,8 @@ static void isi_query(struct ofono_call_barring *barr, const char *lock,
if (cbd == NULL || bd == NULL)
goto error;
if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT,
query_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(bd->client, msg, sizeof(msg),
query_resp_cb, cbd, g_free))
return;
error:
@ -321,8 +321,8 @@ static void isi_set_passwd(struct ofono_call_barring *barr, const char *lock,
if (cbd == NULL || bd == NULL)
goto error;
if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT,
set_passwd_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(bd->client, msg, sizeof(msg),
set_passwd_resp_cb, cbd, g_free))
return;
error:

View File

@ -253,8 +253,8 @@ static void isi_registration(struct ofono_call_forwarding *cf, int type,
memcpy((char *) &msg[13], ucs2, strlen(number->number) * 2);
g_free(ucs2);
if (g_isi_client_send(fd->client, msg, 7 + msg[8], SS_TIMEOUT,
registration_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(fd->client, msg, 7 + msg[8],
registration_resp_cb, cbd, g_free))
return;
error:
@ -316,8 +316,8 @@ static void isi_erasure(struct ofono_call_forwarding *cf, int type, int cls,
if (cbd == NULL || fd == NULL || ss_code < 0)
goto error;
if (g_isi_client_send(fd->client, msg, sizeof(msg), SS_TIMEOUT,
erasure_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(fd->client, msg, sizeof(msg),
erasure_resp_cb, cbd, g_free))
return;
error:
@ -411,8 +411,8 @@ static void isi_query(struct ofono_call_forwarding *cf, int type, int cls,
if (cbd == NULL || fd == NULL || cls != 7 || ss_code < 0)
goto error;
if (g_isi_client_send(fd->client, msg, sizeof(msg), SS_TIMEOUT,
query_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(fd->client, msg, sizeof(msg),
query_resp_cb, cbd, g_free))
return;
error:

View File

@ -172,8 +172,8 @@ static void isi_cw_query(struct ofono_call_settings *cs, int cls,
if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SS_TIMEOUT,
query_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(sd->client, msg, sizeof(msg),
query_resp_cb, cbd, g_free))
return;
error:
@ -241,8 +241,8 @@ static void isi_cw_set(struct ofono_call_settings *cs, int mode, int cls,
if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SS_TIMEOUT,
set_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(sd->client, msg, sizeof(msg),
set_resp_cb, cbd, g_free))
return;
error:

View File

@ -173,11 +173,11 @@ static int isi_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
ofono_cbs_set_data(cbs, cd);
if (g_isi_client_send(cd->client, msg, sizeof(msg), CBS_TIMEOUT,
routing_resp_cb, cbs, NULL) == NULL)
return -errno;
if (g_isi_client_send(cd->client, msg, sizeof(msg),
routing_resp_cb, cbs, NULL))
return 0;
return 0;
return -errno;
}
static void isi_cbs_remove(struct ofono_cbs *cbs)
@ -205,8 +205,7 @@ static void isi_cbs_remove(struct ofono_cbs *cbs)
* Send a promiscuous routing release, so as not to hog
* resources unnecessarily after being removed.
*/
g_isi_client_send(cd->client, msg, sizeof(msg), CBS_TIMEOUT, NULL,
NULL, NULL);
g_isi_client_send(cd->client, msg, sizeof(msg), NULL, NULL, NULL);
g_isi_client_destroy(cd->client);
g_free(cd);

View File

@ -115,12 +115,12 @@ static void isi_query_manufacturer(struct ofono_devinfo *info,
INFO_PRODUCT_INFO_READ_REQ,
INFO_PRODUCT_MANUFACTURER
};
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT,
info_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
return;
error:
@ -139,12 +139,12 @@ static void isi_query_model(struct ofono_devinfo *info,
INFO_PRODUCT_INFO_READ_REQ,
INFO_PRODUCT_NAME
};
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT,
info_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
return;
error:
@ -164,12 +164,12 @@ static void isi_query_revision(struct ofono_devinfo *info,
0x00, INFO_MCUSW,
0x00, 0x00, 0x00, 0x00
};
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT,
info_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
return;
error:
@ -188,12 +188,12 @@ static void isi_query_serial(struct ofono_devinfo *info,
INFO_SERIAL_NUMBER_READ_REQ,
INFO_SN_IMEI_PLAIN
};
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT,
info_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
return;
error:
@ -228,8 +228,10 @@ static int isi_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
return -ENOMEM;
}
ofono_devinfo_set_data(info, data);
g_isi_client_set_timeout(data->client, INFO_TIMEOUT);
g_isi_client_verify(data->client, reachable_cb, info, NULL);
return 0;

View File

@ -324,9 +324,9 @@ static void send_context_activate(GIsiClient *client, void *opaque)
g_isi_client_ind_subscribe(client, GPDS_CONTEXT_DEACTIVATE_IND,
deactivate_ind_cb, cd);
if (g_isi_client_send(client, msg, sizeof(msg),
if (g_isi_client_send_with_timeout(client, msg, sizeof(msg),
GPDS_CTX_ACTIVATE_TIMEOUT,
context_activate_cb, cd, NULL) != NULL)
context_activate_cb, cd, NULL))
g_isi_pipe_start(cd->pipe);
else
gprs_up_fail(cd);
@ -372,8 +372,7 @@ static void send_context_authenticate(GIsiClient *client, void *opaque)
{ cd->password, password_len },
};
if (g_isi_client_vsend(client, iov, 4, GPDS_TIMEOUT,
context_auth_cb, cd, NULL) == NULL)
if (!g_isi_client_vsend(client, iov, 4, context_auth_cb, cd, NULL))
gprs_up_fail(cd);
}
@ -419,8 +418,8 @@ static void link_conf_cb(const GIsiMessage *msg, void *opaque)
if (!check_resp(msg, GPDS_LL_CONFIGURE_RESP, 2, cd, gprs_up_fail))
return;
if (g_isi_client_vsend(cd->client, iov, 2, GPDS_TIMEOUT,
context_conf_cb, cd, NULL) == NULL)
if (!g_isi_client_vsend(cd->client, iov, 2,
context_conf_cb, cd, NULL))
gprs_up_fail(cd);
}
@ -441,8 +440,8 @@ static void create_context_cb(const GIsiMessage *msg, void *opaque)
cd->handle = req[1] = data[0];
if (g_isi_client_send(cd->client, req, sizeof(req), GPDS_TIMEOUT,
link_conf_cb, cd, NULL) == NULL)
if (!g_isi_client_send(cd->client, req, sizeof(req),
link_conf_cb, cd, NULL))
gprs_up_fail(cd);
}
@ -454,8 +453,8 @@ static void create_pipe_cb(GIsiPipe *pipe)
GPDS_CONTEXT_ID_CREATE_REQ,
};
if (g_isi_client_send(cd->client, msg, sizeof(msg), GPDS_TIMEOUT,
create_context_cb, cd, NULL) == NULL)
if (!g_isi_client_send(cd->client, msg, sizeof(msg),
create_context_cb, cd, NULL))
gprs_up_fail(cd);
}
@ -551,12 +550,10 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc,
msg[1] = cd->handle;
if (g_isi_client_send(cd->client, msg, sizeof(msg),
if (!g_isi_client_send_with_timeout(cd->client, msg, sizeof(msg),
GPDS_CTX_DEACTIVATE_TIMEOUT,
context_deactivate_cb, cd, NULL) == NULL) {
context_deactivate_cb, cd, NULL))
gprs_down_fail(cd);
return;
}
}
static void gpds_ctx_reachable_cb(const GIsiMessage *msg, void *opaque)

View File

@ -93,7 +93,7 @@ static void set_attach_mode(struct ofono_gprs *gprs, int attached)
0x00
};
g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT,
g_isi_client_send(gd->client, msg, sizeof(msg),
configure_resp_cb, gprs, NULL);
}
@ -280,7 +280,7 @@ static void gpds_reachable_cb(const GIsiMessage *msg, void *opaque)
return;
}
g_isi_client_send(gd->info_client, req, sizeof(req), GPDS_TIMEOUT,
g_isi_client_send(gd->info_client, req, sizeof(req),
info_pp_read_resp_cb, gprs, NULL);
}
@ -301,6 +301,7 @@ static int isi_gprs_probe(struct ofono_gprs *gprs,
ofono_gprs_set_data(gprs, gd);
g_isi_client_set_timeout(gd->client, GPDS_TIMEOUT);
g_isi_client_verify(gd->client, gpds_reachable_cb, gprs, NULL);
return 0;
@ -397,9 +398,10 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached,
GPDS_FOLLOW_OFF
};
if (g_isi_client_send(gd->client, msg, sizeof(msg),
GPDS_ATTACH_TIMEOUT, attach_resp_cb,
cbd, g_free) != NULL)
if (g_isi_client_send_with_timeout(gd->client,
msg, sizeof(msg),
GPDS_ATTACH_TIMEOUT, attach_resp_cb,
cbd, g_free))
return;
} else {
const unsigned char msg[] = {
@ -408,9 +410,10 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached,
0x00 /* sub-blocks */
};
if (g_isi_client_send(gd->client, msg, sizeof(msg),
GPDS_DETACH_TIMEOUT, detach_resp_cb,
cbd, g_free) != NULL)
if (g_isi_client_send_with_timeout(gd->client,
msg, sizeof(msg),
GPDS_DETACH_TIMEOUT, detach_resp_cb,
cbd, g_free))
return;
}
@ -474,8 +477,8 @@ static void isi_gprs_attached_status(struct ofono_gprs *gprs,
if (cbd == NULL || gd == NULL)
goto error;
if (g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT,
status_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(gd->client, msg, sizeof(msg),
status_resp_cb, cbd, g_free))
return;
error:

View File

@ -338,8 +338,8 @@ static void rat_resp_cb(const GIsiMessage *msg, void *data)
goto error;
}
if (g_isi_client_send(nd->client, req, sizeof(req), NETWORK_TIMEOUT,
reg_status_resp_cb, cbd, NULL) != NULL)
if (g_isi_client_send(nd->client, req, sizeof(req),
reg_status_resp_cb, cbd, NULL))
return;
error:
@ -368,8 +368,8 @@ static void isi_registration_status(struct ofono_netreg *netreg,
if (nd == NULL || cbd == NULL)
goto error;
if (g_isi_client_send(nd->client, rat, sizeof(rat), NETWORK_TIMEOUT,
rat_resp_cb, cbd, NULL) != NULL)
if (g_isi_client_send(nd->client, rat, sizeof(rat),
rat_resp_cb, cbd, NULL))
return;
error:
@ -449,8 +449,8 @@ static void isi_current_operator(struct ofono_netreg *netreg,
if (cbd == NULL || nd == NULL)
goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_TIMEOUT,
name_get_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(nd->client, msg, sizeof(msg),
name_get_resp_cb, cbd, g_free))
return;
error:
@ -552,9 +552,9 @@ static void isi_list_operators(struct ofono_netreg *netreg,
if (cbd == NULL || nd == NULL)
goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg),
if (g_isi_client_send_with_timeout(nd->client, msg, sizeof(msg),
NETWORK_SCAN_TIMEOUT, available_resp_cb, cbd,
g_free) != NULL)
g_free))
return;
error:
@ -599,9 +599,9 @@ static void isi_register_auto(struct ofono_netreg *netreg,
if (nd == NULL || cbd == NULL)
goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg),
NETWORK_SET_TIMEOUT, set_auto_resp_cb, cbd,
g_free) != NULL)
if (g_isi_client_send_with_timeout(nd->client, msg, sizeof(msg),
NETWORK_SET_TIMEOUT,
set_auto_resp_cb, cbd, g_free))
return;
error:
@ -653,8 +653,9 @@ static void isi_register_manual(struct ofono_netreg *netreg,
if (cbd == NULL || nd == NULL)
goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_SET_TIMEOUT,
set_manual_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send_with_timeout(nd->client, msg, sizeof(msg),
NETWORK_SET_TIMEOUT,
set_manual_resp_cb, cbd, g_free))
return;
error:
@ -783,8 +784,8 @@ static void isi_strength(struct ofono_netreg *netreg,
if (nd == NULL || cbd == NULL)
goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_TIMEOUT,
rssi_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(nd->client, msg, sizeof(msg),
rssi_resp_cb, cbd, g_free))
return;
error:

View File

@ -222,8 +222,7 @@ static void read_next_entry(GIsiClient *client, uint16_t location,
if (cbd == NULL)
goto error;
if (g_isi_client_send(client, msg, sizeof(msg), SIM_TIMEOUT,
notify, cbd, NULL) != NULL)
if (g_isi_client_send(client, msg, sizeof(msg), notify, cbd, NULL))
return;
error:
@ -278,12 +277,12 @@ static void isi_export_entries(struct ofono_phonebook *pb, const char *storage,
0, SIM_PB_EMAIL,
0, 0 /* filler */
};
size_t len = sizeof(msg);
if (cbd == NULL || pbd == NULL || strcmp(storage, "SM") != 0)
goto error;
if (g_isi_client_send(pbd->client, msg, sizeof(msg), SIM_TIMEOUT,
read_resp_cb, cbd, NULL) != NULL)
if (g_isi_client_send(pbd->client, msg, len, read_resp_cb, cbd, NULL))
return;
error:

View File

@ -150,7 +150,7 @@ static void isi_query_rat_mode(struct ofono_radio_settings *rs,
if (cbd == NULL || rd == NULL)
goto error;
if (g_isi_client_send(rd->gss_client, msg, sizeof(msg), GSS_TIMEOUT,
if (g_isi_client_send(rd->gss_client, msg, sizeof(msg),
rat_mode_read_resp_cb, cbd, NULL))
return;
@ -210,7 +210,7 @@ static void isi_set_rat_mode(struct ofono_radio_settings *rs,
if (isi_mode == -1)
goto error;
if (g_isi_client_send(rd->gss_client, msg, sizeof(msg), GSS_TIMEOUT,
if (g_isi_client_send(rd->gss_client, msg, sizeof(msg),
mode_write_resp_cb, cbd, NULL))
return;

View File

@ -194,11 +194,8 @@ static gboolean isi_read_spn(struct ofono_sim *sim, struct isi_cb_data *cbd)
if (sd == NULL)
return FALSE;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SIM_TIMEOUT,
spn_resp_cb, cbd, g_free) == NULL)
return FALSE;
return TRUE;
return g_isi_client_send(sd->client, msg, sizeof(msg),
spn_resp_cb, cbd, g_free);
}
static void read_iccid_resp_cb(const GIsiMessage *msg, void *data)
@ -233,11 +230,8 @@ static gboolean isi_read_iccid(struct ofono_sim *sim, struct isi_cb_data *cbd)
if (sd == NULL)
return FALSE;
if (g_isi_client_send(sd->client, req, sizeof(req), SIM_TIMEOUT,
read_iccid_resp_cb, cbd, g_free) == NULL)
return FALSE;
return TRUE;
return g_isi_client_send(sd->client, req, sizeof(req),
read_iccid_resp_cb, cbd, g_free);
}
static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
@ -245,6 +239,7 @@ static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
ofono_sim_read_cb_t cb, void *data)
{
struct isi_cb_data *cbd;
gboolean done;
cbd = isi_cb_data_new(sim, cb, data);
if (cbd == NULL)
@ -252,16 +247,20 @@ static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
switch (fileid) {
case SIM_EFSPN_FILEID:
if (isi_read_spn(sim, cbd))
return;
done = isi_read_spn(sim, cbd);
break;
case SIM_EF_ICCID_FILEID:
done = isi_read_iccid(sim, cbd);
break;
if (isi_read_iccid(sim, cbd))
return;
default:
done = FALSE;
}
if (done)
return;
DBG("Fileid %04X not implemented", fileid);
error:
@ -358,12 +357,12 @@ static void isi_read_imsi(struct ofono_sim *sim,
SIM_IMSI_REQ_READ_IMSI,
READ_IMSI
};
size_t len = sizeof(msg);
if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SIM_TIMEOUT,
imsi_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(sd->client, msg, len, imsi_resp_cb, cbd, g_free))
return;
error:
@ -401,12 +400,12 @@ static void isi_read_hplmn(struct ofono_sim *sim)
SIM_NETWORK_INFO_REQ,
READ_HPLMN, 0
};
size_t len = sizeof(req);
if (sd == NULL)
return;
g_isi_client_send(sd->client, req, sizeof(req), SIM_TIMEOUT,
read_hplmn_resp_cb, sim, NULL);
g_isi_client_send(sd->client, req, len, read_hplmn_resp_cb, sim, NULL);
}
static void sim_ind_cb(const GIsiMessage *msg, void *data)

View File

@ -251,8 +251,8 @@ static void isi_sca_query(struct ofono_sms *sms,
if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_client_send(sd->sim, msg, sizeof(msg), SIM_TIMEOUT,
sca_query_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(sd->sim, msg, sizeof(msg),
sca_query_resp_cb, cbd, g_free))
return;
error:
@ -302,8 +302,7 @@ static void isi_sca_set(struct ofono_sms *sms,
bcd[0] = 1 + (strlen(sca->number) + 1) / 2;
bcd[1] = sca->type & 0xFF;
if (g_isi_client_vsend(sd->sim, iov, 2, SIM_TIMEOUT, sca_set_resp_cb,
cbd, g_free) != NULL)
if (g_isi_client_vsend(sd->sim, iov, 2, sca_set_resp_cb, cbd, g_free))
return;
error:
@ -405,8 +404,9 @@ static void isi_submit(struct ofono_sms *sms, unsigned char *pdu,
* Modem seems to time out SMS_MESSAGE_SEND_REQ in 5 seconds.
* Wait normal timeout plus the modem timeout.
*/
if (g_isi_client_vsend(sd->client, iov, 4, SMS_TIMEOUT + 5,
submit_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_vsend_with_timeout(sd->client, iov, 4,
SMS_TIMEOUT + 5,
submit_resp_cb, cbd, g_free))
return;
error:
@ -483,9 +483,9 @@ static gboolean send_deliver_report(GIsiClient *client, gboolean success)
0, 0, 0, /* Filler */
0, /* Sub blocks */
};
size_t len = sizeof(msg);
return g_isi_client_send(client, msg, sizeof(msg), SMS_TIMEOUT,
report_resp_cb, NULL, NULL) != NULL;
return g_isi_client_send(client, msg, len, report_resp_cb, NULL, NULL);
}
static gboolean parse_sms_address(GIsiSubBlockIter *iter, struct sms_addr *add)
@ -627,6 +627,7 @@ static void sim_reachable_cb(const GIsiMessage *msg, void *data)
0x00, 0x00, 0x00, /* Filler */
0x00 /* Sub-sub-block count */
};
size_t len = sizeof(req);
if (g_isi_msg_error(msg) < 0) {
DBG("unable to find SIM resource");
@ -636,8 +637,7 @@ static void sim_reachable_cb(const GIsiMessage *msg, void *data)
g_isi_client_ind_subscribe(sd->client, SMS_MESSAGE_SEND_STATUS_IND,
send_status_ind_cb, sms);
g_isi_client_send(sd->client, msg, sizeof(msg), SMS_TIMEOUT,
routing_resp_cb, sms, NULL);
g_isi_client_send(sd->client, req, len, routing_resp_cb, sms, NULL);
}
static void sms_reachable_cb(const GIsiMessage *msg, void *data)
@ -675,6 +675,9 @@ static int isi_sms_probe(struct ofono_sms *sms, unsigned int vendor,
if (sd->sim == NULL)
goto nomem;
g_isi_client_set_timeout(sd->client, SMS_TIMEOUT);
g_isi_client_set_timeout(sd->sim, SIM_TIMEOUT);
ofono_sms_set_data(sms, sd);
g_isi_client_verify(sd->client, sms_reachable_cb, sms, NULL);
@ -712,8 +715,7 @@ static void isi_sms_remove(struct ofono_sms *sms)
* Send a promiscuous routing release, so as not to
* hog resources unnecessarily after being removed
*/
g_isi_client_send(sd->client, msg, sizeof(msg), SMS_TIMEOUT,
NULL, NULL, NULL);
g_isi_client_send(sd->client, msg, sizeof(msg), NULL, NULL, NULL);
g_isi_client_destroy(sd->client);
g_isi_client_destroy(sd->sim);
g_free(sd);

View File

@ -81,8 +81,7 @@ static void ussd_notify_ack(struct ussd_data *ud)
0, /* subblock count */
};
g_isi_client_send(ud->client, msg, sizeof(msg), SS_TIMEOUT, NULL, NULL,
NULL);
g_isi_client_send(ud->client, msg, sizeof(msg), NULL, NULL, NULL);
}
static void ussd_ind_cb(const GIsiMessage *msg, void *data)
@ -187,8 +186,8 @@ static void isi_request(struct ofono_ussd *ussd, int dcs,
if (cbd == NULL || ud == NULL)
goto error;
if (g_isi_client_vsend(ud->client, iov, 2, SS_TIMEOUT,
ussd_send_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_vsend(ud->client, iov, 2,
ussd_send_resp_cb, cbd, g_free))
return;
error:
@ -210,8 +209,8 @@ static void isi_cancel(struct ofono_ussd *ussd,
if (cbd == NULL || ud == NULL)
goto error;
if (g_isi_client_send(ud->client, msg, sizeof(msg), SS_TIMEOUT,
ussd_send_resp_cb, cbd, g_free) != NULL)
if (g_isi_client_send(ud->client, msg, sizeof(msg),
ussd_send_resp_cb, cbd, g_free))
return;
error:

View File

@ -119,13 +119,11 @@ static struct isi_call_req_ctx *isi_call_req(struct ofono_voicecall *ovc,
irc->cb = cb;
irc->data = data;
if (g_isi_client_send(ivc->client, req, len, ISI_CALL_TIMEOUT,
handler, irc, NULL) == NULL) {
g_free(irc);
return NULL;
}
if (g_isi_client_send(ivc->client, req, len, handler, irc, NULL))
return irc;
return irc;
g_free(irc);
return NULL;
}
static void isi_ctx_queue(struct isi_call_req_ctx *irc, isi_call_req_step *next)