gap: use uint16_t for phy_options in gap_le_set_phy, fixes #502

This commit is contained in:
Matthias Ringwald 2023-07-14 09:40:35 +02:00
parent af0ac87149
commit 9d8be771b7
2 changed files with 3 additions and 3 deletions

View File

@ -1038,7 +1038,7 @@ uint8_t gap_auto_connection_stop_all(void);
* @param phy_options 0 = no preferred coding for Coded, 1 = S=2 coding (500 kbit), 2 = S=8 coding (125 kbit)
* @return 0 if ok
*/
uint8_t gap_le_set_phy(hci_con_handle_t con_handle, uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_options);
uint8_t gap_le_set_phy(hci_con_handle_t con_handle, uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys, uint16_t phy_options);
/**
* @brief Get connection interval

View File

@ -8626,14 +8626,14 @@ uint8_t gap_request_role(const bd_addr_t addr, hci_role_t role){
#ifdef ENABLE_BLE
uint8_t gap_le_set_phy(hci_con_handle_t con_handle, uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_options){
uint8_t gap_le_set_phy(hci_con_handle_t con_handle, uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys, uint16_t phy_options){
hci_connection_t * conn = hci_connection_for_handle(con_handle);
if (!conn) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
conn->le_phy_update_all_phys = all_phys;
conn->le_phy_update_tx_phys = tx_phys;
conn->le_phy_update_rx_phys = rx_phys;
conn->le_phy_update_phy_options = phy_options;
conn->le_phy_update_phy_options = (uint8_t) phy_options;
hci_run();