File tree Expand file tree Collapse file tree 2 files changed +0
-16
lines changed Expand file tree Collapse file tree 2 files changed +0
-16
lines changed Original file line number Diff line number Diff line change 2222#include <bluetooth/services/bas.h>
2323#include <bluetooth/services/hrs.h>
2424
25- struct bt_conn * default_conn ;
26-
2725static const struct bt_data ad [] = {
2826 BT_DATA_BYTES (BT_DATA_FLAGS , (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR )),
2927 BT_DATA_BYTES (BT_DATA_UUID16_ALL ,
@@ -37,19 +35,13 @@ static void connected(struct bt_conn *conn, uint8_t err)
3735 if (err ) {
3836 printk ("Connection failed (err 0x%02x)\n" , err );
3937 } else {
40- default_conn = bt_conn_ref (conn );
4138 printk ("Connected\n" );
4239 }
4340}
4441
4542static void disconnected (struct bt_conn * conn , uint8_t reason )
4643{
4744 printk ("Disconnected (reason 0x%02x)\n" , reason );
48-
49- if (default_conn ) {
50- bt_conn_unref (default_conn );
51- default_conn = NULL ;
52- }
5345}
5446
5547static struct bt_conn_cb conn_callbacks = {
Original file line number Diff line number Diff line change 2323
2424#include "hts.h"
2525
26- struct bt_conn * default_conn ;
27-
2826static const struct bt_data ad [] = {
2927 BT_DATA_BYTES (BT_DATA_FLAGS , (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR )),
3028 BT_DATA_BYTES (BT_DATA_UUID16_ALL ,
@@ -38,19 +36,13 @@ static void connected(struct bt_conn *conn, uint8_t err)
3836 if (err ) {
3937 printk ("Connection failed (err 0x%02x)\n" , err );
4038 } else {
41- default_conn = bt_conn_ref (conn );
4239 printk ("Connected\n" );
4340 }
4441}
4542
4643static void disconnected (struct bt_conn * conn , uint8_t reason )
4744{
4845 printk ("Disconnected (reason 0x%02x)\n" , reason );
49-
50- if (default_conn ) {
51- bt_conn_unref (default_conn );
52- default_conn = NULL ;
53- }
5446}
5547
5648static struct bt_conn_cb conn_callbacks = {
You can’t perform that action at this time.
0 commit comments