本文整理汇总了C++中parcel_w_string函数的典型用法代码示例。如果您正苦于以下问题:C++ parcel_w_string函数的具体用法?C++ parcel_w_string怎么用?C++ parcel_w_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parcel_w_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: g_ril_request_sim_read_record
gboolean g_ril_request_sim_read_record(GRil *gril,
const struct req_sim_read_record *req,
struct parcel *rilp)
{
parcel_init(rilp);
parcel_w_int32(rilp, CMD_READ_RECORD);
parcel_w_int32(rilp, req->fileid);
g_ril_append_print_buf(gril,
"(cmd=0x%.2X,efid=0x%.4X,",
CMD_READ_RECORD,
req->fileid);
if (set_path(gril, req->app_type, rilp, req->fileid,
req->path, req->path_len) == FALSE)
goto error;
parcel_w_int32(rilp, req->record); /* P1 */
parcel_w_int32(rilp, 4); /* P2 */
parcel_w_int32(rilp, req->length); /* P3 */
parcel_w_string(rilp, NULL); /* data; only req'd for writes */
parcel_w_string(rilp, NULL); /* pin2; only req'd for writes */
parcel_w_string(rilp, req->aid_str); /* AID (Application ID) */
return TRUE;
error:
return FALSE;
}
开发者ID:jpakkane,项目名称:ofono,代码行数:29,代码来源:grilrequest.c
示例2: ril_call_barring_set
static void ril_call_barring_set(struct ofono_call_barring *cb,
const char *lock, int enable,
const char *passwd, int cls,
ofono_call_barring_set_cb_t callback,
void *data)
{
struct barring_data *bd = ofono_call_barring_get_data(cb);
struct cb_data *cbd = cb_data_new(callback, data, bd);
struct parcel rilp;
char svcs_str[4];
DBG("lock: %s, enable: %d, bearer class: %d", lock, enable, cls);
FIXUP_CLS();
parcel_init(&rilp);
parcel_w_int32(&rilp, 5); /* # of strings */
parcel_w_string(&rilp, lock);
parcel_w_string(&rilp, enable ? "1" : "0");
parcel_w_string(&rilp, passwd);
snprintf(svcs_str, sizeof(svcs_str), "%d", cls);
parcel_w_string(&rilp, svcs_str);
parcel_w_string(&rilp, NULL); /* AID (for FDN, not yet supported) */
g_ril_append_print_buf(bd->ril, "(%s,%s,%s,%s,(null))",
lock, enable ? "1" : "0", passwd, svcs_str);
if (g_ril_send(bd->ril, RIL_REQUEST_SET_FACILITY_LOCK, &rilp,
ril_call_barring_set_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(callback, data);
}
开发者ID:dzemskov,项目名称:ofono,代码行数:34,代码来源:call-barring.c
示例3: ril_call_barring_set_passwd
static void ril_call_barring_set_passwd(struct ofono_call_barring *barr,
const char *lock,
const char *old_passwd,
const char *new_passwd,
ofono_call_barring_set_cb_t cb,
void *data)
{
struct barring_data *bd = ofono_call_barring_get_data(barr);
struct cb_data *cbd = cb_data_new(cb, data);
struct parcel rilp;
int ret = 0;
DBG("");
parcel_init(&rilp);
parcel_w_int32(&rilp, RIL_SET_PW_STRING_COUNT); /* Nbr of strings */
parcel_w_string(&rilp, (char *) lock); /* Facility code */
parcel_w_string(&rilp, (char *) old_passwd);
parcel_w_string(&rilp, (char *) new_passwd);
ret = g_ril_send(bd->ril, RIL_REQUEST_CHANGE_BARRING_PASSWORD,
rilp.data, rilp.size, ril_call_barring_set_passwd_cb,
cbd, g_free);
parcel_free(&rilp);
if (ret <= 0) {
ofono_error("Sending Call Barring Set PW req failed, err: %i",
ret);
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
}
开发者ID:CODeRUS,项目名称:ofono,代码行数:33,代码来源:call-barring.c
示例4: g_ril_request_set_initial_attach_apn
void g_ril_request_set_initial_attach_apn(GRil *gril, const char *apn,
int proto,
const char *user,
const char *passwd,
const char *mccmnc,
struct parcel *rilp)
{
const char *proto_str;
const int auth_type = RIL_AUTH_ANY;
parcel_init(rilp);
parcel_w_string(rilp, apn);
proto_str = ril_ofono_protocol_to_ril_string(proto);
parcel_w_string(rilp, proto_str);
parcel_w_int32(rilp, auth_type);
parcel_w_string(rilp, user);
parcel_w_string(rilp, passwd);
g_ril_append_print_buf(gril, "(%s,%s,%s,%s,%s", apn, proto_str,
ril_authtype_to_string(auth_type),
user, passwd);
if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK) {
parcel_w_string(rilp, mccmnc);
g_ril_append_print_buf(gril, "%s,%s)", print_buf, mccmnc);
} else {
g_ril_append_print_buf(gril, "%s)", print_buf);
}
}
开发者ID:morphis,项目名称:ofono,代码行数:32,代码来源:grilrequest.c
示例5: g_ril_request_sim_read_record
gboolean g_ril_request_sim_read_record(GRil *gril,
const struct req_sim_read_record *req,
struct parcel *rilp)
{
parcel_init(rilp);
parcel_w_int32(rilp, CMD_READ_RECORD);
parcel_w_int32(rilp, req->fileid);
g_ril_append_print_buf(gril,
"(cmd=0x%.2X,efid=0x%.4X,",
CMD_READ_RECORD,
req->fileid);
if (set_path(gril, req->app_type, rilp, req->fileid,
req->path, req->path_len) == FALSE)
goto error;
parcel_w_int32(rilp, req->record); /* P1 */
parcel_w_int32(rilp, 4); /* P2 */
parcel_w_int32(rilp, req->length); /* P3 */
parcel_w_string(rilp, NULL); /* data; only req'd for writes */
parcel_w_string(rilp, NULL); /* pin2; only req'd for writes */
parcel_w_string(rilp, req->aid_str); /* AID (Application ID) */
/* sessionId, specific to latest MTK modems (harmless for older ones) */
if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK)
parcel_w_int32(rilp, 0);
return TRUE;
error:
return FALSE;
}
开发者ID:morphis,项目名称:ofono,代码行数:33,代码来源:grilrequest.c
示例6: ril_pin_send
static void ril_pin_send(struct ofono_sim *sim, const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data)
{
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data);
struct parcel rilp;
int request = RIL_REQUEST_ENTER_SIM_PIN;
int ret;
sd->passwd_type = OFONO_SIM_PASSWORD_SIM_PIN;
cbd->user = sd;
if (current_passwd)
g_stpcpy(current_passwd, passwd);
parcel_init(&rilp);
parcel_w_int32(&rilp, ENTER_SIM_PIN_PARAMS);
parcel_w_string(&rilp, (char *) passwd);
parcel_w_string(&rilp, sd->aid_str);
ret = g_ril_send(sd->ril, request,
rilp.data, rilp.size, ril_pin_change_state_cb,
cbd, g_free);
g_ril_append_print_buf(sd->ril, "(%s,aid=%s)", passwd, sd->aid_str);
g_ril_print_request(sd->ril, ret, request);
parcel_free(&rilp);
if (ret <= 0) {
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
}
开发者ID:impegoraro,项目名称:ofono,代码行数:35,代码来源:sim.c
示例7: ril_call_barring_set_passwd
static void ril_call_barring_set_passwd(struct ofono_call_barring *barr,
const char *lock,
const char *old_passwd,
const char *new_passwd,
ofono_call_barring_set_cb_t cb,
void *data)
{
struct barring_data *bd = ofono_call_barring_get_data(barr);
struct cb_data *cbd = cb_data_new(cb, data, bd);
struct parcel rilp;
DBG("lock %s old %s new %s", lock, old_passwd, new_passwd);
parcel_init(&rilp);
parcel_w_int32(&rilp, 3); /* # of strings */
parcel_w_string(&rilp, lock);
parcel_w_string(&rilp, old_passwd);
parcel_w_string(&rilp, new_passwd);
g_ril_append_print_buf(bd->ril, "(%s,%s,%s)",
lock, old_passwd, new_passwd);
if (g_ril_send(bd->ril, RIL_REQUEST_CHANGE_BARRING_PASSWORD, &rilp,
ril_call_barring_set_passwd_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
开发者ID:dzemskov,项目名称:ofono,代码行数:30,代码来源:call-barring.c
示例8: ril_call_barring_query
static void ril_call_barring_query(struct ofono_call_barring *cb,
const char *lock, int cls,
ofono_call_barring_query_cb_t callback,
void *data)
{
struct barring_data *bd = ofono_call_barring_get_data(cb);
struct cb_data *cbd = cb_data_new(callback, data, bd);
struct parcel rilp;
char svcs_str[4];
DBG("lock: %s, services to query: %d", lock, cls);
FIXUP_CLS();
parcel_init(&rilp);
parcel_w_int32(&rilp, 4); /* # of strings */
parcel_w_string(&rilp, lock);
parcel_w_string(&rilp, ""); /* Password is empty when not needed */
snprintf(svcs_str, sizeof(svcs_str), "%d", cls);
parcel_w_string(&rilp, svcs_str);
parcel_w_string(&rilp, NULL); /* AID (for FDN, not yet supported) */
g_ril_append_print_buf(bd->ril, "(%s,\"\",%s,(null))",
lock, svcs_str);
if (g_ril_send(bd->ril, RIL_REQUEST_QUERY_FACILITY_LOCK, &rilp,
ril_call_barring_query_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(callback, -1, data);
}
开发者ID:dzemskov,项目名称:ofono,代码行数:32,代码来源:call-barring.c
示例9: ril_pin_send
static void ril_pin_send(struct ofono_sim *sim, const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data)
{
/*
* TODO: This function is supposed to enter the pending password, which
* might be also PIN2. So we must check the pending PIN in the future.
*/
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data, sim);
struct parcel rilp;
sd->passwd_type = OFONO_SIM_PASSWORD_SIM_PIN;
parcel_init(&rilp);
parcel_w_int32(&rilp, 2);
parcel_w_string(&rilp, passwd);
parcel_w_string(&rilp, sd->aid_str);
g_ril_append_print_buf(sd->ril, "(%s,aid=%s)", passwd, sd->aid_str);
if (g_ril_send(sd->ril, RIL_REQUEST_ENTER_SIM_PIN, &rilp,
ril_enter_sim_pin_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
开发者ID:endocode,项目名称:ofono,代码行数:29,代码来源:sim.c
示例10: ril_pin_send_puk
static void ril_pin_send_puk(struct ofono_sim *sim,
const char *puk, const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data)
{
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data, sim);
struct parcel rilp;
sd->passwd_type = OFONO_SIM_PASSWORD_SIM_PUK;
parcel_init(&rilp);
parcel_w_int32(&rilp, 3);
parcel_w_string(&rilp, puk);
parcel_w_string(&rilp, passwd);
parcel_w_string(&rilp, sd->aid_str);
g_ril_append_print_buf(sd->ril, "(puk=%s,pin=%s,aid=%s)",
puk, passwd, sd->aid_str);
if (g_ril_send(sd->ril, RIL_REQUEST_ENTER_SIM_PUK, &rilp,
ril_enter_sim_puk_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
开发者ID:endocode,项目名称:ofono,代码行数:27,代码来源:sim.c
示例11: g_ril_request_sim_read_binary
gboolean g_ril_request_sim_read_binary(GRil *gril,
const struct req_sim_read_binary *req,
struct parcel *rilp)
{
g_ril_append_print_buf(gril,
"(cmd=0x%.2X,efid=0x%.4X,",
CMD_READ_BINARY,
req->fileid);
parcel_init(rilp);
parcel_w_int32(rilp, CMD_READ_BINARY);
parcel_w_int32(rilp, req->fileid);
if (set_path(gril, req->app_type, rilp, req->fileid,
req->path, req->path_len) == FALSE)
goto error;
parcel_w_int32(rilp, (req->start >> 8)); /* P1 */
parcel_w_int32(rilp, (req->start & 0xff)); /* P2 */
parcel_w_int32(rilp, req->length); /* P3 */
parcel_w_string(rilp, NULL); /* data; only req'd for writes */
parcel_w_string(rilp, NULL); /* pin2; only req'd for writes */
parcel_w_string(rilp, req->aid_str);
return TRUE;
error:
return FALSE;
}
开发者ID:jpakkane,项目名称:ofono,代码行数:29,代码来源:grilrequest.c
示例12: ril_cmgs
static void ril_cmgs(struct ofono_sms *sms, const unsigned char *pdu,
int pdu_len, int tpdu_len, int mms,
ofono_sms_submit_cb_t cb, void *user_data)
{
struct sms_data *sd = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(cb, user_data);
struct parcel rilp;
char *tpdu;
int request = RIL_REQUEST_SEND_SMS;
int ret, smsc_len;
cbd->user = sd;
DBG("pdu_len: %d, tpdu_len: %d mms: %d", pdu_len, tpdu_len, mms);
/* TODO: if (mms) { ... } */
parcel_init(&rilp);
parcel_w_int32(&rilp, 2); /* Number of strings */
/* SMSC address:
*
* smsc_len == 1, then zero-length SMSC was spec'd
* RILD expects a NULL string in this case instead
* of a zero-length string.
*/
smsc_len = pdu_len - tpdu_len;
if (smsc_len > 1) {
/* TODO: encode SMSC & write to parcel */
DBG("SMSC address specified (smsc_len %d); NOT-IMPLEMENTED", smsc_len);
}
parcel_w_string(&rilp, NULL); /* SMSC address; NULL == default */
/* TPDU:
*
* 'pdu' is a raw hexadecimal string
* encode_hex() turns it into an ASCII/hex UTF8 buffer
* parcel_w_string() encodes utf8 -> utf16
*/
tpdu = encode_hex(pdu + smsc_len, tpdu_len, 0);
parcel_w_string(&rilp, tpdu);
ret = g_ril_send(sd->ril,
request,
rilp.data,
rilp.size,
submit_sms_cb, cbd, g_free);
g_ril_append_print_buf(sd->ril, "(%s)", tpdu);
g_ril_print_request(sd->ril, ret, request);
parcel_free(&rilp);
if (ret <= 0) {
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, -1, user_data);
}
}
开发者ID:leinomii,项目名称:ofono,代码行数:59,代码来源:sms.c
示例13: ril_sim_update_binary
static void ril_sim_update_binary(struct ofono_sim *sim, int fileid,
int start, int length,
const unsigned char *value,
const unsigned char *path,
unsigned int path_len,
ofono_sim_write_cb_t cb, void *data)
{
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data, sd);
char *hex_path;
struct parcel rilp;
char *hex_data;
int p1, p2;
DBG("file 0x%04x", fileid);
hex_path = get_path(g_ril_vendor(sd->ril),
sd->app_type, fileid, path, path_len);
if (hex_path == NULL) {
ofono_error("Couldn't build SIM read info request - NULL path");
goto error;
}
p1 = start >> 8;
p2 = start & 0xff;
hex_data = encode_hex(value, length, 0);
parcel_init(&rilp);
parcel_w_int32(&rilp, CMD_UPDATE_BINARY);
parcel_w_int32(&rilp, fileid);
parcel_w_string(&rilp, hex_path);
parcel_w_int32(&rilp, p1); /* P1 */
parcel_w_int32(&rilp, p2); /* P2 */
parcel_w_int32(&rilp, length); /* P3 (Lc) */
parcel_w_string(&rilp, hex_data); /* data */
parcel_w_string(&rilp, NULL); /* pin2; only for FDN/BDN */
parcel_w_string(&rilp, sd->aid_str); /* AID (Application ID) */
/* sessionId, specific to latest MTK modems (harmless for older ones) */
if (g_ril_vendor(sd->ril) == OFONO_RIL_VENDOR_MTK)
parcel_w_int32(&rilp, 0);
g_ril_append_print_buf(sd->ril, "(cmd=0x%02X,efid=0x%04X,path=%s,"
"%d,%d,%d,%s,pin2=(null),aid=%s),",
CMD_UPDATE_BINARY, fileid, hex_path,
p1, p2, length, hex_data, sd->aid_str);
g_free(hex_path);
g_free(hex_data);
if (g_ril_send(sd->ril, RIL_REQUEST_SIM_IO, &rilp,
ril_file_write_cb, cbd, g_free) > 0)
return;
error:
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
开发者ID:endocode,项目名称:ofono,代码行数:57,代码来源:sim.c
示例14: set_path
static void set_path(struct sim_data *sd, struct parcel *rilp,
const int fileid, const guchar *path,
const guint path_len)
{
guchar db_path[6] = { 0x00 };
char *hex_path = NULL;
int len = 0;
DBG("");
if (path_len > 0 && path_len < 7) {
memcpy(db_path, path, path_len);
len = path_len;
} else if (sd->app_type == RIL_APPTYPE_USIM) {
len = sim_ef_db_get_path_3g(fileid, db_path);
} else if (sd->app_type == RIL_APPTYPE_SIM) {
len = sim_ef_db_get_path_2g(fileid, db_path);
} else {
ofono_error("Unsupported app_type: 0%x", sd->app_type);
}
if (len > 0) {
hex_path = encode_hex(db_path, len, 0);
parcel_w_string(rilp, (char *) hex_path);
g_ril_append_print_buf(sd->ril,
"%spath=%s,",
print_buf,
hex_path);
g_free(hex_path);
} else if (fileid == SIM_EF_ICCID_FILEID || fileid == SIM_EFPL_FILEID) {
/*
* Special catch-all for EF_ICCID (unique card ID)
* and EF_PL files which exist in the root directory.
* As the sim_info_cb function may not have yet
* recorded the app_type for the SIM, and the path
* for both files is the same for 2g|3g, just hard-code.
*
* See 'struct ef_db' in:
* ../../src/simutil.c for more details.
*/
parcel_w_string(rilp, (char *) ROOTMF);
} else {
/*
* The only known case of this is EFPHASE_FILED (0x6FAE).
* The ef_db table ( see /src/simutil.c ) entry for
* EFPHASE contains a value of 0x0000 for it's
* 'parent3g' member. This causes a NULL path to
* be returned.
*/
DBG("db_get_path*() returned empty path.");
parcel_w_string(rilp, NULL);
}
}
开发者ID:impegoraro,项目名称:ofono,代码行数:56,代码来源:sim.c
示例15: ril_sim_read_record
static void ril_sim_read_record(struct ofono_sim *sim, int fileid,
int record, int length,
const unsigned char *path,
unsigned int path_len,
ofono_sim_read_cb_t cb, void *data)
{
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data);
struct parcel rilp;
int request = RIL_REQUEST_SIM_IO;
guint ret;
cbd->user = sd;
parcel_init(&rilp);
parcel_w_int32(&rilp, CMD_READ_RECORD);
parcel_w_int32(&rilp, fileid);
g_ril_append_print_buf(sd->ril,
"(cmd=0x%.2X,efid=0x%.4X,",
CMD_GET_RESPONSE,
fileid);
set_path(sd, &rilp, fileid, path, path_len);
parcel_w_int32(&rilp, record); /* P1 */
parcel_w_int32(&rilp, 4); /* P2 */
parcel_w_int32(&rilp, length); /* P3 */
parcel_w_string(&rilp, NULL); /* data; only req'd for writes */
parcel_w_string(&rilp, NULL); /* pin2; only req'd for writes */
parcel_w_string(&rilp, sd->aid_str); /* AID (Application ID) */
ret = g_ril_send(sd->ril,
request,
rilp.data,
rilp.size,
ril_file_io_cb, cbd, g_free);
g_ril_append_print_buf(sd->ril,
"%s%d,%d,%d,(null),pin2=(null),aid=%s)",
print_buf,
record,
4,
length,
sd->aid_str);
g_ril_print_request(sd->ril, ret, request);
parcel_free(&rilp);
if (ret <= 0) {
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
}
}
开发者ID:impegoraro,项目名称:ofono,代码行数:53,代码来源:sim.c
示例16: g_ril_request_pin_send
void g_ril_request_pin_send(GRil *gril,
const char *passwd,
const gchar *aid_str,
struct parcel *rilp)
{
parcel_init(rilp);
parcel_w_int32(rilp, ENTER_SIM_PIN_PARAMS);
parcel_w_string(rilp, passwd);
parcel_w_string(rilp, aid_str);
g_ril_append_print_buf(gril, "(%s,aid=%s)", passwd, aid_str);
}
开发者ID:morphis,项目名称:ofono,代码行数:13,代码来源:grilrequest.c
示例17: ril_sim_read_binary
static void ril_sim_read_binary(struct ofono_sim *sim, int fileid,
int start, int length,
const unsigned char *path,
unsigned int path_len,
ofono_sim_read_cb_t cb, void *data)
{
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data, sd);
char *hex_path;
struct parcel rilp;
DBG("file %04x", fileid);
hex_path = get_path(g_ril_vendor(sd->ril),
sd->app_type, fileid, path, path_len);
if (hex_path == NULL) {
ofono_error("Couldn't build SIM read info request - NULL path");
goto error;
}
parcel_init(&rilp);
parcel_w_int32(&rilp, CMD_READ_BINARY);
parcel_w_int32(&rilp, fileid);
parcel_w_string(&rilp, hex_path);
parcel_w_int32(&rilp, start >> 8); /* P1 */
parcel_w_int32(&rilp, start & 0xff); /* P2 */
parcel_w_int32(&rilp, length); /* P3 */
parcel_w_string(&rilp, NULL); /* data; only req'd for writes */
parcel_w_string(&rilp, NULL); /* pin2; only req'd for writes */
parcel_w_string(&rilp, sd->aid_str);
/* sessionId, specific to latest MTK modems (harmless for older ones) */
if (g_ril_vendor(sd->ril) == OFONO_RIL_VENDOR_MTK)
parcel_w_int32(&rilp, 0);
g_ril_append_print_buf(sd->ril, "(cmd=0x%.2X,efid=0x%.4X,path=%s,"
"%d,%d,%d,(null),pin2=(null),aid=%s)",
CMD_READ_BINARY, fileid, hex_path,
start >> 8, start & 0xff,
length, sd->aid_str);
g_free(hex_path);
if (g_ril_send(sd->ril, RIL_REQUEST_SIM_IO, &rilp,
ril_file_io_cb, cbd, g_free) > 0)
return;
error:
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
}
开发者ID:endocode,项目名称:ofono,代码行数:50,代码来源:sim.c
示例18: g_ril_request_sim_write_binary
gboolean g_ril_request_sim_write_binary(GRil *gril,
const struct req_sim_write_binary *req,
struct parcel *rilp)
{
char *hex_data;
int p1, p2;
parcel_init(rilp);
parcel_w_int32(rilp, CMD_UPDATE_BINARY);
parcel_w_int32(rilp, req->fileid);
g_ril_append_print_buf(gril, "(cmd=0x%02X,efid=0x%04X,",
CMD_UPDATE_BINARY, req->fileid);
if (set_path(gril, req->app_type, rilp, req->fileid,
req->path, req->path_len) == FALSE)
goto error;
p1 = req->start >> 8;
p2 = req->start & 0xff;
hex_data = encode_hex(req->data, req->length, 0);
parcel_w_int32(rilp, p1); /* P1 */
parcel_w_int32(rilp, p2); /* P2 */
parcel_w_int32(rilp, req->length); /* P3 (Lc) */
parcel_w_string(rilp, hex_data); /* data */
parcel_w_string(rilp, NULL); /* pin2; only for FDN/BDN */
parcel_w_string(rilp, req->aid_str); /* AID (Application ID) */
/* sessionId, specific to latest MTK modems (harmless for older ones) */
if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK)
parcel_w_int32(rilp, 0);
g_ril_append_print_buf(gril,
"%s%d,%d,%d,%s,pin2=(null),aid=%s)",
print_buf,
p1,
p2,
req->length,
hex_data,
req->aid_str);
g_free(hex_data);
return TRUE;
error:
return FALSE;
}
开发者ID:morphis,项目名称:ofono,代码行数:49,代码来源:grilrequest.c
示例19: g_ril_request_change_barring_password
void g_ril_request_change_barring_password(GRil *gril, const char *facility,
const char *old_passwd,
const char *new_passwd,
struct parcel *rilp)
{
parcel_init(rilp);
parcel_w_int32(rilp, 3); /* # of strings */
parcel_w_string(rilp, facility);
parcel_w_string(rilp, old_passwd);
parcel_w_string(rilp, new_passwd);
g_ril_append_print_buf(gril, "(%s,%s,%s)",
facility, old_passwd, new_passwd);
}
开发者ID:morphis,项目名称:ofono,代码行数:15,代码来源:grilrequest.c
示例20: ril_thermal_management_enable
static int ril_thermal_management_enable(struct ofono_modem *modem)
{
struct ril_data *rd = ofono_modem_get_data(modem);
struct parcel rilp;
int cmd_id;
char buf[4];
DBG("");
parcel_init(&rilp);
parcel_w_int32(&rilp, 1);
/* RIL_OEM_HOOK_STRING_GET_RF_POWER_STATUS = 0x000000AB */
cmd_id = 0x000000AB;
sprintf(buf, "%d", cmd_id);
parcel_w_string(&rilp, buf);
g_ril_append_print_buf(rd->ril, "{cmd_id=0x%02X}", cmd_id);
if (g_ril_send(rd->ril, RIL_REQUEST_OEM_HOOK_STRINGS, &rilp,
get_rf_power_status_cb, modem, NULL) > 0)
return 0;
/* Error path */
return -EIO;
}
开发者ID:endocode,项目名称:ofono,代码行数:27,代码来源:ril_intel.c
注:本文中的parcel_w_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论