bnep: emit channel opened with ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION if connection cannot be set up

This commit is contained in:
Matthias Ringwald 2025-02-05 19:35:46 +01:00
parent 6f4194f035
commit cf25bba7d8
2 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- GAP: store link key for standard/non-SSP pairing
- BENP: emit channel opened with ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION if connection cannot be set up
### Changed
- BTstack HID: remove HID_PROTOCOL_MODE_REPORT_WITH_FALLBACK_TO_BOOT

View File

@ -1352,7 +1352,12 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
switch (channel->state) {
case BNEP_CHANNEL_STATE_WAIT_FOR_CONNECTION_REQUEST:
case BNEP_CHANNEL_STATE_WAIT_FOR_CONNECTION_RESPONSE:
// emit channel open failed
bnep_emit_open_channel_complete(channel, ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION, 0);
bnep_channel_finalize(channel);
return 1;
case BNEP_CHANNEL_STATE_CONNECTED:
// emit channel closed
bnep_channel_finalize(channel);
return 1;
default: