summaryrefslogtreecommitdiffstats
path: root/src/userial_vendor.c
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-08-06 22:34:12 -0700
committerRashed Abdel-Tawab <rashed@linux.com>2015-10-17 23:52:43 -0400
commit40dbe817386c90c2ad1bd22f48fdb4416e3f3314 (patch)
tree7d8019c22325163c12156cc817e598bc7098b18c /src/userial_vendor.c
parent463d8060e2bb8bb64df2e0a97523020471f5d3cd (diff)
downloadandroid_hardware_broadcom_libbt-40dbe817386c90c2ad1bd22f48fdb4416e3f3314.tar.gz
android_hardware_broadcom_libbt-40dbe817386c90c2ad1bd22f48fdb4416e3f3314.tar.bz2
android_hardware_broadcom_libbt-40dbe817386c90c2ad1bd22f48fdb4416e3f3314.zip
libbt: Add support for using two stop bits
* This improves reliability on chips such as BCM4335. * Also externalize some configuration. Change-Id: I1271f0c1c3e602c8bfe9f816f57c9cb6add04b3a
Diffstat (limited to 'src/userial_vendor.c')
-rw-r--r--src/userial_vendor.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/userial_vendor.c b/src/userial_vendor.c
index 3ff518b..5d0ae9b 100644
--- a/src/userial_vendor.c
+++ b/src/userial_vendor.c
@@ -69,6 +69,7 @@ typedef struct
******************************************************************************/
static vnd_userial_cb_t vnd_userial;
+static int vnd_userial_force_2stopbits = UART_FORCE_TWO_STOPBITS;
/*****************************************************************************
** Helper Functions
@@ -229,10 +230,10 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
return -1;
}
- if(p_cfg->fmt & USERIAL_STOPBITS_1)
- stop_bits = 0;
- else if(p_cfg->fmt & USERIAL_STOPBITS_2)
+ if(vnd_userial_force_2stopbits || (p_cfg->fmt & USERIAL_STOPBITS_2))
stop_bits = CSTOPB;
+ else if(p_cfg->fmt & USERIAL_STOPBITS_1)
+ stop_bits = 0;
else
{
ALOGE("userial vendor open: unsupported stop bits");
@@ -374,3 +375,22 @@ int userial_set_port(char *p_conf_name, char *p_conf_value, int param)
return 0;
}
+/*******************************************************************************
+**
+** Function userial_set_force_use_2_stop_bits
+**
+** Description Configure UART port name
+**
+** Returns 0 : Success
+** Otherwise : Fail
+**
+*******************************************************************************/
+int userial_set_force_use_2_stop_bits(char *p_conf_name, char *p_conf_value, int param)
+{
+ if (strcmp(p_conf_value, "true") == 0)
+ vnd_userial_force_2stopbits = TRUE;
+ else
+ vnd_userial_force_2stopbits = FALSE;
+ return 0;
+}
+