Bluetooth: Add SMP Pairing Confirm skeleton
Change-Id: I484e24f111212acf3e920b4eed56d69e6b94493d Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
b7dddcff00
commit
0aadf6ce69
2 changed files with 22 additions and 0 deletions
|
@ -106,6 +106,20 @@ static int smp_pairing_req(struct bt_conn *conn, struct bt_buf *buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int smp_pairing_confirm(struct bt_conn *conn, struct bt_buf *buf)
|
||||
{
|
||||
struct bt_smp_pairing_confirm *req = (void *)buf->data;
|
||||
|
||||
BT_DBG("\n");
|
||||
|
||||
if (buf->len != sizeof(*req))
|
||||
return BT_SMP_ERR_INVALID_PARAMS;
|
||||
|
||||
/* TODO: Send pairing_confirm(Sconfirm) back */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bt_smp_recv(struct bt_conn *conn, struct bt_buf *buf)
|
||||
{
|
||||
struct bt_smp_hdr *hdr = (void *)buf->data;
|
||||
|
@ -124,6 +138,9 @@ void bt_smp_recv(struct bt_conn *conn, struct bt_buf *buf)
|
|||
case BT_SMP_CMD_PAIRING_REQ:
|
||||
err = smp_pairing_req(conn, buf);
|
||||
break;
|
||||
case BT_SMP_CMD_PAIRING_CONFIRM:
|
||||
err = smp_pairing_confirm(conn, buf);
|
||||
break;
|
||||
default:
|
||||
BT_DBG("Unhandled SMP code %u\n", hdr->code);
|
||||
err = BT_SMP_ERR_CMD_NOTSUPP;
|
||||
|
|
|
@ -75,6 +75,11 @@ struct bt_smp_pairing {
|
|||
uint8_t resp_key_dist;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#define BT_SMP_CMD_PAIRING_CONFIRM 0x03
|
||||
struct bt_smp_pairing_confirm {
|
||||
uint8_t val[16];
|
||||
} PACK_STRUCT;
|
||||
|
||||
#define BT_SMP_CMD_PAIRING_FAIL 0x05
|
||||
struct bt_smp_pairing_fail {
|
||||
uint8_t reason;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue