summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-21 10:07:32 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-21 10:07:32 -0500
commit9fa51c4fb55638bad1f97a6e6f778ff636084469 (patch)
tree1eadf8bc70aad6e4b73b101a56ed5586fd18560c /src
parent2c2bcced5e5968d5819a3e8cf9d8225a572a714d (diff)
downloadofono-9fa51c4fb55638bad1f97a6e6f778ff636084469.tar.bz2
stkutil: Refactor service search
Only Bluetooth & IRDA are really defined by the specification
Diffstat (limited to 'src')
-rw-r--r--src/stkutil.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/stkutil.c b/src/stkutil.c
index acb4737b..fe9d45c7 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -1337,13 +1337,16 @@ static gboolean parse_dataobj_service_search(
const unsigned char *data;
unsigned int len = comprehension_tlv_iter_get_length(iter);
- if (len < 1)
+ if (len < 2)
return FALSE;
- if (len == 1)
- return TRUE;
-
data = comprehension_tlv_iter_get_data(iter);
+
+ /* According to TS 102.223, everything except BT & IRDA is RFU */
+ if (data[0] != STK_TECHNOLOGY_BLUETOOTH &&
+ data[0] != STK_TECHNOLOGY_IRDA)
+ return FALSE;
+
ss->tech_id = data[0];
ss->len = len - 1;