[RFC] HFP support into oFono and BlueZ
by Gustavo F. Padovan
Hi,
These patches implement the new API for the Audio Gateway in BlueZ. It
follows the last version of the HandsfreeGateway and HandsfreeAgent
Intefaces API.
The first two patches is for BlueZ and the other for oFono. You can
test it with using enable-modem and test-voicecall scripts into the
test dir of oFono.
Feel free to test it and send me your comments. We have some bugs yet.
The audio part is not working yet. We are going to work on pulseaudio
this week to get this done soon.
Regards,
--
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi
8 years, 6 months
[PATCH v3 0/2] Huawei GPRS support
by Kalle Valo
Here's v3 of my Huawei GPRS patches. I followed Marcel's advice and
implemented all Huawei quirks in the huawei plugin. Now the patches
are a lot smaller.
Please comment.
---
Kalle Valo (2):
huawei: add gprs context
huawei: detect SecondaryDevice which is used for events
drivers/atmodem/network-registration.c | 4 +
plugins/huawei.c | 112 +++++++++++++++++++++++++++++++-
plugins/udev.c | 61 +++++++++++++++--
3 files changed, 167 insertions(+), 10 deletions(-)
10 years, 6 months
[PATCH 1/3] hfp: create modem for new devices paired on runtime
by Gustavo F. Padovan
It listens the Paired property to create a modem to the recently paired
devices. It also renames added_watch to adapter_watch, a more proper
name.
---
plugins/hfp.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 57 insertions(+), 5 deletions(-)
diff --git a/plugins/hfp.c b/plugins/hfp.c
index 981b05b..3e41342 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -66,6 +66,7 @@ static const char *cmer_prefix[] = { "+CMER:", NULL };
static const char *chld_prefix[] = { "+CHLD:", NULL };
static DBusConnection *connection;
+static GHashTable *uuid_hash = NULL;
static void hfp_debug(const char *str, void *user_data)
{
@@ -427,6 +428,7 @@ static int hfp_create_modem(const char *device)
{
struct ofono_modem *modem;
struct hfp_data *data;
+ const char *path;
ofono_info("Using device: %s", device);
@@ -451,6 +453,9 @@ static int hfp_create_modem(const char *device)
ofono_modem_set_data(modem, data);
ofono_modem_register(modem);
+ path = ofono_modem_get_path(modem);
+ g_hash_table_insert(uuid_hash, g_strdup(device), g_strdup(path));
+
return 0;
free:
@@ -465,6 +470,9 @@ static void parse_uuids(DBusMessageIter *i, const char *device)
DBusMessageIter variant, ai;
const char *value;
+ if (g_hash_table_lookup(uuid_hash, device))
+ return;
+
dbus_message_iter_recurse(i, &variant);
dbus_message_iter_recurse(&variant, &ai);
@@ -624,6 +632,33 @@ static gboolean adapter_added(DBusConnection *connection, DBusMessage *message,
return TRUE;
}
+static gboolean uuid_emitted(DBusConnection *connection, DBusMessage *message,
+ void *user_data)
+{
+ const char *device, *property;
+ DBusMessageIter iter;
+
+ dbus_message_iter_init(message, &iter);
+
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ return FALSE;
+
+ dbus_message_iter_get_basic(&iter, &property);
+ if (g_str_equal(property, "UUIDs") == FALSE)
+ return TRUE;
+
+ if (!dbus_message_iter_next(&iter))
+ return FALSE;
+
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
+ return FALSE;
+
+ device = dbus_message_get_path(message);
+ parse_uuids(&iter, device);
+
+ return TRUE;
+}
+
static void list_adapters_cb(DBusPendingCall *call, gpointer user_data)
{
DBusError err;
@@ -725,6 +760,8 @@ static void hfp_remove(struct ofono_modem *modem)
hfp_unregister_ofono_handsfree(modem);
+ g_hash_table_remove(uuid_hash, data->handsfree_path);
+
g_free(data->handsfree_path);
g_free(data);
@@ -798,7 +835,8 @@ static struct ofono_modem_driver hfp_driver = {
.post_sim = hfp_post_sim,
};
-static guint added_watch;
+static guint adapter_watch;
+static guint uuid_watch;
static int hfp_init(void)
{
@@ -809,12 +847,21 @@ static int hfp_init(void)
connection = ofono_dbus_get_connection();
- added_watch = g_dbus_add_signal_watch(connection, NULL, NULL,
+ adapter_watch = g_dbus_add_signal_watch(connection, NULL, NULL,
BLUEZ_MANAGER_INTERFACE,
"AdapterAdded",
adapter_added, NULL, NULL);
- if (added_watch == 0) {
+ uuid_watch = g_dbus_add_signal_watch(connection, NULL, NULL,
+ BLUEZ_DEVICE_INTERFACE,
+ "PropertyChanged",
+ uuid_emitted, NULL, NULL);
+
+
+ uuid_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, g_free);
+
+ if (adapter_watch == 0 || uuid_watch == 0) {
err = -EIO;
goto remove;
}
@@ -828,7 +875,9 @@ static int hfp_init(void)
return 0;
remove:
- g_dbus_remove_watch(connection, added_watch);
+ g_dbus_remove_watch(connection, adapter_watch);
+ g_dbus_remove_watch(connection, uuid_watch);
+ g_hash_table_destroy(uuid_hash);
dbus_connection_unref(connection);
@@ -837,9 +886,12 @@ remove:
static void hfp_exit(void)
{
- g_dbus_remove_watch(connection, added_watch);
+ g_dbus_remove_watch(connection, adapter_watch);
+ g_dbus_remove_watch(connection, uuid_watch);
ofono_modem_driver_unregister(&hfp_driver);
+
+ g_hash_table_destroy(uuid_hash);
}
OFONO_PLUGIN_DEFINE(hfp, "Hands-Free Profile Plugins", VERSION,
--
1.6.4.4
10 years, 7 months
Modem emulator and DUN server side for oFono and BlueZ
by Zhang, Zhenhua
Hi,
I am now working on modem emulator and one usage is for DUN server role. Since Padovan is working on client role, it's good to share my rough thinking for server side implementation. Here are the simple steps I have:
1. Create an oFono emulator atom in oFono. It's the emulator manager that could create DUN, HFP AG or SPP type emulators. It exposes dbus methods like CreateEmulator, DestroyEmulator, GetProperty, etc.
2. DUN agent server in BlueZ watch oFono and call CreateEmulator and pass the file descriptor to oFono. This server could further implement HFP AG and SPP connection.
3. Once an emulator is created, other atom like voicecall, grps, sms register their interested AT command handlers to it. The goal is that we could handle all mandatory AT commands defined in DUN profile spec.
4. Once a DUN emulator received ATD*99#, DUN client performs ppp connection so we forward ppp command to ppp stack. It is done by ppp server side extension. It should be the simple command forwarding.
5. Once the PPP link over DUN is established, DUN client performs ConnMan integration and setup IP address, DNS server, etc.
6. Once the Bluetooth link is disconnected, we destroy the PPP and DUN emulator. If emulator atom itself is destroyed, we destroy the PPP and the Bluetooth connection. If the PPP link is disconnected but Bluetooth link is alive, we destroy the PPP and stay emulator alive.
Comments are welcome. :)
Regards,
Zhenhua
10 years, 7 months
[PATCH 01/11] In drivers/atmodem/sms.c:at_cmgl_cpms_cb() there is a temporary fix for Siemens TC65. If AT+CMGL=4 is sent to TC65, the AT command queue jams.
by pasi.miettinen@ixonos.com
From: Pasi Miettinen <pasi.miettinen(a)ixonos.com>
---
drivers/atmodem/sms.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
index 8049df6..27de77b 100644
--- a/drivers/atmodem/sms.c
+++ b/drivers/atmodem/sms.c
@@ -544,6 +544,10 @@ static void at_cmgl_cb(gboolean ok, GAtResult *result, gpointer user_data)
static void at_cmgl_cpms_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
+
+ DBG("PASS AT+CMGL=4!!!");
+ return;
+
struct cpms_request *req = user_data;
struct ofono_sms *sms = req->sms;
struct sms_data *data = ofono_sms_get_data(sms);
--
1.6.0.4
10 years, 8 months
[RFC patches 00/13] misc cleanups and SMS ID API
by Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez <inaky.perez-gonzalez(a)intel.com>
Hi All
This set of patches introduce:
- a few cleanups, code documentations nippets, .gitignore additions,
header file dependency fixes in smutil.h
- adds BUILD_BUG_ON() [linux kernel style], printf-like attribute
checking for {write,read}_file()
- make write_file() transaction-safe
- Introduce the SMS ID API (rfc, still incomplete).
feedback?
Thanks!
The following changes since commit 6b0f2328c5e190053f6a28ed119d01581e2119b3:
Denis Kenzior (1):
Update TODO
are available in the git repository at:
git://gitorious.org/~inakypg/ofono/ofono-inakypg.git master
Patches follow for reviewing convenience.
Inaky Perez-Gonzalez (13):
Update .gitignore to ignore cscope databases and backup files
sms_send_message: add a short roadmap
documentation: add note about referencing standards
sms_assembly_add_fragment_backup: clarify how insertion spot is found
util.h: Add BUILD_BUG_ON() and friends for compile-time assert checking
smutil.h: add missing header file dependencies
write_file: make transaction-safe
storage: add __attribute__((format)) to {write,read}_file() for printf-like variable arg verification
Add function doc headers to ofono_sms_{create,register}
doc: explain debugging options to -d, add a pointer in -h to manpage
automake: fix installation of udev rules in VPATH builds
SMS: introduce message ID API
SMS: implement SHA256-based message IDs [incomplete]
.gitignore | 3 +
HACKING | 10 +++
Makefile.am | 7 +-
doc/ofonod.8 | 5 +-
doc/standards.txt | 8 ++
src/main.c | 4 +-
src/sms.c | 69 +++++++++++++---
src/smsutil.c | 197 ++++++++++++++++++++++++++++++++++++++++++++
src/smsutil.h | 92 +++++++++++++++++++++
src/storage.c | 42 +++++++---
src/storage.h | 6 +-
src/util.h | 29 +++++++
unit/test-sms-msg-id.c | 212 ++++++++++++++++++++++++++++++++++++++++++++++++
13 files changed, 657 insertions(+), 27 deletions(-)
create mode 100644 doc/standards.txt
create mode 100644 unit/test-sms-msg-id.c
10 years, 8 months
[PATCH 01/11] stkutil: Add SMS-PP Data Download envelope builder
by Andrzej Zaborowski
Note that the sms_tpdu member could be of type struct sms_deliver, but the
users may more often have access to the raw tpdu so there's no point
decoding and reencoding it.
---
src/stkutil.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/stkutil.h | 21 +++++++++++++
2 files changed, 114 insertions(+), 0 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 7bbd1c9..a29abfe 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -3128,6 +3128,20 @@ static gboolean stk_tlv_builder_init(struct stk_tlv_builder *iter,
return comprehension_tlv_builder_init(&iter->ctlv, pdu, size);
}
+static gboolean stk_tlv_builder_recurse(struct stk_tlv_builder *iter,
+ struct ber_tlv_builder *btlv,
+ unsigned char tag)
+{
+ iter->value = NULL;
+ iter->len = 0;
+
+ if (ber_tlv_builder_next(btlv, tag >> 6, (tag >> 5) & 1,
+ tag & 0x1f) != TRUE)
+ return FALSE;
+
+ return ber_tlv_builder_recurse_comprehension(btlv, &iter->ctlv);
+}
+
static gboolean stk_tlv_builder_open_container(struct stk_tlv_builder *iter,
gboolean cr,
unsigned char shorttag,
@@ -3308,6 +3322,23 @@ static inline gboolean stk_tlv_builder_append_bytes(struct stk_tlv_builder *iter
return TRUE;
}
+/* Described in TS 102.223 Section 8.1 */
+static gboolean build_dataobj_address(struct stk_tlv_builder *tlv,
+ const void *data, gboolean cr)
+{
+ const struct stk_address *addr = data;
+ unsigned char tag = STK_DATA_OBJECT_TYPE_ADDRESS;
+ unsigned int len = (strlen(addr->number) + 1) / 2;
+ unsigned char number[len];
+
+ sim_encode_bcd_number(addr->number, number);
+
+ return stk_tlv_builder_open_container(tlv, cr, tag, FALSE) &&
+ stk_tlv_builder_append_byte(tlv, addr->ton_npi) &&
+ stk_tlv_builder_append_bytes(tlv, number, len) &&
+ stk_tlv_builder_close_container(tlv);
+}
+
/* Described in TS 102.223 Section 8.6 */
static gboolean build_dataobj_item_id(struct stk_tlv_builder *tlv,
const void *data, gboolean cr)
@@ -3360,6 +3391,18 @@ static gboolean build_dataobj_result(struct stk_tlv_builder *tlv,
return stk_tlv_builder_close_container(tlv);
}
+/* Described in TS 131.111 Section 8.13 */
+static gboolean build_dataobj_gsm_sms_tpdu(struct stk_tlv_builder *tlv,
+ const void *data, gboolean cr)
+{
+ const struct stk_common_byte_array *tpdu = data;
+ unsigned char tag = STK_DATA_OBJECT_TYPE_GSM_SMS_TPDU;
+
+ return stk_tlv_builder_open_container(tlv, cr, tag, TRUE) &&
+ stk_tlv_builder_append_bytes(tlv, tpdu->array, tpdu->len) &&
+ stk_tlv_builder_close_container(tlv);
+}
+
/* Defined in TS 102.223 Section 8.15 */
static gboolean build_dataobj_text(struct stk_tlv_builder *tlv,
const void *data, gboolean cr)
@@ -4099,3 +4142,53 @@ unsigned int stk_pdu_from_response(const struct stk_response *response,
return stk_tlv_builder_get_length(&builder);
}
+
+ofono_bool_t stk_pdu_from_envelope(const struct stk_envelope *envelope,
+ unsigned char *pdu, unsigned int size,
+ unsigned char **out_pdu,
+ unsigned int *out_size)
+{
+ struct ber_tlv_builder btlv;
+ struct stk_tlv_builder builder;
+ gboolean ok = TRUE;
+ unsigned char tag;
+
+ if (ber_tlv_builder_init(&btlv, pdu, size) != TRUE)
+ return FALSE;
+
+ if (stk_tlv_builder_recurse(&builder, &btlv, envelope->type) != TRUE)
+ return FALSE;
+
+ tag = STK_DATA_OBJECT_TYPE_DEVICE_IDENTITIES;
+ if (stk_tlv_builder_open_container(&builder, TRUE, tag, FALSE) == FALSE)
+ return FALSE;
+
+ if (stk_tlv_builder_append_byte(&builder, envelope->src) == FALSE)
+ return FALSE;
+
+ if (stk_tlv_builder_append_byte(&builder, envelope->dst) == FALSE)
+ return FALSE;
+
+ if (stk_tlv_builder_close_container(&builder) == FALSE)
+ return FALSE;
+
+ switch (envelope->type) {
+ case STK_ENVELOPE_TYPE_SMS_PP_DOWNLOAD:
+ ok = build_dataobj(&builder,
+ build_dataobj_address, 0,
+ &envelope->sms_pp_download.address,
+ build_dataobj_gsm_sms_tpdu,
+ DATAOBJ_FLAG_CR,
+ &envelope->sms_pp_download.sms_tpdu,
+ NULL);
+ break;
+ default:
+ return FALSE;
+ };
+
+ if (ok != TRUE)
+ return ok;
+
+ ber_tlv_builder_optimize(&btlv, out_pdu, out_size);
+ return TRUE;
+}
diff --git a/src/stkutil.h b/src/stkutil.h
index cc5801c..8f4ae36 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -1172,6 +1172,21 @@ struct stk_response {
void (*destructor)(struct stk_response *response);
};
+/* ENVELOPEs defined in TS 102.223 Section 7 */
+struct stk_envelope_sms_pp_download {
+ struct stk_address address;
+ struct stk_common_byte_array sms_tpdu;
+};
+
+struct stk_envelope {
+ enum stk_envelope_type type;
+ enum stk_device_identity_type src;
+ enum stk_device_identity_type dst;
+ union {
+ struct stk_envelope_sms_pp_download sms_pp_download;
+ };
+};
+
struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu,
unsigned int len);
void stk_command_free(struct stk_command *command);
@@ -1179,3 +1194,9 @@ void stk_command_free(struct stk_command *command);
/* Returns # of bytes written or zero on error */
unsigned int stk_pdu_from_response(const struct stk_response *response,
unsigned char *pdu, unsigned int size);
+
+/* Returns TRUE on success */
+ofono_bool_t stk_pdu_from_envelope(const struct stk_envelope *envelope,
+ unsigned char *pdu, unsigned int size,
+ unsigned char **out_pdu,
+ unsigned int *out_size);
--
1.7.1.86.g0e460.dirty
10 years, 8 months
E63 as generic At Modem?
by Arun Ravindran
Hello All,
I am running the latest ofono in my ubuntu 9.10, under virtual box.
I have connected my E63 through USB and I can see that the isimodem up and
working.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
root@arun-laptop:/home/arun/ofono_repository/ofono/test# ./list-modems
[ /isimodem0 ]
Powered = 1
Interfaces = org.ofono.RadioSettings org.ofono.SupplementaryServices
org.ofono.NetworkRegistration org.ofono.Phonebook org.ofono.SmsManager
org.ofono.SimManager org.ofono.VoiceCallManager
Model = Nokia E63
Manufacturer = Nokia
Serial = 356836020xxxxxx
Revision = V ICPR71_08w44.1
30-10-08
RM-437
(c) Nokia
[ org.ofono.RadioSettings ]
TechnologyPreference = any
[ org.ofono.SupplementaryServices ]
State = idle
[ org.ofono.NetworkRegistration ]
Status = unknown
Operators =
Mode = auto
Name =
[ org.ofono.Phonebook ]
[ org.ofono.SmsManager ]
ServiceCenterAddress = +358405202000
[ org.ofono.SimManager ]
SubscriberNumbers =
CardIdentifier = 89358010802064xxxxx
LockedPins =
PinRequired = none
SubscriberIdentity = 2449154705xxxxx
Present = 1
[ org.ofono.VoiceCallManager ]
EmergencyNumbers = 119 118 999 110 08 000 911 112
MultipartyCalls =
Calls =
------------------------------------------------------------------------------------------------------------------------------------------
I tried to use E63 as a generic modem by adding the following to the
modem.conf
---------------------------------------------------------------------------------------------------------------------------------------
# Sample for using generic driver
[generic]
Driver=atgen
Device=/dev/ttyACM1
Baud=460800
This was done based on the wvdialconf output:
----------------------------------------------------------------------------------------------------------------------------------------
wvdialconf create
Editing `create'.
Scanning your serial ports for a modem.
ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S1 S2 S3 ACM0
WvModem<*1>: Cannot get information for serial port.
ttyACM1<*1>: ATQ0 V1 E1 -- OK
ttyACM1<*1>: ATQ0 V1 E1 Z -- OK
ttyACM1<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyACM1<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyACM1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyACM1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyACM1<*1>: Modem Identifier: ATI -- Nokia
ttyACM1<*1>: Speed 4800: AT -- OK
ttyACM1<*1>: Speed 9600: AT -- OK
ttyACM1<*1>: Speed 19200: AT -- OK
ttyACM1<*1>: Speed 38400: AT -- OK
ttyACM1<*1>: Speed 57600: AT -- OK
ttyACM1<*1>: Speed 115200: AT -- OK
ttyACM1<*1>: Speed 230400: AT -- OK
ttyACM1<*1>: Speed 460800: AT -- OK
ttyACM1<*1>: Max speed is 460800; that should be safe.
ttyACM1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
Found an USB modem on /dev/ttyACM1.
create<Warn>: Can't open 'create' for reading: No such file or directory
create<Warn>: ...starting with blank configuration.
Modem configuration written to create.
ttyACM1<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
-----------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------
and i can see that ofono has detected it properly.
---------------------------------------------------------------------------------------------------
[ /generic ]
Interfaces = org.ofono.SimManager
Powered = 1
[ org.ofono.SimManager ]
Present = 0
---------------------------------------------------------------------------------------------------
But i do not see any interfaces other than SimManager. I wanted to try using
E63 as a generic at modem and make calls. Could any one help me in
identifying what is going wrong
here and why the generic modem is not identifying other interfaces?
Also am i right in expecting this from E63? Can i use it as generic AT
modem?
Thanks in advance
Regards
Arun
10 years, 9 months
Patch for voice call history plugin merge
by rajyalakshmi bommaraju
Hi,
I have implemented voice call history plugin using memory mapped file ,
this implementation tested on meego images right now as an external
plugin to ofono. I am submitting the code here so that it can be merged and will be used as builtin plugin of ofono in future. Please review the patch and let
me know your decision and any changes that needs to be done for accepting it.
Thanks
Raji Bommaraju
10 years, 9 months
[PATCH 1/2] stk: Constraint the appearance of empty item
by Yang Gu
If empty item turns out, it must be the only item in the list.
So the following situations are deemed as invalid:
1. Two empty items
2. Valid item + empty item
3. empty + valid item
---
src/stkutil.c | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index 2ca5c6a..a31ae20 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -2014,6 +2014,12 @@ static dataobj_handler handler_for_type(enum stk_data_object_type type)
}
}
+static void destroy_stk_item(struct stk_item *item)
+{
+ g_free(item->text);
+ g_free(item);
+}
+
static gboolean parse_item_list(struct comprehension_tlv_iter *iter,
void *data)
{
@@ -2022,21 +2028,40 @@ static gboolean parse_item_list(struct comprehension_tlv_iter *iter,
struct comprehension_tlv_iter iter_old;
struct stk_item item;
GSList *list = NULL;
+ unsigned int count = 0;
+ gboolean has_empty = FALSE;
do {
comprehension_tlv_iter_copy(iter, &iter_old);
memset(&item, 0, sizeof(item));
+ count++;
+
+ if (parse_dataobj_item(iter, &item) == TRUE) {
+ if (item.id == 0) {
+ has_empty = TRUE;
+ continue;
+ }
- if (parse_dataobj_item(iter, &item) == TRUE)
list = g_slist_prepend(list,
g_memdup(&item, sizeof(item)));
+ }
} while (comprehension_tlv_iter_next(iter) == TRUE &&
comprehension_tlv_iter_get_tag(iter) == tag);
comprehension_tlv_iter_copy(&iter_old, iter);
- *out = g_slist_reverse(list);
- return TRUE;
+ if (!has_empty) {
+ *out = g_slist_reverse(list);
+ return TRUE;
+ }
+
+ if (count == 1)
+ return TRUE;
+
+ g_slist_foreach(list, (GFunc)destroy_stk_item, NULL);
+ g_slist_free(list);
+ return FALSE;
+
}
static gboolean parse_provisioning_list(struct comprehension_tlv_iter *iter,
@@ -2342,12 +2367,6 @@ static gboolean parse_poll_interval(struct stk_command *command,
return TRUE;
}
-static void destroy_stk_item(struct stk_item *item)
-{
- g_free(item->text);
- g_free(item);
-}
-
static void destroy_setup_menu(struct stk_command *command)
{
g_free(command->setup_menu.alpha_id);
@@ -2392,9 +2411,6 @@ static gboolean parse_setup_menu(struct stk_command *command,
if (ret == FALSE)
return FALSE;
- if (obj->items == NULL)
- return FALSE;
-
return TRUE;
}
--
1.7.0.4
10 years, 9 months