diff options
-rwxr-xr-x | btif/src/btif_dm.c | 8 | ||||
-rwxr-xr-x | btif/src/btif_storage.c | 23 | ||||
-rwxr-xr-x | include/bt_target.h | 36 | ||||
-rw-r--r-- | include/gki_target.h | 70 |
4 files changed, 26 insertions, 111 deletions
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c index 5eb46a0..b5cac5d 100755 --- a/btif/src/btif_dm.c +++ b/btif/src/btif_dm.c @@ -765,7 +765,13 @@ static void btif_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl) status = BT_STATUS_RMT_DEV_DOWN; break; + /* map the auth failure codes, so we can retry pairing if necessary */ case HCI_ERR_AUTH_FAILURE: + case HCI_ERR_HOST_REJECT_SECURITY: + case HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE: + case HCI_ERR_UNIT_KEY_USED: + case HCI_ERR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED: + case HCI_ERR_INSUFFCIENT_SECURITY: BTIF_TRACE_DEBUG1(" %s() Authentication fail ", __FUNCTION__); if (pairing_cb.autopair_attempts == 1) { @@ -1117,7 +1123,7 @@ static void btif_dm_upstreams_evt(UINT16 event, char* p_param) bt_status_t status; bt_property_t prop; prop.type = BT_PROPERTY_BDNAME; - prop.len = 0; + prop.len = BD_NAME_LEN; prop.val = (void*)bdname; status = btif_storage_get_adapter_property(&prop); diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c index 0596ccd..46055f5 100755 --- a/btif/src/btif_storage.c +++ b/btif/src/btif_storage.c @@ -1340,7 +1340,6 @@ BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_add char *token; int ret; bdstr_t bdstr; - char bd_addr_lap[9]; char *dev_name_str; uint8_t i = 0; char value[BTIF_STORAGE_MAX_LINE_SZ]; @@ -1348,17 +1347,13 @@ BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_add bd2str(remote_dev_addr, &bdstr); - /* create a string with Lower Address Part from BD Address */ - snprintf(bd_addr_lap, 9, "%s", (char*)bdstr); + /* Consider only Lower Address Part from BD Address */ + bdstr[8] = '\0'; - for ( i =0; i <strlen(bd_addr_lap) ;i++) - { - bd_addr_lap[i] = toupper(bd_addr_lap[i]); - } if(btif_config_get_str("Local", BTIF_STORAGE_PATH_AUTOPAIR_BLACKLIST, BTIF_STORAGE_KEY_AUTOPAIR_BLACKLIST_ADDR, value, &value_size)) { - if (strstr(value,bd_addr_lap) != NULL) + if (strcasestr(value,bdstr) != NULL) return TRUE; } @@ -1449,24 +1444,22 @@ BOOLEAN btif_storage_is_fixed_pin_zeros_keyboard(bt_bdaddr_t *remote_dev_addr) { int ret; bdstr_t bdstr; - char bd_addr_lap[9]; char *dev_name_str; uint8_t i = 0; char linebuf[BTIF_STORAGE_MAX_LINE_SZ]; bd2str(remote_dev_addr, &bdstr); - snprintf(bd_addr_lap, 9, "%s", (char*)bdstr); - for ( i =0; i <strlen(bd_addr_lap) ;i++) - { - bd_addr_lap[i] = toupper(bd_addr_lap[i]); - } + /*consider on LAP part of BDA string*/ + bdstr[8] = '\0'; + int line_size = sizeof(linebuf); if(btif_config_get_str("Local", BTIF_STORAGE_PATH_AUTOPAIR_BLACKLIST, BTIF_STORAGE_KEY_AUTOPAIR_FIXPIN_KBLIST, linebuf, &line_size)) { - if (strstr(bd_addr_lap, linebuf) != NULL) + if (strcasestr(linebuf,bdstr) != NULL) return TRUE; } return FALSE; + } diff --git a/include/bt_target.h b/include/bt_target.h index 2b47532..766e3b2 100755 --- a/include/bt_target.h +++ b/include/bt_target.h @@ -286,30 +286,10 @@ #define LINUX_GKI_INCLUDED TRUE #endif -#ifndef TICKS_PER_SEC -#define TICKS_PER_SEC 100 -#endif - #ifndef BTA_SYS_TIMER_PERIOD #define BTA_SYS_TIMER_PERIOD 100 #endif -#ifndef GKI_BUF1_SIZE -#define GKI_BUF1_SIZE 288 -#endif - -#ifndef GKI_BUF3_MAX -#define GKI_BUF3_MAX 200 -#endif - -#ifndef GKI_BUF3_SIZE -#define GKI_BUF3_SIZE (4096+16) -#endif - -#ifndef GKI_BUF4_SIZE -#define GKI_BUF4_SIZE (8080+26) -#endif - #ifndef GKI_SHUTDOWN_EVT #define GKI_SHUTDOWN_EVT APPL_EVT_7 #endif @@ -326,22 +306,6 @@ #define LINUX_OS TRUE #endif -#ifndef BTU_TASK -#define BTU_TASK 0 -#endif - -#ifndef BTIF_TASK -#define BTIF_TASK 1 -#endif - -#ifndef A2DP_MEDIA_TASK -#define A2DP_MEDIA_TASK 2 -#endif - -#ifndef GKI_MAX_TASKS -#define GKI_MAX_TASKS 3 -#endif - #ifndef BTM_APP_DEV_INIT #define BTM_APP_DEV_INIT bte_main_post_reset_init #endif diff --git a/include/gki_target.h b/include/gki_target.h index 09aee17..c2c2b6b 100644 --- a/include/gki_target.h +++ b/include/gki_target.h @@ -16,8 +16,6 @@ #ifndef GKI_TARGET_H #define GKI_TARGET_H -#include "bt_target.h" - /* Operating System Selection */ #ifndef BTE_SIM_APP #define _GKI_ARM @@ -45,7 +43,7 @@ #if defined (GKI_DEBUG) && (GKI_DEBUG == TRUE) -#define GKI_TRACE(fmt, ...) LOGI ("%s: " fmt, __FUNCTION__, ## __VA_ARGS__) +#define GKI_TRACE(fmt, ...) ALOGI ("%s: " fmt, __FUNCTION__, ## __VA_ARGS__) #else #define GKI_TRACE(fmt, ...) #endif @@ -57,67 +55,21 @@ ******************************************************************************/ /* Definitions of task IDs for inter-task messaging */ -#ifndef MMI_TASK -#define MMI_TASK 0 -#endif - -#ifndef HCISU_TASK -#define HCISU_TASK 1 -#endif - -#ifndef NCI_TASK -#define NCI_TASK 2 -#endif - -#ifndef NFC_TASK -#define NFC_TASK 3 -#endif - #ifndef BTU_TASK -#define BTU_TASK 4 -#endif - -/* BTE Application, Sample Apps, or Serial port Demo based on JP3 and JP4 setting) */ -#ifndef BTE_APPL_TASK -#define BTE_APPL_TASK 5 -#endif - -#ifndef DEV_MGR_TASK -#define DEV_MGR_TASK 6 -#endif - -#ifndef ISE_SCR_TASK -#define ISE_SCR_TASK 7 -#endif - -#ifndef UCODEC_TASK -#define UCODEC_TASK 8 -#endif - -#ifndef RPCT_TASK -#define RPCT_TASK 9 -#endif - -#ifndef UNV_TASK -#define UNV_TASK 10 +#define BTU_TASK 0 #endif -#ifndef BTE_IDLE_TASK -#define BTE_IDLE_TASK 11 +#ifndef BTIF_TASK +#define BTIF_TASK 1 #endif -#ifndef UIPC_TASK -#define UIPC_TASK 12 +#ifndef A2DP_MEDIA_TASK +#define A2DP_MEDIA_TASK 2 #endif -#ifndef HCISU_AMP_TASK -#define HCISU_AMP_TASK 13 -#endif - - /* The number of GKI tasks in the software system. */ #ifndef GKI_MAX_TASKS -#define GKI_MAX_TASKS 14 +#define GKI_MAX_TASKS 3 #endif /****************************************************************************** @@ -214,7 +166,7 @@ /* The size of the buffers in pool 1. */ #ifndef GKI_BUF1_SIZE -#define GKI_BUF1_SIZE 128 +#define GKI_BUF1_SIZE 288 #endif /* The number of buffers in buffer pool 1. */ @@ -244,12 +196,12 @@ /* The size of the buffers in pool 3. */ #ifndef GKI_BUF3_SIZE -#define GKI_BUF3_SIZE 1800 +#define GKI_BUF3_SIZE (4096+16) #endif /* The number of buffers in buffer pool 3. */ #ifndef GKI_BUF3_MAX -#define GKI_BUF3_MAX 30 +#define GKI_BUF3_MAX 200 #endif /* The ID of buffer pool 3. */ @@ -276,7 +228,7 @@ Devices with small amount of RAM should limit the number of active obex objects. */ /* The size of the buffers in pool 4. */ #ifndef GKI_BUF4_SIZE -#define GKI_BUF4_SIZE 0x2000 +#define GKI_BUF4_SIZE (8080+26) #endif /* The number of buffers in buffer pool 4. */ |