diff options
author | zzy <zhenye@broadcom.com> | 2012-04-27 12:20:16 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:19 -0700 |
commit | 7f58927df0ee3f2f38367efe62c8901a760eeaa4 (patch) | |
tree | ba920ae2e186b57109772740976524dfd5d0512a | |
parent | 2dd1d06380fe8635f247390e22b93324eb30d893 (diff) | |
download | external_bluetooth_bluedroid-7f58927df0ee3f2f38367efe62c8901a760eeaa4.zip external_bluetooth_bluedroid-7f58927df0ee3f2f38367efe62c8901a760eeaa4.tar.gz external_bluetooth_bluedroid-7f58927df0ee3f2f38367efe62c8901a760eeaa4.tar.bz2 |
Enable pannap panu sdp by default add network service class bit and other minors improvements
Change-Id: Iacbd7adb74836394256e97185efa68d0f3952009
-rw-r--r-- | bta/dm/bta_dm_cfg.c | 2 | ||||
-rw-r--r-- | btif/src/btif_pan.c | 3 | ||||
-rw-r--r-- | btif/src/btif_sock_thread.c | 16 | ||||
-rw-r--r-- | btif/src/btif_sock_util.c | 8 |
4 files changed, 15 insertions, 14 deletions
diff --git a/bta/dm/bta_dm_cfg.c b/bta/dm/bta_dm_cfg.c index e6a76af..d3ae0ec 100644 --- a/bta/dm/bta_dm_cfg.c +++ b/bta/dm/bta_dm_cfg.c @@ -24,7 +24,7 @@ * */ -#define BTA_DM_COD {0x40, BTM_COD_MAJOR_PHONE, BTM_COD_MINOR_SMART_PHONE} +#define BTA_DM_COD {0x52, BTM_COD_MAJOR_PHONE, BTM_COD_MINOR_SMART_PHONE} #endif diff --git a/btif/src/btif_pan.c b/btif/src/btif_pan.c index c489149..fe71195 100644 --- a/btif/src/btif_pan.c +++ b/btif/src/btif_pan.c @@ -152,8 +152,7 @@ void btif_pan_init() BTA_PanEnable(bta_pan_callback); btpan_cb.enabled = 1; - //panu by default - btpan_enable(BTPAN_ROLE_PANU); + btpan_enable(BTPAN_ROLE_PANU | BTPAN_ROLE_PANNAP); //debug("set to BTPAN_ROLE_PANNAP for testing"); //btpan_enable(BTPAN_ROLE_PANNAP); } diff --git a/btif/src/btif_sock_thread.c b/btif/src/btif_sock_thread.c index 4ffe5ab..4229f04 100644 --- a/btif/src/btif_sock_thread.c +++ b/btif/src/btif_sock_thread.c @@ -318,12 +318,14 @@ int btsock_thread_add_fd(int h, int fd, int type, int flags, uint32_t user_id) if(flags & SOCK_THREAD_ADD_FD_SYNC) { //must executed in socket poll thread - //debug("ts[%d].thread_id:%d, pthread self:%d", h, ts[h].thread_id, (int)pthread_self()); - asrt(ts[h].thread_id == pthread_self()); - //cleanup one-time flags - flags &= ~SOCK_THREAD_ADD_FD_SYNC; - add_poll(h, fd, type, flags, user_id); - return TRUE; + if(ts[h].thread_id == pthread_self()) + { + //cleanup one-time flags + flags &= ~SOCK_THREAD_ADD_FD_SYNC; + add_poll(h, fd, type, flags, user_id); + return TRUE; + } + debug("SOCK_THREAD_ADD_FD_SYNC is not called in poll thread context, fallback to async"); } sock_cmd_t cmd = {CMD_ADD_FD, fd, type, flags, user_id}; debug("adding fd:%d, flags:0x%x", fd, flags); @@ -580,7 +582,7 @@ static void *sock_poll_thread(void *arg) asrt(pfds[0].fd == ts[h].cmd_fdr); if(!process_cmd_sock(h)) { - debug("h:%d, process_cmd_sock failed, exit...", h); + debug("h:%d, process_cmd_sock return false, exit...", h); break; } if(ret == 1) diff --git a/btif/src/btif_sock_util.c b/btif/src/btif_sock_util.c index 0e81e75..e16cf9a 100644 --- a/btif/src/btif_sock_util.c +++ b/btif/src/btif_sock_util.c @@ -111,9 +111,9 @@ int sock_send_all(int sock_fd, const uint8_t* buf, int len) { do ret = send(sock_fd, buf, s, 0); while(ret < 0 && errno == EINTR); - if(ret < 0) + if(ret <= 0) { - error("sock fd:%d send errno:%d", sock_fd, errno); + error("sock fd:%d send errno:%d, ret:%d", sock_fd, errno, ret); return -1; } buf += ret; @@ -129,9 +129,9 @@ int sock_recv_all(int sock_fd, uint8_t* buf, int len) { do ret = recv(sock_fd, buf, r, MSG_WAITALL); while(ret < 0 && errno == EINTR); - if(ret < 0) + if(ret <= 0) { - error("sock fd:%d recv errno:%d", sock_fd, errno); + error("sock fd:%d recv errno:%d, ret:%d", sock_fd, errno, ret); return -1; } buf += ret; |