コード例 #1
0
ファイル: stk.c プロジェクト: yongsu/oFono
static gboolean handle_command_send_sms(const struct stk_command *cmd,
					struct stk_response *rsp,
					struct ofono_stk *stk)
{
	struct ofono_modem *modem = __ofono_atom_get_modem(stk->atom);
	struct ofono_atom *sms_atom;
	struct ofono_sms *sms;
	GSList msg_list;

	sms_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SMS);

	if (!sms_atom || !__ofono_atom_get_registered(sms_atom)) {
		rsp->result.type = STK_RESULT_TYPE_NOT_CAPABLE;
		return TRUE;
	}

	sms = __ofono_atom_get_data(sms_atom);

	stk->sms_submit_req = g_new0(struct sms_submit_req, 1);
	stk->sms_submit_req->stk = stk;

	msg_list.data = (void *) &cmd->send_sms.gsm_sms;
	msg_list.next = NULL;

	__ofono_sms_txq_submit(sms, &msg_list, 0, send_sms_submit_cb,
				stk->sms_submit_req, g_free);

	stk->cancel_cmd = send_sms_cancel;

	if (cmd->send_sms.alpha_id && cmd->send_sms.alpha_id[0])
		stk_alpha_id_set(stk, cmd->send_sms.alpha_id);

	return FALSE;
}
コード例 #2
0
ファイル: call-volume.c プロジェクト: Conjuror/ofono
void ofono_call_volume_set_muted(struct ofono_call_volume *cv, int muted)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(cv->atom);
	dbus_bool_t m;

	cv->muted = muted;

	if (__ofono_atom_get_registered(cv->atom) == FALSE)
		return;

	m = muted;
	ofono_dbus_signal_property_changed(conn, path,
						OFONO_CALL_VOLUME_INTERFACE,
						"Muted", DBUS_TYPE_BOOLEAN, &m);
}
コード例 #3
0
ファイル: call-volume.c プロジェクト: Conjuror/ofono
void ofono_call_volume_set_microphone_volume(struct ofono_call_volume *cv,
						unsigned char percent)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(cv->atom);

	cv->microphone_volume = percent;

	if (__ofono_atom_get_registered(cv->atom) == FALSE)
		return;

	ofono_dbus_signal_property_changed(conn, path,
						OFONO_CALL_VOLUME_INTERFACE,
						"MicrophoneVolume",
						DBUS_TYPE_BYTE, &percent);
}
コード例 #4
0
ファイル: handsfree.c プロジェクト: ClementFan/ofono
void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
						ofono_bool_t enabled)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(hf->atom);
	dbus_bool_t dbus_enabled = enabled;

	if (hf->inband_ringing == enabled)
		return;

	hf->inband_ringing = enabled;

	if (__ofono_atom_get_registered(hf->atom) == FALSE)
		return;

	ofono_dbus_signal_property_changed(conn, path,
					OFONO_HANDSFREE_INTERFACE,
					"InbandRinging", DBUS_TYPE_BOOLEAN,
					&dbus_enabled);
}
コード例 #5
0
ファイル: handsfree.c プロジェクト: ClementFan/ofono
void ofono_handsfree_battchg_notify(struct ofono_handsfree *hf,
					unsigned char level)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(hf->atom);

	if (hf == NULL)
		return;

	if (hf->battchg == level)
		return;

	hf->battchg = level;

	if (__ofono_atom_get_registered(hf->atom) == FALSE)
		return;

	ofono_dbus_signal_property_changed(conn, path,
					OFONO_HANDSFREE_INTERFACE,
					"BatteryChargeLevel", DBUS_TYPE_BYTE,
					&level);
}