Example #1
0
int ipc_sms_incoming_msg_register(char *pdu, int length, unsigned char type, unsigned char tpid)
{
	struct ipc_sms_incoming_msg_info *incoming_msg;
	struct list_head *list_end;
	struct list_head *list;

	incoming_msg = calloc(1, sizeof(struct ipc_sms_incoming_msg_info));
	if (incoming_msg == NULL)
		return -1;

	incoming_msg->pdu = pdu;
	incoming_msg->length = length;
	incoming_msg->type = type;
	incoming_msg->tpid = tpid;

	list_end = ril_data.incoming_sms;
	while (list_end != NULL && list_end->next != NULL)
		list_end = list_end->next;

	list = list_head_alloc((void *) incoming_msg, list_end, NULL);

	if (ril_data.incoming_sms == NULL)
		ril_data.incoming_sms = list;

	return 0;
}
Example #2
0
int ril_request_send_sms_register(char *pdu, int pdu_length, unsigned char *smsc, int smsc_length, RIL_Token t)
{
	struct ril_request_send_sms_info *send_sms;
	struct list_head *list_end;
	struct list_head *list;

	send_sms = calloc(1, sizeof(struct ril_request_send_sms_info));
	if (send_sms == NULL)
		return -1;

	send_sms->pdu = pdu;
	send_sms->pdu_length = pdu_length;
	send_sms->smsc = smsc;
	send_sms->smsc_length = smsc_length;
	send_sms->token = t;

	list_end = ril_data.outgoing_sms;
	while (list_end != NULL && list_end->next != NULL)
		list_end = list_end->next;

	list = list_head_alloc((void *) send_sms, list_end, NULL);

	if (ril_data.outgoing_sms == NULL)
		ril_data.outgoing_sms = list;

	return 0;
}
Example #3
0
int ril_request_register(RIL_Token t, int id)
{
	struct ril_request_info *request;
	struct list_head *list_end;
	struct list_head *list;

	request = calloc(1, sizeof(struct ril_request_info));
	if(request == NULL)
		return -1;

	request->token = t;
	request->id = id;
	request->canceled = 0;

	list_end = ril_data.requests;
	while(list_end != NULL && list_end->next != NULL)
		list_end = list_end->next;

	list = list_head_alloc((void *) request, list_end, NULL);

	if(ril_data.requests == NULL)
		ril_data.requests = list;

	return 0;
}
int ipc_gen_phone_res_expect_register(struct ril_client *client,
	unsigned char aseq, unsigned short command,
	int (*callback)(struct ipc_message *message),
	int complete, int abort)
{
	struct ipc_gen_phone_res_expect *expect;
	struct ipc_fmt_data *data;
	struct list_head *list_end;
	struct list_head *list;

	if (client == NULL || client->data == NULL)
		return -1;

	data = (struct ipc_fmt_data *) client->data;

	RIL_CLIENT_LOCK(client);

	expect = calloc(1, sizeof(struct ipc_gen_phone_res_expect));
	expect->aseq = aseq;
	expect->command = command;
	expect->callback = callback;
	expect->complete = complete;
	expect->abort = abort;

	list_end = data->gen_phone_res_expect;
	while (list_end != NULL && list_end->next != NULL)
		list_end = list_end->next;

	list = list_head_alloc(list_end, NULL, (void *) expect);

	if (data->gen_phone_res_expect == NULL)
		data->gen_phone_res_expect = list;

	RIL_CLIENT_UNLOCK(client);

	return 0;
}