samples: bluetooth: Remove useless default_conn
The connection object is not used. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This commit is contained in:
parent
942979b252
commit
fc140d8616
2 changed files with 0 additions and 16 deletions
|
@ -22,8 +22,6 @@
|
||||||
#include <bluetooth/services/bas.h>
|
#include <bluetooth/services/bas.h>
|
||||||
#include <bluetooth/services/hrs.h>
|
#include <bluetooth/services/hrs.h>
|
||||||
|
|
||||||
struct bt_conn *default_conn;
|
|
||||||
|
|
||||||
static const struct bt_data ad[] = {
|
static const struct bt_data ad[] = {
|
||||||
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
|
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
|
||||||
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
|
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
|
||||||
|
@ -37,7 +35,6 @@ static void connected(struct bt_conn *conn, uint8_t err)
|
||||||
if (err) {
|
if (err) {
|
||||||
printk("Connection failed (err 0x%02x)\n", err);
|
printk("Connection failed (err 0x%02x)\n", err);
|
||||||
} else {
|
} else {
|
||||||
default_conn = bt_conn_ref(conn);
|
|
||||||
printk("Connected\n");
|
printk("Connected\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,11 +42,6 @@ static void connected(struct bt_conn *conn, uint8_t err)
|
||||||
static void disconnected(struct bt_conn *conn, uint8_t reason)
|
static void disconnected(struct bt_conn *conn, uint8_t reason)
|
||||||
{
|
{
|
||||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||||
|
|
||||||
if (default_conn) {
|
|
||||||
bt_conn_unref(default_conn);
|
|
||||||
default_conn = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bt_conn_cb conn_callbacks = {
|
static struct bt_conn_cb conn_callbacks = {
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
|
|
||||||
#include "hts.h"
|
#include "hts.h"
|
||||||
|
|
||||||
struct bt_conn *default_conn;
|
|
||||||
|
|
||||||
static const struct bt_data ad[] = {
|
static const struct bt_data ad[] = {
|
||||||
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
|
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
|
||||||
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
|
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
|
||||||
|
@ -38,7 +36,6 @@ static void connected(struct bt_conn *conn, uint8_t err)
|
||||||
if (err) {
|
if (err) {
|
||||||
printk("Connection failed (err 0x%02x)\n", err);
|
printk("Connection failed (err 0x%02x)\n", err);
|
||||||
} else {
|
} else {
|
||||||
default_conn = bt_conn_ref(conn);
|
|
||||||
printk("Connected\n");
|
printk("Connected\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,11 +43,6 @@ static void connected(struct bt_conn *conn, uint8_t err)
|
||||||
static void disconnected(struct bt_conn *conn, uint8_t reason)
|
static void disconnected(struct bt_conn *conn, uint8_t reason)
|
||||||
{
|
{
|
||||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||||
|
|
||||||
if (default_conn) {
|
|
||||||
bt_conn_unref(default_conn);
|
|
||||||
default_conn = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bt_conn_cb conn_callbacks = {
|
static struct bt_conn_cb conn_callbacks = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue