Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE: NRF52 returns used tx/rx phy on phy update callback #9220

Merged
merged 1 commit into from
Jan 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ peer_address_type_t convert_identity_address(advertising_peer_address_type_t add
}
}

ble::phy_t convert_phy(uint8_t nordic_phy)
{
switch(nordic_phy) {
case BLE_GAP_PHY_1MBPS:
return ble::phy_t::LE_1M;

case BLE_GAP_PHY_2MBPS:
return ble::phy_t::LE_2M;

case BLE_GAP_PHY_CODED:
return ble::phy_t::LE_CODED;

default:
return ble::phy_t::NONE;
}
}

// FIXME: update when SD 5 (not alpha!) or more is used for 52840.
#ifndef BLE_GAP_PHY_AUTO
#define BLE_GAP_PHY_AUTO 0
Expand Down Expand Up @@ -1630,8 +1647,8 @@ void nRF5xGap::on_phy_update(
_eventHandler->onPhyUpdateComplete(
status,
connection,
Phy_t::LE_1M,
Phy_t::LE_1M
convert_phy(evt.tx_phy),
convert_phy(evt.rx_phy)
);
}

Expand Down