Bluetooth: Host: Print error codes in hex
Error codes are listed in header files and in the core spec as hex values. Always print them in hex in debug for easier error code checking. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
67c66bd09d
commit
c1a754f665
|
@ -81,7 +81,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
|
||||
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
|
||||
|
||||
printk("Disconnected: %s (reason %u)\n", addr, reason);
|
||||
printk("Disconnected: %s (reason 0x%02x)\n", addr, reason);
|
||||
|
||||
bt_conn_unref(default_conn);
|
||||
default_conn = NULL;
|
||||
|
|
|
@ -187,7 +187,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
|
||||
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
|
||||
|
||||
printk("Disconnected: %s (reason %u)\n", addr, reason);
|
||||
printk("Disconnected: %s (reason 0x%02x)\n", addr, reason);
|
||||
|
||||
if (default_conn != conn) {
|
||||
return;
|
||||
|
|
|
@ -649,7 +649,7 @@ static void idle_timeout(struct k_work *work)
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
printk("Connected\n");
|
||||
k_delayed_work_cancel(&idle_work);
|
||||
|
@ -660,7 +660,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
{
|
||||
struct eds_slot *slot = &eds_slots[eds_active_slot];
|
||||
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
|
||||
if (!slot->connectable) {
|
||||
k_delayed_work_submit(&idle_work, 0);
|
||||
|
|
|
@ -229,7 +229,7 @@ static const struct bt_data ad[] = {
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
printk("Connected\n");
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
}
|
||||
|
||||
static struct bt_conn_cb conn_callbacks = {
|
||||
|
|
|
@ -344,7 +344,7 @@ static void csc_simulation(void)
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
printk("Connected\n");
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
}
|
||||
|
||||
static struct bt_conn_cb conn_callbacks = {
|
||||
|
|
|
@ -29,7 +29,7 @@ static const struct bt_data ad[] = {
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
printk("Connected\n");
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
}
|
||||
|
||||
static struct bt_conn_cb conn_callbacks = {
|
||||
|
|
|
@ -361,7 +361,7 @@ static const struct bt_data ad[] = {
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
printk("Connected\n");
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
}
|
||||
|
||||
static struct bt_conn_cb conn_callbacks = {
|
||||
|
|
|
@ -55,7 +55,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
|
||||
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
|
||||
|
||||
printk("Disconnected from %s (reason %u)\n", addr, reason);
|
||||
printk("Disconnected from %s (reason 0x%02x)\n", addr, reason);
|
||||
}
|
||||
|
||||
static void security_changed(struct bt_conn *conn, bt_security_t level)
|
||||
|
|
|
@ -32,7 +32,7 @@ static const struct bt_data ad[] = {
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
default_conn = bt_conn_ref(conn);
|
||||
printk("Connected\n");
|
||||
|
@ -41,7 +41,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
|
||||
if (default_conn) {
|
||||
bt_conn_unref(default_conn);
|
||||
|
|
|
@ -36,7 +36,7 @@ static const struct bt_data ad[] = {
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
default_conn = bt_conn_ref(conn);
|
||||
printk("Connected\n");
|
||||
|
@ -45,7 +45,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
|
||||
if (default_conn) {
|
||||
bt_conn_unref(default_conn);
|
||||
|
|
|
@ -48,7 +48,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
|
||||
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
|
||||
|
||||
printk("Disconnected from %s (reason %u)\n", addr, reason);
|
||||
printk("Disconnected from %s (reason 0x%02x)\n", addr, reason);
|
||||
}
|
||||
|
||||
static void identity_resolved(struct bt_conn *conn, const bt_addr_le_t *rpa,
|
||||
|
|
|
@ -230,7 +230,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
struct bt_conn_info info;
|
||||
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
|
||||
if (default_conn) {
|
||||
bt_conn_unref(default_conn);
|
||||
|
|
|
@ -83,7 +83,7 @@ static void advertise(void)
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
printk("Connection failed (err %u)\n", err);
|
||||
printk("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
printk("Connected\n");
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
advertise();
|
||||
}
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ static u8_t att_handle_rsp(struct bt_att *att, void *pdu, u16_t len, u8_t err)
|
|||
{
|
||||
bt_att_func_t func;
|
||||
|
||||
BT_DBG("err %u len %u: %s", err, len, bt_hex(pdu, len));
|
||||
BT_DBG("err 0x%02x len %u: %s", err, len, bt_hex(pdu, len));
|
||||
|
||||
/* Cancel timeout if ongoing */
|
||||
k_delayed_work_cancel(&att->timeout_work);
|
||||
|
|
|
@ -720,7 +720,7 @@ static void hci_disconn_complete(struct net_buf *buf)
|
|||
u16_t handle = sys_le16_to_cpu(evt->handle);
|
||||
struct bt_conn *conn;
|
||||
|
||||
BT_DBG("status %u handle %u reason %u", evt->status, handle,
|
||||
BT_DBG("status 0x%02x handle %u reason 0x%02x", evt->status, handle,
|
||||
evt->reason);
|
||||
|
||||
if (evt->status) {
|
||||
|
@ -920,7 +920,7 @@ static void enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt)
|
|||
struct bt_conn *conn;
|
||||
int err;
|
||||
|
||||
BT_DBG("status %u handle %u role %u %s", evt->status, handle,
|
||||
BT_DBG("status 0x%02x handle %u role %u %s", evt->status, handle,
|
||||
evt->role, bt_addr_le_str(&evt->peer_addr));
|
||||
|
||||
#if defined(CONFIG_BT_SMP)
|
||||
|
@ -1115,7 +1115,7 @@ static void le_legacy_conn_complete(struct net_buf *buf)
|
|||
struct bt_hci_evt_le_enh_conn_complete enh;
|
||||
const bt_addr_le_t *id_addr;
|
||||
|
||||
BT_DBG("status %u role %u %s", evt->status, evt->role,
|
||||
BT_DBG("status 0x%02x role %u %s", evt->status, evt->role,
|
||||
bt_addr_le_str(&evt->peer_addr));
|
||||
|
||||
enh.status = evt->status;
|
||||
|
@ -1234,7 +1234,7 @@ static void le_phy_update_complete(struct net_buf *buf)
|
|||
return;
|
||||
}
|
||||
|
||||
BT_DBG("PHY updated: status: 0x%x, tx: %u, rx: %u",
|
||||
BT_DBG("PHY updated: status: 0x%02x, tx: %u, rx: %u",
|
||||
evt->status, evt->tx_phy, evt->rx_phy);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_BT_AUTO_PHY_UPDATE) ||
|
||||
|
@ -1359,7 +1359,7 @@ static void le_conn_update_complete(struct net_buf *buf)
|
|||
|
||||
handle = sys_le16_to_cpu(evt->handle);
|
||||
|
||||
BT_DBG("status %u, handle %u", evt->status, handle);
|
||||
BT_DBG("status 0x%02x, handle %u", evt->status, handle);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
if (!conn) {
|
||||
|
@ -2062,7 +2062,7 @@ static void ssp_complete(struct net_buf *buf)
|
|||
struct bt_hci_evt_ssp_complete *evt = (void *)buf->data;
|
||||
struct bt_conn *conn;
|
||||
|
||||
BT_DBG("status %u", evt->status);
|
||||
BT_DBG("status 0x%02x", evt->status);
|
||||
|
||||
conn = bt_conn_lookup_addr_br(&evt->bdaddr);
|
||||
if (!conn) {
|
||||
|
@ -2463,7 +2463,7 @@ static void auth_complete(struct net_buf *buf)
|
|||
struct bt_conn *conn;
|
||||
u16_t handle = sys_le16_to_cpu(evt->handle);
|
||||
|
||||
BT_DBG("status %u, handle %u", evt->status, handle);
|
||||
BT_DBG("status 0x%02x, handle %u", evt->status, handle);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
if (!conn) {
|
||||
|
@ -2494,7 +2494,7 @@ static void read_remote_features_complete(struct net_buf *buf)
|
|||
struct bt_hci_cp_read_remote_ext_features *cp;
|
||||
struct bt_conn *conn;
|
||||
|
||||
BT_DBG("status %u handle %u", evt->status, handle);
|
||||
BT_DBG("status 0x%02x handle %u", evt->status, handle);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
if (!conn) {
|
||||
|
@ -2535,7 +2535,7 @@ static void read_remote_ext_features_complete(struct net_buf *buf)
|
|||
u16_t handle = sys_le16_to_cpu(evt->handle);
|
||||
struct bt_conn *conn;
|
||||
|
||||
BT_DBG("status %u handle %u", evt->status, handle);
|
||||
BT_DBG("status 0x%02x handle %u", evt->status, handle);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
if (!conn) {
|
||||
|
@ -2556,7 +2556,7 @@ static void role_change(struct net_buf *buf)
|
|||
struct bt_hci_evt_role_change *evt = (void *)buf->data;
|
||||
struct bt_conn *conn;
|
||||
|
||||
BT_DBG("status %u role %u addr %s", evt->status, evt->role,
|
||||
BT_DBG("status 0x%02x role %u addr %s", evt->status, evt->role,
|
||||
bt_addr_str(&evt->bdaddr));
|
||||
|
||||
if (evt->status) {
|
||||
|
@ -2877,7 +2877,7 @@ static void hci_encrypt_change(struct net_buf *buf)
|
|||
u16_t handle = sys_le16_to_cpu(evt->handle);
|
||||
struct bt_conn *conn;
|
||||
|
||||
BT_DBG("status %u handle %u encrypt 0x%02x", evt->status, handle,
|
||||
BT_DBG("status 0x%02x handle %u encrypt 0x%02x", evt->status, handle,
|
||||
evt->encrypt);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
|
@ -2952,7 +2952,7 @@ static void hci_encrypt_key_refresh_complete(struct net_buf *buf)
|
|||
|
||||
handle = sys_le16_to_cpu(evt->handle);
|
||||
|
||||
BT_DBG("status %u handle %u", evt->status, handle);
|
||||
BT_DBG("status 0x%02x handle %u", evt->status, handle);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
if (!conn) {
|
||||
|
@ -3121,7 +3121,7 @@ static void le_pkey_complete(struct net_buf *buf)
|
|||
struct bt_hci_evt_le_p256_public_key_complete *evt = (void *)buf->data;
|
||||
struct bt_pub_key_cb *cb;
|
||||
|
||||
BT_DBG("status: 0x%x", evt->status);
|
||||
BT_DBG("status: 0x%02x", evt->status);
|
||||
|
||||
atomic_clear_bit(bt_dev.flags, BT_DEV_PUB_KEY_BUSY);
|
||||
|
||||
|
@ -3141,7 +3141,7 @@ static void le_dhkey_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_evt_le_generate_dhkey_complete *evt = (void *)buf->data;
|
||||
|
||||
BT_DBG("status: 0x%x", evt->status);
|
||||
BT_DBG("status: 0x%02x", evt->status);
|
||||
|
||||
if (dh_key_cb) {
|
||||
dh_key_cb(evt->status ? NULL : evt->dhkey);
|
||||
|
@ -3155,7 +3155,7 @@ static void hci_reset_complete(struct net_buf *buf)
|
|||
u8_t status = buf->data[0];
|
||||
atomic_t flags;
|
||||
|
||||
BT_DBG("status %u", status);
|
||||
BT_DBG("status 0x%02x", status);
|
||||
|
||||
if (status) {
|
||||
return;
|
||||
|
@ -3730,7 +3730,7 @@ static void read_local_ver_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_rp_read_local_version_info *rp = (void *)buf->data;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
bt_dev.hci_version = rp->hci_version;
|
||||
bt_dev.hci_revision = sys_le16_to_cpu(rp->hci_revision);
|
||||
|
@ -3743,7 +3743,7 @@ static void read_bdaddr_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_rp_read_bd_addr *rp = (void *)buf->data;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
if (!bt_addr_cmp(&rp->bdaddr, BT_ADDR_ANY) ||
|
||||
!bt_addr_cmp(&rp->bdaddr, BT_ADDR_NONE)) {
|
||||
|
@ -3760,7 +3760,7 @@ static void read_le_features_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_rp_le_read_local_features *rp = (void *)buf->data;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
memcpy(bt_dev.le.features, rp->features, sizeof(bt_dev.le.features));
|
||||
}
|
||||
|
@ -3771,7 +3771,7 @@ static void read_buffer_size_complete(struct net_buf *buf)
|
|||
struct bt_hci_rp_read_buffer_size *rp = (void *)buf->data;
|
||||
u16_t pkts;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
bt_dev.br.mtu = sys_le16_to_cpu(rp->acl_max_len);
|
||||
pkts = sys_le16_to_cpu(rp->acl_max_num);
|
||||
|
@ -3786,7 +3786,7 @@ static void read_buffer_size_complete(struct net_buf *buf)
|
|||
struct bt_hci_rp_read_buffer_size *rp = (void *)buf->data;
|
||||
u16_t pkts;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
/* If LE-side has buffers we can ignore the BR/EDR values */
|
||||
if (bt_dev.le.mtu) {
|
||||
|
@ -3810,7 +3810,7 @@ static void le_read_buffer_size_complete(struct net_buf *buf)
|
|||
struct bt_hci_rp_le_read_buffer_size *rp = (void *)buf->data;
|
||||
u8_t le_max_num;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
bt_dev.le.mtu = sys_le16_to_cpu(rp->le_max_len);
|
||||
if (!bt_dev.le.mtu) {
|
||||
|
@ -3828,7 +3828,7 @@ static void read_supported_commands_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_rp_read_supported_commands *rp = (void *)buf->data;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
memcpy(bt_dev.supported_commands, rp->commands,
|
||||
sizeof(bt_dev.supported_commands));
|
||||
|
@ -3847,7 +3847,7 @@ static void read_local_features_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_rp_read_local_features *rp = (void *)buf->data;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
memcpy(bt_dev.features[0], rp->features, sizeof(bt_dev.features[0]));
|
||||
}
|
||||
|
@ -3856,7 +3856,7 @@ static void le_read_supp_states_complete(struct net_buf *buf)
|
|||
{
|
||||
struct bt_hci_rp_le_read_supp_states *rp = (void *)buf->data;
|
||||
|
||||
BT_DBG("status %u", rp->status);
|
||||
BT_DBG("status 0x%02x", rp->status);
|
||||
|
||||
bt_dev.le.states = sys_get_le64(rp->le_states);
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
char addr[BT_ADDR_LE_STR_LEN];
|
||||
|
||||
conn_addr_str(conn, addr, sizeof(addr));
|
||||
shell_print(ctx_shell, "Disconnected: %s (reason %u)", addr, reason);
|
||||
shell_print(ctx_shell, "Disconnected: %s (reason 0x%02x)", addr, reason);
|
||||
|
||||
if (default_conn == conn) {
|
||||
bt_conn_unref(default_conn);
|
||||
|
|
|
@ -208,7 +208,7 @@ static u8_t read_func(struct bt_conn *conn, u8_t err,
|
|||
struct bt_gatt_read_params *params,
|
||||
const void *data, u16_t length)
|
||||
{
|
||||
shell_print(ctx_shell, "Read complete: err %u length %u", err, length);
|
||||
shell_print(ctx_shell, "Read complete: err 0x%02x length %u", err, length);
|
||||
|
||||
if (!data) {
|
||||
(void)memset(params, 0, sizeof(*params));
|
||||
|
@ -324,7 +324,7 @@ static u8_t gatt_write_buf[CHAR_SIZE_MAX];
|
|||
static void write_func(struct bt_conn *conn, u8_t err,
|
||||
struct bt_gatt_write_params *params)
|
||||
{
|
||||
shell_print(ctx_shell, "Write complete: err %u", err);
|
||||
shell_print(ctx_shell, "Write complete: err 0x%02x", err);
|
||||
|
||||
(void)memset(&write_params, 0, sizeof(write_params));
|
||||
}
|
||||
|
|
|
@ -586,7 +586,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
|
||||
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
|
||||
|
||||
NET_DBG("Disconnected: %s (reason %u)\n",
|
||||
NET_DBG("Disconnected: %s (reason 0x%02x)\n",
|
||||
log_strdup(addr), reason);
|
||||
}
|
||||
|
||||
|
|
|
@ -337,7 +337,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason)
|
|||
|
||||
bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
|
||||
|
||||
printk("Disconnected: %s (reason %u)\n", addr, reason);
|
||||
printk("Disconnected: %s (reason 0x%02x)\n", addr, reason);
|
||||
|
||||
if (default_conn != conn) {
|
||||
return;
|
||||
|
|
|
@ -77,7 +77,7 @@ static const struct bt_data ad[] = {
|
|||
static void connected(struct bt_conn *conn, u8_t err)
|
||||
{
|
||||
if (err) {
|
||||
FAIL("Connection failed (err %u)\n", err);
|
||||
FAIL("Connection failed (err 0x%02x)\n", err);
|
||||
} else {
|
||||
default_conn = bt_conn_ref(conn);
|
||||
printk("Connected\n");
|
||||
|
@ -86,7 +86,7 @@ static void connected(struct bt_conn *conn, u8_t err)
|
|||
|
||||
static void disconnected(struct bt_conn *conn, u8_t reason)
|
||||
{
|
||||
printk("Disconnected (reason %u)\n", reason);
|
||||
printk("Disconnected (reason 0x%02x)\n", reason);
|
||||
|
||||
if (default_conn) {
|
||||
bt_conn_unref(default_conn);
|
||||
|
|
Loading…
Reference in a new issue