gap: only set link supervision timeout if we're master

This commit is contained in:
Matthias Ringwald 2019-11-15 14:09:37 +01:00
parent 6909f06401
commit e6c51921b0
2 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ void gap_set_class_of_device(uint32_t class_of_device);
void gap_set_default_link_policy_settings(uint16_t default_link_policy_settings);
/**
* @brief Set link supervision timeout for new classic ACL links
* @brief Set link supervision timeout for outgoing classic ACL links
* @param default_link_supervision_timeout * 0.625 ms, default 0x7d00 = 20 seconds
*/
void gap_set_link_supervision_timeout(uint16_t link_supervision_timeout);

View File

@ -2159,8 +2159,8 @@ static void event_handler(uint8_t *packet, int size){
// queue get remote feature
conn->bonding_flags |= BONDING_REQUEST_REMOTE_FEATURES;
// queue set supervision timeout
if (hci_stack->link_supervision_timeout != 0){
// queue set supervision timeout if we're master
if ((hci_stack->link_supervision_timeout != 0) && conn->role == HCI_ROLE_MASTER){
connectionSetAuthenticationFlags(conn, WRITE_SUPERVISION_TIMEOUT);
}