Bluetooth: HFP HF: Enable extended AG Error Result Code

Send standard AT+CMEE command used to enable the use of result
code +CME ERROR.

< ACL Data TX: Handle 256 flags 0x00 dlen 18           [hci0] 23.101226
      Channel: 67 len 14 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x09 cr 0 dlci 0x02
         Control: 0xef poll/final 0
         Length: 10
         FCS: 0x40
        41 54 2b 43 4d 45 45 3d 31 0d 40                 AT+CMEE=1.@
> ACL Data RX: Handle 256 flags 0x02 dlen 15           [hci0] 23.127140
      Channel: 64 len 11 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xff poll/final 1
         Length: 6
         FCS: 0x86
         Credits: 1
        0d 0a 4f 4b 0d 0a 86                             ..OK...

Change-Id: I246c25252440c9c973e1f90156dab44c48f02c3a
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
This commit is contained in:
Sathish Narasimman 2017-01-25 21:10:30 +05:30 committed by Szymon Janc
commit 7fe2a96fc2

View file

@ -345,6 +345,17 @@ int unsolicited_cb(struct at_client *hf_at, struct net_buf *buf)
return -EINVAL;
}
int cmee_finish(struct at_client *hf_at, struct net_buf *buf,
enum at_result result)
{
if (result != AT_RESULT_OK) {
BT_ERR("SLC Connection ERROR in response");
return -EINVAL;
}
return 0;
}
static void slc_completed(struct at_client *hf_at)
{
struct bt_hfp_hf *hf = CONTAINER_OF(hf_at, struct bt_hfp_hf, at);
@ -353,6 +364,10 @@ static void slc_completed(struct at_client *hf_at)
if (bt_hf->connected) {
bt_hf->connected(conn);
}
if (hfp_hf_send_cmd(hf, NULL, cmee_finish, "AT+CMEE=1") < 0) {
BT_ERR("Error Sending AT+CMEE");
}
}
int cmer_finish(struct at_client *hf_at, struct net_buf *buf,