gapi: simulate HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE if HCI Remote Name Request fails

This commit is contained in:
Matthias Ringwald 2025-01-13 18:02:03 +01:00
parent 76d3054583
commit 7bb9c8d8c0
2 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
### Added
- GAP: simulate HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE if HCI Remote Name Request fails
### Fixed
### Changed

View File

@ -3304,6 +3304,21 @@ static void handle_command_status_event(uint8_t * packet, uint16_t size) {
hci_stack->inquiry_state = GAP_INQUIRY_STATE_IDLE;
}
break;
case HCI_OPCODE_HCI_REMOTE_NAME_REQUEST:
if (hci_stack->remote_name_state != GAP_REMOTE_NAME_STATE_IDLE) {
if (status != ERROR_CODE_SUCCESS) {
// remote name request failed, reset status and simulate event
hci_stack->remote_name_state = GAP_REMOTE_NAME_STATE_IDLE;
uint8_t event[3+1+6+248];
memset(event, 0, sizeof(event));
event[0] = HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE;
event[1] = 1 + 6 + 248;
event[2] = status;
reverse_bd_addr(hci_stack->remote_name_addr, &event[3]);
hci_emit_event(event, sizeof(event), 1);
}
}
break;
#endif
#ifdef ENABLE_LE_ISOCHRONOUS_STREAMS
case HCI_OPCODE_HCI_LE_CREATE_CIS: