diff options
author | fredc <fredc@broadcom.com> | 2012-04-19 01:03:17 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:18 -0700 |
commit | 0a74f690813b98c1e8d6fa8f6ed10dc35b7949b6 (patch) | |
tree | 97ab43918797f04666eadf6164d981721184d752 /btif/src/btif_pan.c | |
parent | 541e4c7bdcc7377d46d264e6e1b06f4e81180165 (diff) | |
download | external_bluetooth_bluedroid-0a74f690813b98c1e8d6fa8f6ed10dc35b7949b6.zip external_bluetooth_bluedroid-0a74f690813b98c1e8d6fa8f6ed10dc35b7949b6.tar.gz external_bluetooth_bluedroid-0a74f690813b98c1e8d6fa8f6ed10dc35b7949b6.tar.bz2 |
Fixed Bluetooth on/off issues
Change-Id: Ibd43c39a2066127458374a3b7533bab12fa20e46
Diffstat (limited to 'btif/src/btif_pan.c')
-rw-r--r-- | btif/src/btif_pan.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/btif/src/btif_pan.c b/btif/src/btif_pan.c index 5b1e571..7edd88a 100644 --- a/btif/src/btif_pan.c +++ b/btif/src/btif_pan.c @@ -133,11 +133,13 @@ btpan_interface_t *btif_pan_get_interface() { return &pan_if; } -void btif_pan_init() + +static btpan_callbacks_t callback; +static bt_status_t btpan_init(const btpan_callbacks_t* callbacks) { + //static volatile int binit; + debug("in, btpan_cb.enabled:%d", btpan_cb.enabled); - //btif_enable_service(BTA_PANU_SERVICE_ID); - //btif_enable_service(BTA_NAP_SERVICE_ID); if (!btpan_cb.enabled) { //btui_cfg.pan_security = PAN_SECURITY; @@ -156,10 +158,15 @@ void btif_pan_init() btpan_enable(BTPAN_ROLE_PANU); //debug("set to BTPAN_ROLE_PANNAP for testing"); //btpan_enable(BTPAN_ROLE_PANNAP); + callback = *callbacks; + return BT_STATUS_SUCCESS; } + return BT_STATUS_FAIL; } -void btif_pan_cleanup() + +static void btpan_cleanup() { + debug("in, btpan_cb.enabled:%d", btpan_cb.enabled); debug("in, bt is shuting down..."); //bt is shuting down, invalid all bta pan handles int i; @@ -167,19 +174,7 @@ void btif_pan_cleanup() { btpan_cleanup_conn(&btpan_cb.conns[i]); } - btpan_cleanup(); -} -static btpan_callbacks_t callback; -static bt_status_t btpan_init(const btpan_callbacks_t* callbacks) -{ - debug("in, btpan_cb.enabled:%d", btpan_cb.enabled); - static volatile int binit; - callback = *callbacks; - return BT_STATUS_SUCCESS; -} -static void btpan_cleanup() -{ - debug("in, btpan_cb.enabled:%d", btpan_cb.enabled); + if (btpan_cb.enabled) { btpan_cb.enabled = 0; @@ -191,7 +186,9 @@ static void btpan_cleanup() btpan_cb.tap_fd = -1; } } + debug("out, %s", __FUNCTION__); } + static inline int bta_role_to_btpan(int bta_pan_role) { int btpan_role = 0; |