【NCS】peripheral_hids_mouse例程取消配对PIN码

说明

使用peripheral_hids_mouse例程和DK演示BLE鼠标例程,使用手机或者PC连接会有要求输入pin码,但是justwork是不需要输入PIN码的

更改方式

在代码里面把密钥的回调设置为NULL即可

修改

static struct bt_conn_auth_cb conn_auth_callbacks = {
	.passkey_display = auth_passkey_display,
	.passkey_confirm = auth_passkey_confirm,
	.cancel = auth_cancel,
};

修改为

static struct bt_conn_auth_cb conn_auth_callbacks = {
	.passkey_display = NULL,
	.passkey_confirm = NULL,
	.cancel = auth_cancel,
};
posted @ 2025-08-29 11:33  TedLee  阅读(11)  评论(0)    收藏  举报