File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ func handleEvent() {
111111 case C .BLE_GAP_EVT_DATA_LENGTH_UPDATE :
112112 // ignore confirmation of data length successfully updated
113113 case C .BLE_GAP_EVT_PHY_UPDATE_REQUEST :
114- phyUpdateRequest := gapEvent . params . unionfield_phy_update_request ()
115- C .sd_ble_gap_phy_update (gapEvent .conn_handle , & phyUpdateRequest . peer_preferred_phys )
114+ // Tell the Bluetooth stack to update the PHY as it sees fit.
115+ C .sd_ble_gap_phy_update (gapEvent .conn_handle , & phyUpdateResponse )
116116 case C .BLE_GAP_EVT_PHY_UPDATE :
117117 // ignore confirmation of phy successfully updated
118118 case C .BLE_GAP_EVT_TIMEOUT :
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ func handleEvent() {
6060 case C .BLE_GAP_EVT_DATA_LENGTH_UPDATE :
6161 // ignore confirmation of data length successfully updated
6262 case C .BLE_GAP_EVT_PHY_UPDATE_REQUEST :
63- phyUpdateRequest := gapEvent . params . unionfield_phy_update_request ()
64- C .sd_ble_gap_phy_update (gapEvent .conn_handle , & phyUpdateRequest . peer_preferred_phys )
63+ // Tell the Bluetooth stack to update the PHY as it sees fit.
64+ C .sd_ble_gap_phy_update (gapEvent .conn_handle , & phyUpdateResponse )
6565 case C .BLE_GAP_EVT_PHY_UPDATE :
6666 // ignore confirmation of phy successfully updated
6767 default :
Original file line number Diff line number Diff line change @@ -67,3 +67,9 @@ func makeMACAddress(addr C.ble_gap_addr_t) MACAddress {
6767 isRandom : addr .bitfield_addr_type () != 0 ,
6868 }
6969}
70+
71+ // Always let the BLE stack pick the right PHY.
72+ var phyUpdateResponse = C.ble_gap_phys_t {
73+ tx_phys : C .BLE_GAP_PHY_AUTO ,
74+ rx_phys : C .BLE_GAP_PHY_AUTO ,
75+ }
You can’t perform that action at this time.
0 commit comments