diff options
-rw-r--r-- | bta/dm/bta_dm_act.c | 13 | ||||
-rw-r--r-- | bta/dm/bta_dm_cfg.c | 13 | ||||
-rw-r--r-- | include/bt_target.h | 17 | ||||
-rw-r--r-- | stack/btm/btm_devctl.c | 5 |
4 files changed, 30 insertions, 18 deletions
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c index 91577bf..8260847 100644 --- a/bta/dm/bta_dm_act.c +++ b/bta/dm/bta_dm_act.c @@ -454,9 +454,18 @@ void bta_dm_disable (tBTA_DM_MSG *p_data) if(BTM_GetNumAclLinks()==0) { - /* Earlier there used to be a 1-second timer to fire this callback. - * Doesn't look like it is needed. */ +#if (defined(BTA_DISABLE_DELAY) && BTA_DISABLE_DELAY > 0) + /* If BTA_DISABLE_DELAY is defined and greater than zero, then delay the shutdown by + * BTA_DISABLE_DELAY milliseconds + */ + APPL_TRACE_WARNING2("%s BTA_DISABLE_DELAY set to %d ms", + __FUNCTION__, BTA_DISABLE_DELAY); + bta_sys_stop_timer(&bta_dm_cb.disable_timer); + bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK*)&bta_dm_disable_conn_down_timer_cback; + bta_sys_start_timer(&bta_dm_cb.disable_timer, 0, BTA_DISABLE_DELAY); +#else bta_dm_disable_conn_down_timer_cback(NULL); +#endif } else { diff --git a/bta/dm/bta_dm_cfg.c b/bta/dm/bta_dm_cfg.c index f09f3bf..5e26909 100644 --- a/bta/dm/bta_dm_cfg.c +++ b/bta/dm/bta_dm_cfg.c @@ -28,19 +28,6 @@ #include "bta_api.h" #include "bta_dm_int.h" -#ifndef BTA_DM_COD - -/* - * major : COD_MAJOR_PHONE - * minor : COD_MINOR_SMART_PHONE - * svc : None, will be set as each profile registers - * - */ - -#define BTA_DM_COD {0x52, BTM_COD_MAJOR_PHONE, BTM_COD_MINOR_SMART_PHONE} -#endif - - #ifndef BTA_DM_LINK_POLICY_SETTINGS #define BTA_DM_LINK_POLICY_SETTINGS (HCI_ENABLE_MASTER_SLAVE_SWITCH | HCI_ENABLE_HOLD_MODE | HCI_ENABLE_SNIFF_MODE | HCI_ENABLE_PARK_MODE) #endif diff --git a/include/bt_target.h b/include/bt_target.h index 9b48e17..05c4a35 100644 --- a/include/bt_target.h +++ b/include/bt_target.h @@ -271,6 +271,10 @@ #define BTA_GATT_INCLUDED FALSE #endif +#ifndef BTA_DISABLE_DELAY +#define BTA_DISABLE_DELAY 200 /* in milliseconds */ +#endif + #ifndef RPC_TRACE_ONLY #define RPC_TRACE_ONLY FALSE #endif @@ -1031,9 +1035,16 @@ and USER_HW_DISABLE_API macros */ #define BTM_AFTER_RESET_TIMEOUT 0 #endif -/* The default class of device. */ -#ifndef BTM_INIT_CLASS_OF_DEVICE -#define BTM_INIT_CLASS_OF_DEVICE "\x00\x1F\x00" +/* Default class of device +* {SERVICE_CLASS, MAJOR_CLASS, MINOR_CLASS} +* +* SERVICE_CLASS:0x5A (Bit17 -Networking,Bit19 - Capturing,Bit20 -Object Transfer,Bit22 -Telephony) +* MAJOR_CLASS:0x02 - PHONE +* MINOR_CLASS:0x0C - SMART_PHONE +* +*/ +#ifndef BTA_DM_COD +#define BTA_DM_COD {0x5A, 0x02, 0x0C} #endif /* The number of SCO links. */ diff --git a/stack/btm/btm_devctl.c b/stack/btm/btm_devctl.c index 3715072..f0fc437 100644 --- a/stack/btm/btm_devctl.c +++ b/stack/btm/btm_devctl.c @@ -63,6 +63,11 @@ extern BOOLEAN BTA_PRM_CHECK_FW_VER(UINT8 *p); /* L O C A L D A T A D E F I N I T I O N S */ /********************************************************************************/ +/* The default class of device. */ +#ifndef BTM_INIT_CLASS_OF_DEVICE +#define BTM_INIT_CLASS_OF_DEVICE "\x00\x1F\x00" +#endif + #ifndef BTM_DEV_RESET_TIMEOUT #define BTM_DEV_RESET_TIMEOUT 4 #endif |