Re: [RERESEND] [PATCH 2/2] Update the network documentation
On Tuesday 23 November 2010 23:45:07 ext Denis Kenzior, you wrote: > On 11/23/2010 01:20 PM, Aki Niemi wrote: > > Hi, > > > > 2010/11/23 Denis Kenzior : > >> In fact we were planning to report the current bearer on the > >> ConnectionManager interface once we figured out the vendor commands that > >> can actually report this information. > > > > Do you mean HSDPA/HSUPA channel allocations, or the tech reported by > > CGREG? Because these can differ. For example, a Finnish operator's > > cells will not indicate HS*PA support, but HSDPA channel will > > nevertheless get allocated when data is moving. This is why for > > instance the N900 will show a 3G icon when idle, but switch to 3.5G > > when actively receiving data. > > I mean the actual bearer being used. The 27.007 equivalent would be > +CPSB, not what is reported by +CGREG. I think we need both. I assume we should have two properties in the ConnectionManager, one for each. But then it is questionable why the NetworkRegistration should exhibit anything other than 'gsm', 'umts' and 'lte' (and whatever-CDMA). -- Rémi Denis-Courmont Nokia Devices R&D, Maemo Software, Helsinki ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] Add voice call boolean property for MO/MT distinction
On Wednesday 24 November 2010 23:31:43 ext Denis Kenzior, you wrote: > Hi Rémi, > > > + boolean Originated [readonly] > > + > > + Indicates whether the call was mobile-originated > > + (true) or mobile-terminated (false). > > + > > What use case are you trying to enable with this API? I don't see how > this could be useful for the UI... This becomes a problem if we have more than one application "managing" voice calls. And I expect that will _be_ the most common case. You have the main call UI, but you also have the Bluetooth headset/carkit, the USB AT commands port, and possibly some third party call applications. Generally speaking, I don't see the point in oFono hiding obvious stuff that it knows about. -- Rémi Denis-Courmont Nokia Devices R&D, Maemo Software, Helsinki ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: How to get the OMA DRM right object file coming from WAP Push?
I found two methods: Methods void RegisterAgent(object path) Registers an agent which will be called whenever a new Smart Messaging based SMS arrives. Methods void ReceiveNotification(array{byte} notification, dict info) Requests the agent to process a new SMS that has arrived containing a WAP PUSH. The dictionary info contains 'Sender', 'LocalSentTime' and 'SentTime' properties. Can the two methods help me to handle files from WAP push? ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
How to get the OMA DRM right object file coming from WAP Push?
OMA DRM 1.0 use WAP Push to send a right object file to the device. The Push Application ID is - URN: x-wap-application:drm.ua - Number: 0x08 How can I get the right object file from oFono? Many thanks! Amanda ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 3/3] sms: restore pending tx messages from backup
--- src/ofono.h |1 + src/sms.c | 38 +++ src/smsutil.c | 116 + src/smsutil.h |6 +++ 4 files changed, 161 insertions(+), 0 deletions(-) diff --git a/src/ofono.h b/src/ofono.h index d1a4bdc..4777f70 100644 --- a/src/ofono.h +++ b/src/ofono.h @@ -241,6 +241,7 @@ enum ofono_sms_submit_flag { OFONO_SMS_SUBMIT_FLAG_RECORD_HISTORY = 0x2, OFONO_SMS_SUBMIT_FLAG_RETRY = 0x4, OFONO_SMS_SUBMIT_FLAG_EXPOSE_DBUS = 0x8, + OFONO_SMS_SUBMIT_FLAG_REUSE_UUID = 0x10, }; typedef void (*ofono_sms_txq_submit_cb_t)(gboolean ok, void *data); diff --git a/src/sms.c b/src/sms.c index f987946..be710b1 100644 --- a/src/sms.c +++ b/src/sms.c @@ -1814,6 +1814,40 @@ static void bearer_init_callback(const struct ofono_error *error, void *data) ofono_error("Error bootstrapping SMS Bearer Preference"); } +static void sms_restore_tx_queue(struct ofono_sms *sms) +{ + GQueue *backupq; + unsigned int flags; + struct txq_backup_entry *entry; + struct ofono_uuid ofono_uuid; + + DBG(""); + + flags = OFONO_SMS_SUBMIT_FLAG_RECORD_HISTORY; + flags |= OFONO_SMS_SUBMIT_FLAG_RETRY; + flags |= OFONO_SMS_SUBMIT_FLAG_REUSE_UUID; + + if (sms->use_delivery_reports) + flags |= OFONO_SMS_SUBMIT_FLAG_REQUEST_SR; + + backupq = sms_tx_queue_load(sms->imsi); + + while ((entry = g_queue_pop_head(backupq))) { + decode_hex_own_buf(entry->uuid, -1, NULL, 0, ofono_uuid.uuid); + + __ofono_sms_txq_submit(sms, entry->msg_list, flags, + &ofono_uuid, NULL, NULL); + + g_slist_foreach(entry->msg_list, (GFunc)g_free, NULL); + g_slist_free(entry->msg_list); + + g_free(entry->uuid); + g_free(entry); + } + + g_queue_free(backupq); +} + /* * Indicate oFono that a SMS driver is ready for operation * @@ -1877,6 +1911,7 @@ void ofono_sms_register(struct ofono_sms *sms) if (sms->driver->bearer_set) sms->driver->bearer_set(sms, sms->bearer, bearer_init_callback, sms); + sms_restore_tx_queue(sms); sms->text_handlers = __ofono_watchlist_new(g_free); sms->datagram_handlers = __ofono_watchlist_new(g_free); @@ -1918,6 +1953,9 @@ int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list, if (entry == NULL) return -ENOMEM; + if (flags & OFONO_SMS_SUBMIT_FLAG_REUSE_UUID) + memcpy(&entry->uuid, uuid, sizeof(*uuid)); + if (flags & OFONO_SMS_SUBMIT_FLAG_EXPOSE_DBUS) { m = message_create(&entry->uuid); if (m == NULL) diff --git a/src/smsutil.c b/src/smsutil.c index 7a6b70a..188b96e 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -2309,6 +2309,15 @@ static gboolean sms_deserialize(const unsigned char *buf, return sms_decode(buf + 1, len - 1, FALSE, buf[0], sms); } +static gboolean sms_deserialize_outgoing(const unsigned char *buf, + struct sms *sms, int len) +{ + if (len < 1) + return FALSE; + + return sms_decode(buf + 1, len - 1, TRUE, buf[0], sms); +} + static gboolean sms_assembly_extract_address(const char *straddr, struct sms_address *out) { @@ -3129,6 +3138,113 @@ void status_report_assembly_expire(struct status_report_assembly *assembly, } } +/* + * Each directory contains a file per pdu. + */ +static GSList *sms_tx_load(const char *imsi, const struct dirent *dir) +{ + GSList *list = NULL; + struct dirent **pdus; + char *path; + int len, i, r; + unsigned char buf[177]; + struct sms s; + + if (dir->d_type != DT_DIR) + return NULL; + + path = g_strdup_printf(SMS_TX_BACKUP_PATH "/%s", + imsi, dir->d_name); + + len = scandir(path, &pdus, NULL, versionsort); + g_free(path); + + if (len < 0) + return NULL; + + for (i = 0; i < len; i++) { + if (pdus[i]->d_type != DT_REG) + continue; + + if ((strcmp(dir->d_name, ".") == 0) || + (strcmp(dir->d_name, "..") == 0)) + continue; + + r = read_file(buf, sizeof(buf), SMS_TX_BACKUP_PATH "/%s/%s", + imsi, dir->d_name, pdus[i]->d_name); + if (r < 0) + continue; + + if (sms_deserialize_outgoing(buf, &s, r) == FALSE) + continue; + + list = g_slist_prepend(list, g_memdup(&s, sizeof(s))); + } + + for (i = 0; i < len; i++) + g_free(pdus[i]); + + g_free(pdus); + + return g_slist_reverse(list); +} + +/* + *
[PATCH 2/3] sms: delete sent sms messages from backup
--- src/sms.c |9 + src/smsutil.c | 38 ++ src/smsutil.h |4 3 files changed, 51 insertions(+), 0 deletions(-) diff --git a/src/sms.c b/src/sms.c index 6eab0fa..f987946 100644 --- a/src/sms.c +++ b/src/sms.c @@ -769,6 +769,10 @@ static void tx_finished(const struct ofono_error *error, int mr, void *data) goto next_q; } + sms_tx_backup_remove(sms->imsi, entry->id, + ofono_uuid_to_str(&entry->uuid), + entry->cur_pdu); + entry->cur_pdu += 1; entry->retry = 0; @@ -813,8 +817,13 @@ next_q: message_set_state(sms, &entry->uuid, ms); } + sms_tx_backup_destroy(sms->imsi, entry->id, + ofono_uuid_to_str(&entry->uuid)); + tx_queue_entry_destroy(entry); + tx_counter--; + if (g_queue_peek_head(sms->txq)) { DBG("Scheduling next"); sms->tx_source = g_timeout_add(0, tx_next, sms); diff --git a/src/smsutil.c b/src/smsutil.c index 4904419..7a6b70a 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -3151,6 +3151,44 @@ gboolean sms_tx_store(const char *imsi, unsigned long id, const char *uuid, return TRUE; } +void sms_tx_backup_destroy(const char *imsi, unsigned long id, const char *uuid) +{ + char *path; + struct dirent **entries; + int len; + + path = g_strdup_printf(SMS_TX_BACKUP_PATH_DIR, + imsi, id, uuid); + + len = scandir(path, &entries, NULL, versionsort); + while (len--) { + struct dirent *dir = entries[len]; + char *file = g_strdup_printf("%s/%s", path, dir->d_name); + + unlink(file); + + g_free(file); + g_free(entries[len]); + } + g_free(entries); + + rmdir(path); + + g_free(path); +} + +void sms_tx_backup_remove(const char *imsi, unsigned long id, const char *uuid, + guint8 seq) +{ + char *path; + + path = g_strdup_printf(SMS_TX_BACKUP_PATH_FILE, + imsi, id, uuid, seq); + unlink(path); + + g_free(path); +} + static inline GSList *sms_list_append(GSList *l, const struct sms *in) { struct sms *sms; diff --git a/src/smsutil.h b/src/smsutil.h index 5279489..2e2bae6 100644 --- a/src/smsutil.h +++ b/src/smsutil.h @@ -518,6 +518,10 @@ void status_report_assembly_expire(struct status_report_assembly *assembly, gboolean sms_tx_store(const char *imsi, unsigned long id, const char *uuid, struct sms *s, guint8 seq); +void sms_tx_backup_remove(const char *imsi, unsigned long id, const char *uuid, + guint8 seq); +void sms_tx_backup_destroy(const char *imsi, unsigned long id, + const char *uuid); GSList *sms_text_prepare(const char *to, const char *utf8, guint16 ref, gboolean use_16bit, -- 1.7.2.3 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 1/3] sms: store pending tx pdus on disk
--- src/sms.c | 17 + src/smsutil.c | 26 ++ src/smsutil.h |3 +++ 3 files changed, 46 insertions(+), 0 deletions(-) diff --git a/src/sms.c b/src/sms.c index 12988c8..6eab0fa 100644 --- a/src/sms.c +++ b/src/sms.c @@ -52,6 +52,8 @@ static gboolean tx_next(gpointer user_data); static GSList *g_drivers = NULL; +static unsigned long tx_counter = 0; + enum message_state { MESSAGE_STATE_PENDING = 0, MESSAGE_STATE_SENT, @@ -111,6 +113,7 @@ struct tx_queue_entry { ofono_sms_txq_submit_cb_t cb; void *data; ofono_destroy_func destroy; + int id; }; static gboolean uuid_equal(gconstpointer v1, gconstpointer v2) @@ -1899,6 +1902,8 @@ int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list, { struct message *m = NULL; struct tx_queue_entry *entry; + int i; + GSList *l; entry = tx_queue_entry_new(list, flags); if (entry == NULL) @@ -1923,6 +1928,8 @@ int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list, sms->ref = sms->ref + 1; } + entry->id = tx_counter++; + g_queue_push_tail(sms->txq, entry); if (g_queue_get_length(sms->txq) == 1) @@ -1931,6 +1938,16 @@ int __ofono_sms_txq_submit(struct ofono_sms *sms, GSList *list, if (uuid) memcpy(uuid, &entry->uuid, sizeof(*uuid)); + i = 0; + + for (l = list; l; l = l->next) { + struct sms *s = l->data; + sms_tx_store(sms->imsi, entry->id, + ofono_uuid_to_str(&entry->uuid), + s, i); + i++; + } + if (cb) cb(sms, &entry->uuid, data); diff --git a/src/smsutil.c b/src/smsutil.c index e6dbf5f..4904419 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -48,6 +48,10 @@ #define SMS_SR_BACKUP_PATH STORAGEDIR "/%s/sms_sr" #define SMS_SR_BACKUP_PATH_FILE SMS_SR_BACKUP_PATH "/%s-%s" +#define SMS_TX_BACKUP_PATH STORAGEDIR "/%s/tx_queue" +#define SMS_TX_BACKUP_PATH_DIR SMS_TX_BACKUP_PATH "/%lu-%s" +#define SMS_TX_BACKUP_PATH_FILE SMS_TX_BACKUP_PATH_DIR "/%03i" + #define SMS_ADDR_FMT "%24[0-9A-F]" #define SMS_MSGID_FMT "%40[0-9A-F]" @@ -3125,6 +3129,28 @@ void status_report_assembly_expire(struct status_report_assembly *assembly, } } +gboolean sms_tx_store(const char *imsi, unsigned long id, const char *uuid, + struct sms *s, guint8 seq) +{ + int len; + unsigned char buf[177]; + + if (!imsi) + return FALSE; + + len = sms_serialize(buf, s); + + /* +* file name is: imsi/order in tx_queue-uuid/order of pdus +*/ + if (write_file(buf, len, SMS_BACKUP_MODE, + SMS_TX_BACKUP_PATH_FILE, imsi, id, uuid, + seq) != len) + return FALSE; + + return TRUE; +} + static inline GSList *sms_list_append(GSList *l, const struct sms *in) { struct sms *sms; diff --git a/src/smsutil.h b/src/smsutil.h index 4b05313..5279489 100644 --- a/src/smsutil.h +++ b/src/smsutil.h @@ -516,6 +516,9 @@ void status_report_assembly_add_fragment(struct status_report_assembly void status_report_assembly_expire(struct status_report_assembly *assembly, time_t before); +gboolean sms_tx_store(const char *imsi, unsigned long id, const char *uuid, + struct sms *s, guint8 seq); + GSList *sms_text_prepare(const char *to, const char *utf8, guint16 ref, gboolean use_16bit, gboolean use_delivery_reports); -- 1.7.2.3 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH 0/3] Persist TX SMS messages
This patch series implements a method of persisting pending outgoing sms messages on disk. Once an sms message has been submitted to the transmit queue, each pdu in the message is stored on disk until the driver indicates that it has been sent. Each tx_queue_entry is given an id number that represents it's order in the queue. A subdirectory per entry is created as id-uuid, in order to preserve order when the queue is loaded in the event of a crash. Within each subdirectory, each pdu is saved in order by sequence number. When an sms driver is ready for operation, the disk will be scanned for any saved pending tx sms messages. If there are any found, they will be loaded from disk and placed into the queue in order. Kristen Carlson Accardi (3): sms: store pending tx pdus on disk sms: delete sent sms messages from backup sms: restore pending tx messages from backup src/ofono.h |1 + src/sms.c | 64 src/smsutil.c | 180 + src/smsutil.h | 13 4 files changed, 258 insertions(+), 0 deletions(-) -- 1.7.2.3 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] call-forwarding: skip property change data and fax
Hi Jeevaka, On 11/24/2010 03:57 AM, Jeevaka Badrappan wrote: > --- > src/call-forwarding.c |7 +++ > 1 files changed, 7 insertions(+), 0 deletions(-) > Good catch, patch has been applied. Thanks. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] Doc Update voicecallmanager-api.txt
Hi Arun, On 11/24/2010 08:56 AM, ext-arun.1.ravind...@nokia.com wrote: > From: Arun Ravindran > > --- > doc/voicecallmanager-api.txt |9 - > 1 files changed, 8 insertions(+), 1 deletions(-) > Patch has been applied, thanks. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] Add voice call boolean property for MO/MT distinction
Hi Rémi, > + boolean Originated [readonly] > + > + Indicates whether the call was mobile-originated > + (true) or mobile-terminated (false). > + What use case are you trying to enable with this API? I don't see how this could be useful for the UI... Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 4/7] text-telephony: implement interface/atom
Hi Lucas, >>> + tt_set_powered(tt, enable); >>> + tt_send_properties_reply(tt); >> >> The oFono convention is to reply to the pending D-Bus method call and >> then signal the property changed signals. >> > > The examples I found for query methods use exactly the opposite. See, > cw_ss_query_callback() in call-settings.c and > radio_fast_dormancy_query_callback() in radio-settings.c. So we do prefer the reply before the signal. However, we're still a bit inconsistent in this area because multi-property queries make this very hard. In the single property case it is doable, but I'm fine accepting this part as is. So feel free to ignore this feedback. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 4/7] text-telephony: implement interface/atom
Hi Denis, On Wed, Nov 24, 2010 at 1:58 PM, Denis Kenzior wrote: > Hi Lucas, > > On 11/23/2010 12:04 PM, Lucas De Marchi wrote: >> --- >> Makefile.am | 2 +- >> src/ofono.h | 2 + >> src/text-telephony.c | 341 >> ++ >> 3 files changed, 344 insertions(+), 1 deletions(-) >> create mode 100644 src/text-telephony.c >> >> diff --git a/Makefile.am b/Makefile.am >> index fb075a0..ee1313d 100644 >> --- a/Makefile.am >> +++ b/Makefile.am >> +static DBusMessage *tt_get_properties_reply(DBusMessage *msg, >> + struct ofono_text_telephony >> *tt) >> +{ >> + DBusMessage *reply; >> + DBusMessageIter iter; >> + DBusMessageIter dict; >> + dbus_bool_t value; >> + >> + reply = dbus_message_new_method_return(msg); >> + if (!reply) >> + return NULL; >> + >> + dbus_message_iter_init_append(reply, &iter); >> + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, >> + OFONO_PROPERTIES_ARRAY_SIGNATURE, >> + &dict); >> + >> + value = tt->powered; >> + ofono_dbus_dict_append(&dict, "Powered", DBUS_TYPE_BOOLEAN, &value); > > As mentioned previously, please use "Enabled" here. ok >> +static void tt_send_properties_reply(struct ofono_text_telephony *tt) >> +{ >> + DBusMessage *reply; >> + >> + tt->flags |= TEXT_TELEPHONY_FLAG_CACHED; >> + >> + reply = tt_get_properties_reply(tt->pending, tt); >> + __ofono_dbus_pending_reply(&tt->pending, reply); > > I actually prefer to fold this function into powered_callback ok > >> +} >> + >> +static void tt_query_powered_callback(const struct ofono_error *error, >> + ofono_bool_t enable, void >> *data) >> +{ >> + struct ofono_text_telephony *tt = data; >> + >> + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { >> + DBusMessage *reply; >> + >> + ofono_debug("Error during powered query"); >> + >> + reply = __ofono_error_failed(tt->pending); >> + __ofono_dbus_pending_reply(&tt->pending, reply); >> + >> + return; >> + } >> + >> + tt_set_powered(tt, enable); >> + tt_send_properties_reply(tt); > > The oFono convention is to reply to the pending D-Bus method call and > then signal the property changed signals. > The examples I found for query methods use exactly the opposite. See, cw_ss_query_callback() in call-settings.c and radio_fast_dormancy_query_callback() in radio-settings.c. This is because when calling the "tt_get_properties_reply(tt->pending, tt)" we need the new value in tt->powered in order to generate the reply correctly. Otherwise, we would need to save the value elsewhere, set with the new value, generate the message, restore the previous value and then call tt_set_powered(tt, enable). If we do this, maybe we have to change the other places too. > >> +int ofono_text_telephony_driver_register(const struct >> ofono_text_telephony_driver *d) >> +{ >> + DBG("driver: %p, name: %s", d, d->name); >> + >> + if (!d || !d->probe) >> + return -EINVAL; >> + >> + g_drivers = g_slist_prepend(g_drivers, (void *)d); >> + >> + return 0; >> +} >> + >> +void ofono_text_telephony_driver_unregister(const struct >> ofono_text_telephony_driver *d) >> +{ >> + DBG("driver: %p, name: %s", d, d->name); >> + >> + if (!d) > > The preferred style is to compare to NULL, e.g. if (d == NULL) Ok. I changed all the other places as well. > >> + return; >> + >> + g_drivers = g_slist_remove(g_drivers, (void *)d); >> +} >> + > > > >> +struct ofono_text_telephony *ofono_text_telephony_create(struct ofono_modem >> *modem, >> + unsigned int vendor, >> + const char *driver, >> + void *data) >> +{ >> + struct ofono_text_telephony *tt; >> + GSList *l; > > Please add a newline here ok > >> + if (!driver) >> + return NULL; >> + >> + tt = g_try_new0(struct ofono_text_telephony, 1); >> + if (!tt) >> + return NULL; >> + >> + tt->atom = __ofono_modem_add_atom(modem, >> OFONO_ATOM_TYPE_TEXT_TELEPHONY, >> + text_telephony_remove, tt); >> + >> + tt->powered = -1; > > I think it is safe to default this to 0 (off). ok > >> + >> + for (l = g_drivers; l; l = l->next) { >> + const struct ofono_text_telephony_driver *drv = l->data; >> + >> + if (g_strcmp0(drv->name, driver) != 0) >> + continue; >> + >> + if (drv->probe(tt, vendor, data) < 0) >> + continue; >> + >> + tt->driver = drv; >> + break; >> + } >> + >> + return tt; >> +} >> + > > O
[RFC PATCH 4/4] voicecall: add emergency call handling
--- src/voicecall.c | 112 ++- 1 files changed, 111 insertions(+), 1 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 3307db0..882d94f 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -52,6 +52,7 @@ struct ofono_voicecall { struct ofono_sim *sim; unsigned int sim_watch; unsigned int sim_state_watch; + unsigned int modem_online_watch; const struct ofono_voicecall_driver *driver; void *driver_data; struct ofono_atom *atom; @@ -133,6 +134,22 @@ static void add_to_en_list(GSList **l, const char **list) *l = g_slist_prepend(*l, g_strdup(list[i++])); } +static gint number_compare(gconstpointer a, gconstpointer b) +{ + const char *s1 = a, *s2 = b; + return strcmp(s1, s2); +} + +static ofono_bool_t emergency_number(struct ofono_voicecall *vc, + const char *number) +{ + if (number == NULL) + return FALSE; + + return g_slist_find_custom(vc->en_list, + number, number_compare) ? TRUE : FALSE; +} + static const char *disconnect_reason_to_string(enum ofono_disconnect_reason r) { switch (r) { @@ -1125,6 +1142,7 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc, static void manager_dial_callback(const struct ofono_error *error, void *data) { struct ofono_voicecall *vc = data; + struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); DBusMessage *reply; const char *number; gboolean need_to_emit; @@ -1143,8 +1161,12 @@ static void manager_dial_callback(const struct ofono_error *error, void *data) dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); - } else + } else { + if (emergency_number(vc, number)) + ofono_modem_dec_emergency(modem); + reply = __ofono_error_failed(vc->pending); + } __ofono_dbus_pending_reply(&vc->pending, reply); @@ -1156,6 +1178,7 @@ static DBusMessage *manager_dial(DBusConnection *conn, DBusMessage *msg, void *data) { struct ofono_voicecall *vc = data; + struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); const char *number; struct ofono_phone_number ph; const char *clirstr; @@ -1195,6 +1218,15 @@ static DBusMessage *manager_dial(DBusConnection *conn, string_to_phone_number(number, &ph); + if (emergency_number(vc, number)) { + ofono_bool_t online = ofono_modem_get_online(modem); + + ofono_modem_inc_emergency(modem); + + if (online == FALSE) + return NULL; + } + vc->driver->dial(vc, &ph, clir, OFONO_CUG_OPTION_DEFAULT, manager_dial_callback, vc); @@ -1748,6 +1780,7 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, const struct ofono_error *error) { struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); + const char *number; GSList *l; struct voicecall *call; time_t ts; @@ -1767,6 +1800,7 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, } call = l->data; + number = phone_number_to_string(&call->call->phone_number); ts = time(NULL); prev_status = call->call->status; @@ -1805,6 +1839,9 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, voicecalls_emit_call_removed(vc, call); + if (emergency_number(vc, number)) + ofono_modem_dec_emergency(modem); + voicecall_dbus_unregister(vc, call); vc->call_list = g_slist_remove(vc->call_list, call); @@ -2067,6 +2104,7 @@ static void voicecall_unregister(struct ofono_atom *atom) static void voicecall_remove(struct ofono_atom *atom) { struct ofono_voicecall *vc = __ofono_atom_get_data(atom); + struct ofono_modem *modem = __ofono_atom_get_modem(atom); DBG("atom: %p", atom); @@ -2108,6 +2146,12 @@ static void voicecall_remove(struct ofono_atom *atom) g_queue_free(vc->toneq); } + if (vc->modem_online_watch) { + __ofono_modem_remove_online_watch(modem, + vc->modem_online_watch); + vc->modem_online_watch = 0; + } + g_free(vc); } @@ -2205,6 +2249,7 @@ static void sim_watch(struct ofono_atom *atom, static void dial_request_cb(const struct ofono_error *error, void *data) { struct ofono_voicecall *vc = data; + struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); gboolean need_to_emit; struct voicecall *v; @@ -2214,6 +2259,10 @@ sta
[RFC PATCH 2/4] modem: add EmergencyMode property
--- src/dbus.c |7 +++ src/modem.c | 137 +++ src/ofono.h |5 ++ 3 files changed, 149 insertions(+), 0 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index ad29241..0b4fc06 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -348,6 +348,13 @@ DBusMessage *__ofono_error_access_denied(DBusMessage *msg) "Operation not permitted"); } +DBusMessage *__ofono_error_emergency_active(DBusMessage *msg) +{ + return g_dbus_create_error(msg, OFONO_ERROR_INTERFACE + ".EmergencyActive", + "Emergency state active"); +} + void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply) { DBusConnection *conn = ofono_dbus_get_connection(); diff --git a/src/modem.c b/src/modem.c index cfc767e..f005877 100644 --- a/src/modem.c +++ b/src/modem.c @@ -61,6 +61,7 @@ enum modem_state { struct ofono_modem { char*path; enum modem_statemodem_state; + enum modem_statemodem_state_pre_emergency; GSList *atoms; struct ofono_watchlist *atom_watches; GSList *interface_list; @@ -73,6 +74,7 @@ struct ofono_modem { guint timeout; ofono_bool_tonline; struct ofono_watchlist *online_watches; + unsigned intemergency; GHashTable *properties; struct ofono_sim*sim; unsigned intsim_watch; @@ -517,6 +519,130 @@ static void offline_cb(const struct ofono_error *error, void *data) modem_change_state(modem, MODEM_STATE_OFFLINE); } +ofono_bool_t ofono_modem_get_emergency(struct ofono_modem *modem) +{ + if (modem == NULL) + return FALSE; + + return modem->emergency != 0; +} + +static void modem_change_online(struct ofono_modem *modem, + enum modem_state new_state) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + enum modem_state old_state = modem->modem_state; + ofono_bool_t new_online = new_state == MODEM_STATE_ONLINE; + + DBG("old state: %d, new state: %d", old_state, new_state); + + if (new_online == modem->online) + return; + + modem->modem_state = new_state; + modem->online = new_online; + + ofono_dbus_signal_property_changed(conn, modem->path, + OFONO_MODEM_INTERFACE, "Online", + DBUS_TYPE_BOOLEAN, &modem->online); + + notify_online_watches(modem); +} + +static void emergency_online_cb(const struct ofono_error *error, void *data) +{ + struct ofono_modem *modem = data; + + DBG("modem: %p", modem); + + if (error->type == OFONO_ERROR_TYPE_NO_ERROR && + modem->modem_state != MODEM_STATE_ONLINE) + modem_change_online(modem, MODEM_STATE_ONLINE); +} + +static void emergency_offline_cb(const struct ofono_error *error, void *data) +{ + struct ofono_modem *modem = data; + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + gboolean state = FALSE; + + DBG("modem: %p", modem); + + if (error->type == OFONO_ERROR_TYPE_NO_ERROR && + modem->modem_state == MODEM_STATE_ONLINE) + modem_change_online(modem, modem->modem_state_pre_emergency); + + modem->emergency--; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_MODEM_INTERFACE, + "Emergency", + DBUS_TYPE_BOOLEAN, + &state); +} + +void ofono_modem_inc_emergency(struct ofono_modem *modem) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + gboolean state = TRUE; + + DBG("modem: %p", modem); + + modem->emergency++; + if (modem->emergency > 1) + return; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_MODEM_INTERFACE, + "Emergency", + DBUS_TYPE_BOOLEAN, + &state); + + modem->modem_state_pre_emergency = modem->modem_state; + + if (modem->modem_state == MODEM_STATE_ONLINE) + return; + + modem->driver->set_online(modem, TRUE, emergency_online_cb, modem); +} + +void ofono_modem_dec_emergency(struct ofono_modem *modem) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + gboolean state = FALSE; + + DBG("
Re: [RFC PATCH 4/4] voicecall: add emergency call handling
Hi Denis, On 11/23/2010 11:00 AM, ext Denis Kenzior wrote: Hi Andras, On 11/15/2010 10:58 AM, Andras Domokos wrote: --- src/voicecall.c | 111 ++- 1 files changed, 110 insertions(+), 1 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 3af614b..066cdb9 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -52,6 +52,7 @@ struct ofono_voicecall { struct ofono_sim *sim; unsigned int sim_watch; unsigned int sim_state_watch; + unsigned int modem_online_watch; const struct ofono_voicecall_driver *driver; void *driver_data; struct ofono_atom *atom; @@ -133,6 +134,22 @@ static void add_to_en_list(GSList **l, const char **list) *l = g_slist_prepend(*l, g_strdup(list[i++])); } +static gint number_compare(gconstpointer a, gconstpointer b) +{ + const char *s1 = a, *s2 = b; + return strcmp(s1, s2); +} + +static ofono_bool_t emergency_number(struct ofono_voicecall *vc, + const char *number) +{ + if (!number) Just nit picking here, but in general we really prefer this to be written like this: if (number == NULL) This is much easier to read when you don't know if number is a string or an integer. Yes I know we're not always consistent about doing this, particularly in voicecall.c. + return FALSE; + + return g_slist_find_custom(vc->en_list, + number, number_compare) ? TRUE : FALSE; +} + static const char *disconnect_reason_to_string(enum ofono_disconnect_reason r) { switch (r) { @@ -1125,6 +1142,7 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc, static void manager_dial_callback(const struct ofono_error *error, void *data) { struct ofono_voicecall *vc = data; + struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); DBusMessage *reply; const char *number; gboolean need_to_emit; @@ -1143,8 +1161,12 @@ static void manager_dial_callback(const struct ofono_error *error, void *data) dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH,&path, DBUS_TYPE_INVALID); - } else + } else { + if (emergency_number(vc, number)) + ofono_modem_dec_emergency_mode(modem); + reply = __ofono_error_failed(vc->pending); + } __ofono_dbus_pending_reply(&vc->pending, reply); @@ -1156,6 +1178,7 @@ static DBusMessage *manager_dial(DBusConnection *conn, DBusMessage *msg, void *data) { struct ofono_voicecall *vc = data; + struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); const char *number; struct ofono_phone_number ph; const char *clirstr; @@ -1195,6 +1218,15 @@ static DBusMessage *manager_dial(DBusConnection *conn, string_to_phone_number(number,&ph); + if (emergency_number(vc, number)) { + ofono_bool_t online = ofono_modem_get_online(modem); + + ofono_modem_inc_emergency_mode(modem); + + if (!online) Do me a favor and change this to: if (online == FALSE) + return NULL; + } + vc->driver->dial(vc,&ph, clir, OFONO_CUG_OPTION_DEFAULT, manager_dial_callback, vc); @@ -1748,6 +1780,7 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, const struct ofono_error *error) { struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom); + const char *number; GSList *l; struct voicecall *call; time_t ts; @@ -1767,6 +1800,7 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, } call = l->data; + number = phone_number_to_string(&call->call->phone_number); ts = time(NULL); prev_status = call->call->status; @@ -1805,6 +1839,9 @@ void ofono_voicecall_disconnected(struct ofono_voicecall *vc, int id, voicecalls_emit_call_removed(vc, call); + if (emergency_number(vc, number)) + ofono_modem_dec_emergency_mode(modem); + voicecall_dbus_unregister(vc, call); vc->call_list = g_slist_remove(vc->call_list, call); @@ -2067,6 +2104,7 @@ static void voicecall_unregister(struct ofono_atom *atom) static void voicecall_remove(struct ofono_atom *atom) { struct ofono_voicecall *vc = __ofono_atom_get_data(atom); + struct ofono_modem *modem = __ofono_atom_get_modem(atom); DBG("atom: %p", atom); @@ -2108,6 +2146,12 @@ static void voicecall_remove(struct ofono_atom *atom) g_queue_free(vc->toneq); } + if (vc->modem_online_watch) { + __ofono_modem_remove_online_watch(modem, + vc->modem_online_watch); + vc->modem_online_watch = 0; +
Re: [PATCH v2 4/7] text-telephony: implement interface/atom
Hi Lucas, On 11/23/2010 12:04 PM, Lucas De Marchi wrote: > --- > Makefile.am |2 +- > src/ofono.h |2 + > src/text-telephony.c | 341 > ++ > 3 files changed, 344 insertions(+), 1 deletions(-) > create mode 100644 src/text-telephony.c > > diff --git a/Makefile.am b/Makefile.am > index fb075a0..ee1313d 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -319,7 +319,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) > src/ofono.ver \ > src/radio-settings.c src/stkutil.h src/stkutil.c \ > src/nettime.c src/stkagent.c src/stkagent.h \ > src/simfs.c src/simfs.h src/audio-settings.c \ > - src/smsagent.c src/smsagent.h > + src/smsagent.c src/smsagent.h src/text-telephony.c > > src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ > -ldl > > diff --git a/src/ofono.h b/src/ofono.h > index d1a4bdc..42736bb 100644 > --- a/src/ofono.h > +++ b/src/ofono.h > @@ -125,6 +125,7 @@ enum ofono_atom_type { > OFONO_ATOM_TYPE_AUDIO_SETTINGS = 19, > OFONO_ATOM_TYPE_STK = 20, > OFONO_ATOM_TYPE_NETTIME = 21, > + OFONO_ATOM_TYPE_TEXT_TELEPHONY = 22, > }; > > enum ofono_atom_watch_condition { > @@ -205,6 +206,7 @@ gboolean __ofono_call_settings_is_busy(struct > ofono_call_settings *cs); > #include > #include > #include > +#include > > #include > > diff --git a/src/text-telephony.c b/src/text-telephony.c > new file mode 100644 > index 000..df87378 > --- /dev/null > +++ b/src/text-telephony.c > @@ -0,0 +1,341 @@ > +/* > + * > + * oFono - Open Source Telephony > + * > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). > + * Copyright (C) 2010 Intel Corporation. All rights reserved. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 > USA > + * > + */ > + > +#ifdef HAVE_CONFIG_H > +#include > +#endif > + > +#include > +#include > +#include > + > +#include > +#include > + > +#include "ofono.h" > +#include "common.h" > + > +#define TEXT_TELEPHONY_FLAG_CACHED 0x1 > + > +static GSList *g_drivers = NULL; > + > +struct ofono_text_telephony { > + DBusMessage *pending; > + int flags; > + ofono_bool_t powered; > + ofono_bool_t powered_pending; > + const struct ofono_text_telephony_driver *driver; > + void *driver_data; > + struct ofono_atom *atom; > +}; > + > +static DBusMessage *tt_get_properties_reply(DBusMessage *msg, > + struct ofono_text_telephony *tt) > +{ > + DBusMessage *reply; > + DBusMessageIter iter; > + DBusMessageIter dict; > + dbus_bool_t value; > + > + reply = dbus_message_new_method_return(msg); > + if (!reply) > + return NULL; > + > + dbus_message_iter_init_append(reply, &iter); > + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, > + OFONO_PROPERTIES_ARRAY_SIGNATURE, > + &dict); > + > + value = tt->powered; > + ofono_dbus_dict_append(&dict, "Powered", DBUS_TYPE_BOOLEAN, &value); As mentioned previously, please use "Enabled" here. > + dbus_message_iter_close_container(&iter, &dict); > + > + return reply; > +} > + > +static void tt_set_powered(struct ofono_text_telephony *tt, > + ofono_bool_t enable) > +{ > + DBusConnection *conn = ofono_dbus_get_connection(); > + const char *path = __ofono_atom_get_path(tt->atom); > + dbus_bool_t value = enable; > + > + if (tt->powered == enable) > + return; > + > + ofono_dbus_signal_property_changed(conn, path, > + OFONO_TEXT_TELEPHONY_INTERFACE, > + "Powered", > + DBUS_TYPE_BOOLEAN, &value); > + tt->powered = enable; > +} > + > +static void tt_set_powered_callback(const struct ofono_error *error, > + void *data) > +{ > + struct ofono_text_telephony *tt = data; > + DBusMessage *reply; > + > + if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { > + DBG("Error setting powered property"); > + > +
Re: [RFC PATCH 2/4] modem: add EmergencyMode property
Hi Denis, On 11/23/2010 10:46 AM, ext Denis Kenzior wrote: Hi Andras, On 11/15/2010 10:57 AM, Andras Domokos wrote: From: Andras Domokos --- src/modem.c | 134 +++ src/ofono.h |4 ++ 2 files changed, 138 insertions(+), 0 deletions(-) diff --git a/src/modem.c b/src/modem.c index f73cc1d..4307914 100644 --- a/src/modem.c +++ b/src/modem.c @@ -61,6 +61,7 @@ enum modem_state { struct ofono_modem { char*path; enum modem_statemodem_state; + enum modem_statemodem_state_pre_emergency; GSList *atoms; struct ofono_watchlist *atom_watches; GSList *interface_list; @@ -72,6 +73,7 @@ struct ofono_modem { ofono_bool_tpowered_pending; guint timeout; ofono_bool_tonline; + unsigned intemergency_mode; I really prefer this to be called 'emergency' struct ofono_watchlist *online_watches; GHashTable *properties; struct ofono_sim*sim; @@ -514,6 +516,127 @@ static void offline_cb(const struct ofono_error *error, void *data) modem_change_state(modem, MODEM_STATE_OFFLINE); } +ofono_bool_t ofono_modem_get_emergency_mode(struct ofono_modem *modem) +{ + if (modem == NULL) + return FALSE; + + return modem->emergency_mode != 0; +} + +static void modem_change_online(struct ofono_modem *modem, + enum modem_state new_state) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + enum modem_state old_state = modem->modem_state; + ofono_bool_t new_online = new_state == MODEM_STATE_ONLINE; + + DBG("old state: %d, new state: %d", old_state, new_state); + + if (new_online == modem->online) + return; + + modem->modem_state = new_state; + modem->online = new_online; + + ofono_dbus_signal_property_changed(conn, modem->path, + OFONO_MODEM_INTERFACE, "Online", + DBUS_TYPE_BOOLEAN,&modem->online); + + notify_online_watches(modem); +} + +static void emergency_online_cb(const struct ofono_error *error, void *data) +{ + struct ofono_modem *modem = data; + + DBG("modem: %p", modem); + + if (error->type == OFONO_ERROR_TYPE_NO_ERROR&& + modem->modem_state != MODEM_STATE_ONLINE) + modem_change_online(modem, MODEM_STATE_ONLINE); +} + +static void emergency_offline_cb(const struct ofono_error *error, void *data) +{ + struct ofono_modem *modem = data; + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + gboolean state = FALSE; + + DBG("modem: %p", modem); + + if (error->type == OFONO_ERROR_TYPE_NO_ERROR&& + modem->modem_state == MODEM_STATE_ONLINE) + modem_change_online(modem, modem->modem_state_pre_emergency); + + modem->emergency_mode--; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_MODEM_INTERFACE, + "EmergencyMode", The property should really be called 'Emergency' to be in line with the current API proposal (doc/modem-api.txt& TODO) + DBUS_TYPE_BOOLEAN, +&state); +} + +void ofono_modem_inc_emergency_mode(struct ofono_modem *modem) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + gboolean state = TRUE; + + DBG("modem: %p", modem); + + modem->emergency_mode++; + if (modem->emergency_mode> 1) + return; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_MODEM_INTERFACE, + "EmergencyMode", Again, 'Emergency' here + DBUS_TYPE_BOOLEAN, +&state); + + modem->modem_state_pre_emergency = modem->modem_state; + + if (modem->modem_state == MODEM_STATE_ONLINE) + return; + + modem->driver->set_online(modem, TRUE, emergency_online_cb, modem); +} + +void ofono_modem_dec_emergency_mode(struct ofono_modem *modem) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + gboolean state = FALSE; + + DBG("modem: %p", modem); + + if (modem->emergency_mode == 0) + return; Can you be a bit more pedantic and send an ofono_error for this case? We probably want to track whether some plugin abuses the reference counting. + + if (modem->emergency_mode> 1) { + modem->emergency_mode--; + return; + } + + if (modem->modem_state == MODEM_STATE_ONLINE&& + modem
Re: [PATCH v2 1/7] text-telephony: add public header
Hi Lucas, On 11/23/2010 12:04 PM, Lucas De Marchi wrote: > --- > Makefile.am |3 +- > include/text-telephony.h | 71 > ++ So I'd like to name this file include/ctm.h, looks nicer and is shorter to type. > 2 files changed, 73 insertions(+), 1 deletions(-) > create mode 100644 include/text-telephony.h > > diff --git a/Makefile.am b/Makefile.am > index f841b4c..fb075a0 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -13,7 +13,8 @@ include_HEADERS = include/log.h include/plugin.h > include/history.h \ > include/cbs.h include/call-volume.h \ > include/gprs.h include/gprs-context.h \ > include/radio-settings.h include/stk.h \ > - include/audio-settings.h include/nettime.h > + include/audio-settings.h include/nettime.h \ > + include/text-telephony.h > > nodist_include_HEADERS = include/version.h > > diff --git a/include/text-telephony.h b/include/text-telephony.h > new file mode 100644 > index 000..fafa7dd > --- /dev/null > +++ b/include/text-telephony.h > @@ -0,0 +1,71 @@ > +/* > + * > + * oFono - Open Source Telephony > + * > + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). > + * Copyright (C) 2010 Intel Corporation. All rights reserved. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 > USA > + * > + */ > + > +#ifndef __OFONO_TEXT_TELEPHONY_H > +#define __OFONO_TEXT_TELEPHONY_H OFONO_CTM here please > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include > + > +struct ofono_text_telephony; Can you do me a favor and rename all occurrences of ofono_text_telephony into ofono_ctm? > + > +typedef void (*ofono_text_telephony_set_cb_t)(const struct ofono_error > *error, > + void *data); > +typedef void (*ofono_text_telephony_query_cb_t)(const struct ofono_error > *error, > + ofono_bool_t enable, void > *data); > + > +struct ofono_text_telephony_driver { > + const char *name; > + int (*probe)(struct ofono_text_telephony *tt, unsigned int vendor, > + void *data); > + void (*remove)(struct ofono_text_telephony *tt); > + void (*query_tty)(struct ofono_text_telephony *tt, > + ofono_text_telephony_query_cb_t cb, > + void *data); > + void (*set_tty)(struct ofono_text_telephony *tt, > + int enable, > + ofono_text_telephony_set_cb_t cb, > + void *data); > +}; > + > +int ofono_text_telephony_driver_register(const struct > ofono_text_telephony_driver *d); > +void ofono_text_telephony_driver_unregister(const struct > ofono_text_telephony_driver *d); > + > +struct ofono_text_telephony *ofono_text_telephony_create(struct ofono_modem > *modem, > + unsigned int > vendor, > + const char > *driver, > + void *data); > + > +void ofono_text_telephony_register(struct ofono_text_telephony *tt); > +void ofono_text_telephony_remove(struct ofono_text_telephony *tt); > + > +void ofono_text_telephony_set_data(struct ofono_text_telephony *tt, void > *data); > +void *ofono_text_telephony_get_data(struct ofono_text_telephony *tt); > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __OFONO_TEXT_TELEPHONY_H */ Otherwise, looks good to me. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 3/7] text-telephony: add new interface to feature map
Hi Lucas, On 11/23/2010 12:04 PM, Lucas De Marchi wrote: > --- > src/modem.c |1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > Patch has been applied, thanks. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 2/7] text-telephony: define new dbus interface
Hi Lucas, On 11/23/2010 12:04 PM, Lucas De Marchi wrote: > --- > include/dbus.h |1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > Patch has been applied, thanks. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH v2 5/7] text-telephony: add documentation
Hi Lucas, > +Properties boolean Powered [readwrite] > + > + This property will enable or disable the text > + telephony feature in the modem. > + > + Text telephony (TTY), also known as TDD, is a feature > + present in some modems that allow them to be used by > + hearing impaired people. Marcel and I discussed this, and we decided we prefer 'Enabled' for the property name. You might also want to mention that this feature is also known as 'CTM', Cellular Text Modem. Regards, -Denis ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] Add voice call boolean property for MO/MT distinction
--- doc/voicecall-api.txt |5 + src/voicecall.c |6 +- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/doc/voicecall-api.txt b/doc/voicecall-api.txt index f0ba316..f3cad7c 100644 --- a/doc/voicecall-api.txt +++ b/doc/voicecall-api.txt @@ -87,6 +87,11 @@ Properties string LineIdentification [readonly] "override category" option was not provisioned for the current subscriber. + boolean Originated [readonly] + + Indicates whether the call was mobile-originated + (true) or mobile-terminated (false). + boolean Multiparty [readonly] Contains the indication if the voice call is part diff --git a/src/voicecall.c b/src/voicecall.c index 52baec3..045b492 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -322,7 +322,7 @@ static void append_voicecall_properties(struct voicecall *v, const char *status; const char *callerid; const char *timestr; - ofono_bool_t mpty; + ofono_bool_t mpty, originated; status = call_status_to_string(call->status); callerid = phone_number_to_string(&call->phone_number); @@ -342,6 +342,10 @@ static void append_voicecall_properties(struct voicecall *v, ×tr); } + originated = call->direction == CALL_DIRECTION_MOBILE_ORIGINATED; + ofono_dbus_dict_append(dict, "Originated", DBUS_TYPE_BOOLEAN, + &originated); + if (g_slist_find_custom(v->vc->multiparty_list, GINT_TO_POINTER(call->id), call_compare_by_id)) -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] Doc Update voicecallmanager-api.txt
From: Arun Ravindran --- doc/voicecallmanager-api.txt |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/doc/voicecallmanager-api.txt b/doc/voicecallmanager-api.txt index d960f3c..a4048d2 100644 --- a/doc/voicecallmanager-api.txt +++ b/doc/voicecallmanager-api.txt @@ -5,7 +5,14 @@ Serviceorg.ofono Interface org.ofono.VoiceCallManager Object path[variable prefix]/{modem0,modem1,...} -Methodsarray{object,dict} GetCalls() +Methodsdict GetProperties() + + Returns properties for the VoiceCallManager Interface. + See the properties section for available properties. + + Possible Errors: [service].Error.InvalidArguments + + array{object,dict} GetCalls() Get an array of call object paths and properties that represents the currently present calls. -- 1.7.0.4 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: [PATCH] isi: Fix issue in call forwarding erase response
Hi Aki, > > I think the problem is that we try to decode the alpha tag > even when it is not present, i.e., when _numlen is zero. > > In fact, this has already been fixed in my current working > tree in a bit different way. Mostly due to the fact that I added a new > g_isi_sb_iter_get_struct() method, which allows a little > easier access to sub-blocks like the one above. > > If you're curious, here's the tree with the fix: > http://meego.gitorious.org/~akiniemi/meego-cellular/ofono-aki/ commits/gisi Went through your fix and it looks good. Regards, Jeevaka ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] isi: Fix issue in call forwarding erase response
Hi Jeevaka, 2010/11/24 Jeevaka Badrappan : > --- > drivers/isimodem/call-forwarding.c | 20 ++-- > 1 files changed, 14 insertions(+), 6 deletions(-) > > diff --git a/drivers/isimodem/call-forwarding.c > b/drivers/isimodem/call-forwarding.c > index 1448451..c364bdf 100644 > --- a/drivers/isimodem/call-forwarding.c > +++ b/drivers/isimodem/call-forwarding.c > @@ -98,12 +98,20 @@ static gboolean decode_gsm_forwarding_info(const void > *restrict data, > uint8_t _ton; > char *_number = NULL; > > - if (!g_isi_sb_iter_get_byte(&iter, &_status, 3) > - || !g_isi_sb_iter_get_byte(&iter, &_ton, 4) > - || !g_isi_sb_iter_get_byte(&iter, &_norply, 5) > - || !g_isi_sb_iter_get_byte(&iter, &_numlen, 7) > - || !g_isi_sb_iter_get_alpha_tag(&iter, > &_number, > - _numlen * 2, 10)) > + if (status && !g_isi_sb_iter_get_byte(&iter, > &_status, 3)) > + return FALSE; > + > + if (ton && !g_isi_sb_iter_get_byte(&iter, &_ton, 4)) > + return FALSE; > + > + if (norply && !g_isi_sb_iter_get_byte(&iter, > &_norply, 5)) > + return FALSE; > + > + if (number && !g_isi_sb_iter_get_byte(&iter, > &_numlen, 7)) > + return FALSE; > + > + if (number && !g_isi_sb_iter_get_alpha_tag(&iter, > + &_number, _numlen * 2, 10)) > return FALSE; I think the problem is that we try to decode the alpha tag even when it is not present, i.e., when _numlen is zero. In fact, this has already been fixed in my current working tree in a bit different way. Mostly due to the fact that I added a new g_isi_sb_iter_get_struct() method, which allows a little easier access to sub-blocks like the one above. If you're curious, here's the tree with the fix: http://meego.gitorious.org/~akiniemi/meego-cellular/ofono-aki/commits/gisi Thanks for the report in any case! ;) Cheers, Aki ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] TODO: Add a new task for CELL_DCH state indication
--- TODO | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/TODO b/TODO index c484871..5806ef0 100644 --- a/TODO +++ b/TODO @@ -507,3 +507,13 @@ Miscellaneous Priority: Medium Complexity: C2 Owner: Sjur Br??ndeland + +- Add CELL_DCH state indication support. Add a new optional property to the + RadioSettings atom for indicating radio bearer idle/active status. This + feature is useful for many types of power management schemes that schedule + non-realtime operations over the UMTS radio interface to when the interface is + active for other purposes as well, i.e., in CELL_DCH state. + + Priority: Medium + Complexity: C4 + Owner: Aki Niemi -- 1.7.1 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] isi: Fix issue in call forwarding erase response
--- drivers/isimodem/call-forwarding.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/isimodem/call-forwarding.c b/drivers/isimodem/call-forwarding.c index 1448451..c364bdf 100644 --- a/drivers/isimodem/call-forwarding.c +++ b/drivers/isimodem/call-forwarding.c @@ -98,12 +98,20 @@ static gboolean decode_gsm_forwarding_info(const void *restrict data, uint8_t _ton; char *_number = NULL; - if (!g_isi_sb_iter_get_byte(&iter, &_status, 3) - || !g_isi_sb_iter_get_byte(&iter, &_ton, 4) - || !g_isi_sb_iter_get_byte(&iter, &_norply, 5) - || !g_isi_sb_iter_get_byte(&iter, &_numlen, 7) - || !g_isi_sb_iter_get_alpha_tag(&iter, &_number, - _numlen * 2, 10)) + if (status && !g_isi_sb_iter_get_byte(&iter, &_status, 3)) + return FALSE; + + if (ton && !g_isi_sb_iter_get_byte(&iter, &_ton, 4)) + return FALSE; + + if (norply && !g_isi_sb_iter_get_byte(&iter, &_norply, 5)) + return FALSE; + + if (number && !g_isi_sb_iter_get_byte(&iter, &_numlen, 7)) + return FALSE; + + if (number && !g_isi_sb_iter_get_alpha_tag(&iter, + &_number, _numlen * 2, 10)) return FALSE; if (status) -- 1.7.0.4 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Fix issue in call forwarding erase response handling
Hi, Issue observed in call forwarding feature information list parsing. Due to this, isimodem reports Erase failure to the core even when the Erase request is successfully handled by the network. Considering the current logic, this is the fix that can be provided without changes to other parts of the code. One of the other option is to initialize the status in the calling function and check its validity before the usage. Regards, Jeevaka ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
[PATCH] call-forwarding: skip property change data and fax
--- src/call-forwarding.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/call-forwarding.c b/src/call-forwarding.c index 715ce02..ce03c40 100644 --- a/src/call-forwarding.c +++ b/src/call-forwarding.c @@ -285,6 +285,13 @@ static void set_new_cond_list(struct ofono_call_forwarding *cf, for (o = old; o; o = o->next) { oc = o->data; + /* +* For now we only support Voice, although Fax & all Data +* basic services are applicable as well. +*/ + if (oc->cls > BEARER_CLASS_VOICE) + continue; + snprintf(attr, sizeof(attr), "%s%s", bearer_class_to_string(oc->cls), cf_type_lut[type]); -- 1.7.0.4 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Property signal fix for data and fax call forwarding
Hi, Data and Fax call forwarding is not supported in oFono. Currently, oFono triggers the property change only for voice call even when the Data/Fax call forwarding is active. In one particular case, the Data and Fax property change gets triggered. This patch handles that particular case as well. Regards, Jeevaka ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 0/3] Long dial string support (2nd)
Hi Rajesh, On 11/22/2010 10:58 PM, ext rajesh.naga...@elektrobit.com wrote: Hi Andras, Dial strings can now be as long as 120 digits (not counting '+'). This feature is going to be needed by the FDN feature. An FDN may consist of a phone number plus a DTMF string. In order to have the call succeed when FDN is enabled, both parts need to be provided when making a call, as a single dial string. For AT modems the long dial string can be and has to be passed as is to the modem, for ISI modems the dial string needs to be split into phone number (dest. address sub block) and DTMF tone (post dest. address sub block) before feeding it to the modem. Sending the DTMF tone in post dest. address sub block in case of the ISI modem or sending as part of the dial string in case of AT modems, will the modem take care of DTMF postfix handling by itself or its only going to use that for FDN check ? If its going to be earlier case, then not all modems support this feature and also sending the postfix DTMF tone automatically by the modem without notifying to the AP, then the user neither wont be aware of ongoing DTMF tone sending as there will be no local playback of the tone nor will have any control over the DTMF tones sending. So we should parse the dial string and extract the DTMF postfix (after the FDN check, anyways we are not suppoting FDN in oFono). Once the call gets connected, then the postfix DTMF tones can be sent out and signaled to the application about the start and stop events of each tone, so the application can generate the corresponding DTMF tones using the tonegenerator for local playback. Also currently the "w"/"W" stop character handling is not there, so I am not sure if its intentionally left out or missing ? I think the situation has been clarified based on the discussion with Denis. I stop pushing these patches. BR, Rajesh ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono Regards, Andras ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH 0/3] Long dial string support (2nd)
Hi Denis, On 11/24/2010 12:04 AM, ext Denis Kenzior wrote: Hi Andras, Even if we don't support FDN at this point, there is still a remaining related issue, who we are going to dial numbers like: 12345456p1234# I think the the dial string could still be passed to the voicecall driver that will take care of the modem specific details, most importantly playing the DTMF tones and generating the tone events that would be propagated back to voicecall manager and to D-Bus from there. So we looked into what it would take to implement dial strings with AT modems. The consensus was that passing the entire string to the driver was a bad idea as most modems simply do not support pause characters and have strict limitations on the number length. The best idea we have came up with so far is to parse the string passed to dial and separate the actual number from the dial string. The dial string then gets assigned to a separate property on the voice call object (see Dial String task in the TODO). We would then extend the call state logic to queue the dial string the same as a DTMF once the call is active. If you study the DTMF logic, you will note that Andrew has recently made it into a tone queue. Today we burst up to 8 (arbitrarily picked number) DTMF tones per driver request. What we could do is send a single tone at a time. In theory this would allow us to emit the Tone Started / Tone Stopped signals (please see the provide feedback of sent DTMF tones task) as well. It sounds like the ISI modems already work this way and are nicely covered by this approach... Thanks for your clarification. I also had a thorough look at the the DTMF tones handling implementation. Based on these infos and assuming that we don't want to implement (full) FDN support, these patches are not needed indeed. Regards, -Denis Regards, Andras ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: STK DisplayText changes proposal
Hi Andrew, > > On 23 November 2010 18:08, Denis Kenzior wrote: > > On 11/23/2010 10:55 AM, Andrzej Zaborowski wrote: > >> As for the clear after delay flag, there's a check for it in > >> display_text_cb (line 1248). As far as I can make out the only > >> difference is the response sent to the SIM. > > > > So it has been a long time since those discussions, but it does seem > to > > me that using a higher timeout in the case of 'wait_for_user' flag > seems > > like a good idea. Do you remember why we left this out? > > No, I don't, I'll send a patch to use the normal timeout instead of > short timeout when clearing after user action is requested. As for > the proposal to add a parameter clear_after_delay and the ScreenBusy > response I'm fine with both of them (as I don't think the saving from > hiding these details is worth it) but I leave it up to you and > Guillaume. It seems that a user action always clears the message but > it may be good to display a "confirm" button anyway. The ScreenBusy > response is also possible for other proactive commands so for > consistency would need to be added there too. > For the 'clear_after_delay' flag your patch to used the normal timeout and not the short when a user request is waiting will be probably sufficient for the moment. For the ScreenBusy response I'm agree with you that this response is also possible for other proactive commands. I'll do the necessary patch for this. Regards, Guillaume - Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono