HHH555J 除了这个改动还改了nordic的一些配网代码,强制取消其他oob认证模式,不知道有没有大佬知道还可以在哪里设置,这个函数中注释的就是我修改的,都改成0,这样就没有其他认证模式给配网者选了?
`static void prov_invite(const uint8_t *data)
{
printk("prov_invite\n");
PROV_BUF(buf, PDU_LEN_CAPABILITIES);
LOG_DBG("Attention Duration: %u seconds", data[0]);
if (data[0]) {
bt_mesh_attention(NULL, data[0]);
}
memcpy(bt_mesh_prov_link.conf_inputs.invite, data, PDU_LEN_INVITE);
bt_mesh_prov_buf_init(&buf, PROV_CAPABILITIES);
/* Number of Elements supported */
net_buf_simple_add_u8(&buf, bt_mesh_elem_count());
uint16_t algorithm_bm = 0;
uint8_t oob_type = bt_mesh_prov->static_val ?
BT_MESH_STATIC_OOB_AVAILABLE : 0;
// uint8_t oob_type = 0;
bool oob_availability = bt_mesh_prov->output_size > 0 ||
bt_mesh_prov->input_size > 0 || bt_mesh_prov->static_val;
// bool oob_availability = 0;
if (IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM)) {
WRITE_BIT(algorithm_bm, BT_MESH_PROV_AUTH_HMAC_SHA256_AES_CCM, 1);
}
if (IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_CMAC_AES128_AES_CCM)) {
WRITE_BIT(algorithm_bm, BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM, 1);
}
if (oob_availability && IS_ENABLED(CONFIG_BT_MESH_OOB_AUTH_REQUIRED)) {
oob_type |= BT_MESH_OOB_AUTH_REQUIRED;
WRITE_BIT(algorithm_bm, BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM, 0);
}
/* Supported algorithms */
net_buf_simple_add_be16(&buf, algorithm_bm);
/* Public Key Type */
net_buf_simple_add_u8(&buf,
bt_mesh_prov->public_key_be == NULL ? PUB_KEY_NO_OOB : PUB_KEY_OOB);
// net_buf_simple_add_u8(&buf,
// PUB_KEY_NO_OOB);
/* Static OOB Type */
net_buf_simple_add_u8(&buf, oob_type);
// net_buf_simple_add_u8(&buf, 0);
/* Output OOB Size */
net_buf_simple_add_u8(&buf, bt_mesh_prov->output_size);
// net_buf_simple_add_u8(&buf, 0);
/* Output OOB Action */
net_buf_simple_add_be16(&buf, bt_mesh_prov->output_actions);
// net_buf_simple_add_be16(&buf, 0);
/* Input OOB Size */
net_buf_simple_add_u8(&buf, bt_mesh_prov->input_size);
// net_buf_simple_add_u8(&buf, 0);
/* Input OOB Action */
net_buf_simple_add_be16(&buf, bt_mesh_prov->input_actions);
// net_buf_simple_add_be16(&buf, 0);
memcpy(bt_mesh_prov_link.conf_inputs.capabilities, &buf.data[1], PDU_LEN_CAPABILITIES);
// bt_mesh_prov_link.oob_method = AUTH_METHOD_NO_OOB;
if (bt_mesh_prov_send(&buf, NULL)) {
LOG_ERR("Failed to send capabilities");
return;
}
bt_mesh_prov_link.expect = PROV_START;
}`