wiced_bt_ble_set_phy() only starts negotiation between the host and the peer device. The "remote_bd_addr" field is used to specify the link you are going to configure. Each of the device (Central / Peripheral) can call this function to explicitly change PHY between them.
And 1M / 2M PHY is something related to the link configuration which is maintained and held between the two devices, so we can't "set central / peripheral device LE link" on the specific one. The most related function to this is wiced_bt_ble_set_default_phy(), which is used for "host to configure default transmitter phy and receiver phy to be used for all subsequent connections over the LE transport."
Therefore, please note that, you can only set default PHY on a specific device beforehand or negotiate the preferred PHY between the two peers in current connection.
There are three functions related to 2M PHY:
- wiced_bt_dev_status_t wiced_bt_ble_set_default_phy ( wiced_bt_ble_phy_preferences_t * phy_preferences )
- wiced_bt_dev_status_t wiced_bt_ble_set_phy ( wiced_bt_ble_phy_preferences_t * phy_preferences )
- wiced_bt_dev_status_t wiced_bt_ble_read_phy ( wiced_bt_device_address_t remote_bd_addr, wiced_bt_ble_read_phy_complete_callback_t * p_read_phy_complete_callback )
They are used together to provide the whole control of PHY. They together will help you get the hang of PHY.
Please refer to the link below, to get detailed information:
Sincere regards from C. L.