mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ble_mesh: Use the right net_idx & app_idx for publish
This commit is contained in:
parent
940e87c0da
commit
b29bc240a7
@ -396,13 +396,17 @@ static int publish_retransmit(struct bt_mesh_model *mod)
|
||||
};
|
||||
int err = 0;
|
||||
|
||||
key = bt_mesh_app_key_find(pub->key);
|
||||
key = bt_mesh_tx_appkey_get(pub->dev_role, pub->key);
|
||||
if (!key) {
|
||||
BT_ERR("%s, Failed to find AppKey", __func__);
|
||||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
|
||||
tx.sub = bt_mesh_subnet_get(key->net_idx);
|
||||
tx.sub = bt_mesh_tx_netkey_get(pub->dev_role, key->net_idx);
|
||||
if (!tx.sub) {
|
||||
BT_ERR("%s, Failed to get subnet", __func__);
|
||||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
|
||||
ctx.net_idx = key->net_idx;
|
||||
ctx.app_idx = key->app_idx;
|
||||
|
Loading…
Reference in New Issue
Block a user