diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-04-21 10:04:13 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-21 10:04:13 -0500 |
commit | 432effa755e178e2e1303421caafb1d00e510d74 (patch) | |
tree | a4c91e9fddf09d3c83de58e15400a8aea8923f76 | |
parent | 515eef4db0fd0f62f5398d663761d92d81ae3f52 (diff) | |
download | ofono-432effa755e178e2e1303421caafb1d00e510d74.tar.bz2 |
stkutil: refactor device filter
Only Bluetooth & IRDA are really defined by the specification
-rw-r--r-- | src/stkutil.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/stkutil.c b/src/stkutil.c index d6c7235a..6f302637 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -1307,13 +1307,16 @@ static gboolean parse_dataobj_device_filter(struct comprehension_tlv_iter *iter, 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; + df->tech_id = data[0]; df->len = len - 1; |