![]() |
SMS DBUS sending Fail
Dear All,
I am trying send SMS using Dbus using C i studied paython vert SMS http://gitorious.org/vertsms/vertsms...vertsms/sms.py i tested this code: (i set the pdu fixed array to make it easier i compared pdu array to vertsms pdustring and they are the same but dbus_g_proxy_call always return false need help urgent #define MYTYPE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_UCHAR_ARRAY)) static void sendsms(SMS* sm) { DBusGConnection* dbus_conn; DBusGProxy* dbus_proxy; dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL); dbus_proxy = dbus_g_proxy_new_for_name(dbus_conn, "com.nokia.phone.SMS", "/com/nokia/phone/SMS/ba212ae1","com.nokia.csd.SMS.Outgoing"); createsmspdu(sm); GPtrArray* ptrarray; GArray* array; guchar values[] = {33, 10, 12, 129, 2, 1, 145, 18, 85, 21, 0, 0, 10, 232, 50, 155, 253, 70, 151, 217, 236, 183}; ptrarray = g_ptr_array_new(); array = g_array_new(FALSE, FALSE, sizeof(guchar)); g_array_append_vals(array, values, sizeof(values)/sizeof(guchar)); g_ptr_array_add(ptrarray, (gpointer)array); gboolean b = dbus_g_proxy_call(dbus_proxy,"Send",NULL,MYTYPE,pt rarray, G_TYPE_STRING,"",G_TYPE_INVALID); if(!b) { logv( "Error sending"); } else logv( "Success sending"); g_ptr_array_free(ptrarray,TRUE); g_object_unref(dbus_proxy); dbus_g_connection_unref(dbus_conn); } thank you for taking time read this |
Re: SMS DBUS sending Fail
Looking at the original it's ripped from (http://talk.maemo.org/showpost.php?p...7&postcount=14), it's using dbus_g_proxy_call_no_reply, whilst you're using dbus_g_proxy_call. Because the latter also allows you to specify pointers for storing the values returned by the call, you must add another G_TYPE_INVALID (like when you're finished speciying the "in" arguments) to specify when you're done.
P.S. dbus_g_proxy_call supports GError. Use it ;) |
Re: SMS DBUS sending Fail
Quote:
GError* error = NULL; dbus_g_proxy_call(dbus_proxy,"Send",&error,MYTYPE, pt rarray, G_TYPE_STRING,"",G_TYPE_INVALID); thank you for fast reply |
Re: SMS DBUS sending Fail
i added G_TYPE_INVALID no luck also fail
i also used original no luck |
Re: SMS DBUS sending Fail
Quote:
I tried this and i got this error from log on device too many arguments in reply; expected 0 , got 2 what type of paramters i should specify gboolean b = dbus_g_proxy_call(dbus_proxy,"Send",&error,myt,ptr array, G_TYPE_STRING,"",G_TYPE_INVALID,G_TYPE_INVALID); if(!b) { logv( "Error sending:"); logv( error->message); } else logv( "Success sending"); |
Re: SMS DBUS sending Fail
Quote:
|
Re: SMS DBUS sending Fail
Quote:
|
Re: SMS DBUS sending Fail
Quote:
Where can i find D-BUs interface XML defination? Regards Wael |
Re: SMS DBUS sending Fail
hello,
any suggestions? |
Re: SMS DBUS sending Fail
Dear All,
Fixed and Works now, problem was in Mobile number encoding fixed dear qwerty12 thanks i will post working functions to commuinty so everyone can use, i have a question what if i want send unicode message how can i set Data Coding Schema Thanks Wael |
All times are GMT. The time now is 22:38. |
vBulletin® Version 3.8.8