diff options
author | Krzysztof Wilk <Krzysztofx.Wilk@intel.com> | 2014-03-17 16:47:30 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2014-03-19 10:15:55 -0500 |
commit | b2b39437174ce9a74afae4ecfcabf47adb315e42 (patch) | |
tree | 7d9f7d04d98b7b998e7a6ae6cd79a44907ab0a58 /src | |
parent | 6b8f46a916bf57d454808243a672e2397b530ee8 (diff) | |
download | ofono-b2b39437174ce9a74afae4ecfcabf47adb315e42.tar.bz2 |
hfp: extend Features to three way calling and CHLD
Diffstat (limited to 'src')
-rw-r--r-- | src/handsfree.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/handsfree.c b/src/handsfree.c index b23cc3ab..98f97705 100644 --- a/src/handsfree.c +++ b/src/handsfree.c @@ -50,6 +50,7 @@ struct ofono_handsfree { ofono_bool_t voice_recognition; ofono_bool_t voice_recognition_pending; unsigned int ag_features; + unsigned int ag_mpty_features; unsigned char battchg; const struct ofono_handsfree_driver *driver; @@ -58,11 +59,14 @@ struct ofono_handsfree { DBusMessage *pending; }; -static const char **ag_features_list(unsigned int features) +static const char **ag_features_list(unsigned int features, unsigned int mpty_features) { - static const char *list[33]; + static const char *list[10]; unsigned int i = 0; + if (features & HFP_AG_FEATURE_3WAY) + list[i++] = "three-way-calling"; + if (features & HFP_AG_FEATURE_ECNR) list[i++] = "echo-canceling-and-noise-reduction"; @@ -72,6 +76,21 @@ static const char **ag_features_list(unsigned int features) if (features & HFP_AG_FEATURE_ATTACH_VOICE_TAG) list[i++] = "attach-voice-tag"; + if (mpty_features & HFP_AG_CHLD_0) + list[i++] = "release-all-held"; + + if (mpty_features & HFP_AG_CHLD_1x) + list[i++] = "release-specified-active-call"; + + if (mpty_features & HFP_AG_CHLD_2x) + list[i++] = "private-chat"; + + if (mpty_features & HFP_AG_CHLD_3) + list[i++] = "create-multiparty"; + + if (mpty_features & HFP_AG_CHLD_4) + list[i++] = "transfer"; + list[i] = NULL; return list; @@ -125,6 +144,15 @@ void ofono_handsfree_set_ag_features(struct ofono_handsfree *hf, hf->ag_features = ag_features; } +void ofono_handsfree_set_ag_chld_features(struct ofono_handsfree *hf, + unsigned int ag_mpty_features) +{ + if (hf == NULL) + return; + + hf->ag_mpty_features = ag_mpty_features; +} + void ofono_handsfree_battchg_notify(struct ofono_handsfree *hf, unsigned char level) { @@ -181,7 +209,7 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn, ofono_dbus_dict_append(&dict, "VoiceRecognition", DBUS_TYPE_BOOLEAN, &voice_recognition); - features = ag_features_list(hf->ag_features); + features = ag_features_list(hf->ag_features, hf->ag_mpty_features); ofono_dbus_dict_append_array(&dict, "Features", DBUS_TYPE_STRING, &features); |