Skip to contentSkip to conversation

emulator: add HFP feature defines

PATCH In review Frédéric Danis 2 participants 5 messages Jun 19, 2011 – Jun 20, 2011

lore
Share & tools
lore
#1 lore raw
In reply to Frédéric Danis

Hi Frédéric,

Quoted 21 lines · Frédéric Danis
---
 include/emulator.h |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
include/emulator.h +9 -0
index 5cd894b..452c59c 100644
@@ -48,6 +48,25 @@ extern "C" {
 #define OFONO_EMULATOR_CALLHELD_MULTIPLE 1
 #define OFONO_EMULATOR_CALLHELD_ON_HOLD 2
 
+/* AG supported features bitmap. Bluetooth HFP 1.5 spec page 77 */
+#define AG_FEATURE_3WAY 0x1
+#define AG_FEATURE_ECNR 0x2
+#define AG_FEATURE_VOICE_RECOG 0x4
+#define AG_FEATURE_IN_BAND_RING_TONE 0x8
+#define AG_FEATURE_ATTACH_VOICE_TAG 0x10
+#define AG_FEATURE_REJECT_CALL 0x20
+#define AG_FEATURE_ENHANCED_CALL_STATUS 0x40
+#define AG_FEATURE_ENHANCED_CALL_CONTROL 0x80

include/emulator.h extern "C" { · line 69

Quoted 10 lines
include/emulator.h +10 -0
+#define AG_FEATURE_EXTENDED_RES_CODE 0x100
+
+#define HF_FEATURE_ECNR 0x1
+#define HF_FEATURE_3WAY 0x2
+#define HF_FEATURE_CLIP 0x4
+#define HF_FEATURE_VOICE_RECOGNITION 0x8
+#define HF_FEATURE_REMOTE_VOLUME_CONTROL 0x10
+#define HF_FEATURE_ENHANCED_CALL_STATUS 0x20
+#define HF_FEATURE_ENHANCED_CALL_CONTROL 0x40
+

Since you're copying them from hfpmodem.h, I suggest making it official and not duplicate code. So I would suggest:

- add

	enum hfp_ag_feature {
		HFP_AG_FEATURE_3WAY =	0x1,
		HFP_AG_FEATURE_ECNR =	0x2,
		...
	};

	enum hfp_hf_feature {
		...
	};

to include/types.h, remove them from hfpmodem.h and use the new defines.

include/emulator.h extern "C" { · line 72

Quoted 3 lines
include/emulator.h +0 -0
 struct ofono_emulator;
 struct ofono_emulator_request;
 

Regards,
-Denis

#3 lore raw

Re: [PATCH 2/3] hfp_ag: fix SDP record

In reply to Frédéric Danis

Hi Frédéric,

Quoted 5 lines · Frédéric Danis

HFP AG supports 3 way calls

---
 plugins/hfp_ag.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch has been applied, thanks.

Regards,
-Denis

#0 lore raw

PATCH 1/3 emulator: add HFP feature defines

---
 include/emulator.h |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
include/emulator.h +19 -0
index 5cd894b..452c59c 100644
@@ -48,6 +48,25 @@ extern "C" {
 #define OFONO_EMULATOR_CALLHELD_MULTIPLE 1
 #define OFONO_EMULATOR_CALLHELD_ON_HOLD 2
 
+/* AG supported features bitmap. Bluetooth HFP 1.5 spec page 77 */
+#define AG_FEATURE_3WAY 0x1
+#define AG_FEATURE_ECNR 0x2
+#define AG_FEATURE_VOICE_RECOG 0x4
+#define AG_FEATURE_IN_BAND_RING_TONE 0x8
+#define AG_FEATURE_ATTACH_VOICE_TAG 0x10
+#define AG_FEATURE_REJECT_CALL 0x20
+#define AG_FEATURE_ENHANCED_CALL_STATUS 0x40
+#define AG_FEATURE_ENHANCED_CALL_CONTROL 0x80
+#define AG_FEATURE_EXTENDED_RES_CODE 0x100
+
+#define HF_FEATURE_ECNR 0x1
+#define HF_FEATURE_3WAY 0x2
+#define HF_FEATURE_CLIP 0x4
+#define HF_FEATURE_VOICE_RECOGNITION 0x8
+#define HF_FEATURE_REMOTE_VOLUME_CONTROL 0x10
+#define HF_FEATURE_ENHANCED_CALL_STATUS 0x20
+#define HF_FEATURE_ENHANCED_CALL_CONTROL 0x40
+
 struct ofono_emulator;
 struct ofono_emulator_request;
 
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 hfp_ag: fix SDP record

HFP AG supports 3 way calls

---
 plugins/hfp_ag.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
plugins/hfp_ag.c +1 -1
index 17751ad..191708b 100644
@@ -81,7 +81,7 @@ static const gchar *hfp_ag_record =
 "  </attribute>\n"
 "\n"
 "  <attribute id=\"0x0311\">\n"
-"    <uint16 value=\"0x0000\" />\n"
+"    <uint16 value=\"0x0001\" />\n"
 "  </attribute>\n"
 "</record>\n";
 
Signature · 1 line
1.7.1
#4 lore raw

PATCH 3/3 emulator: fix local HFP AG features

In reply to Frédéric Danis
---
 src/emulator.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
src/emulator.c +4 -2
index 1439854..d19706d 100644
@@ -882,8 +882,10 @@ struct ofono_emulator *ofono_emulator_create(struct ofono_modem *modem,
 		return NULL;
 
 	em->type = type;
-	/* TODO: Check real local features */
-	em->l_features = 32;
+	em->l_features = AG_FEATURE_3WAY | AG_FEATURE_REJECT_CALL |
+			AG_FEATURE_ENHANCED_CALL_STATUS |
+			AG_FEATURE_ENHANCED_CALL_CONTROL |
+			AG_FEATURE_EXTENDED_RES_CODE;
 	em->events_mode = 3;	/* default mode is forwarding events */
 	em->cmee_mode = 0;	/* CME ERROR disabled by default */
 
Signature · 1 line
1.7.1