hci: fix bug in gap_inquiry_stop that triggered additional GAP_EVENT_INQUIRY_COMPLETE instead of stopping the inquiry

This commit is contained in:
Matthias Ringwald 2018-10-10 17:32:35 +02:00
parent d32b5a2f58
commit 2c12328286
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- SDP Server: queue incoming connections when already connected instead of rejecting them
### Fixed
- HCI: fix bug in gap_inquiry_stop that triggered additional GAP_EVENT_INQUIRY_COMPLETE instead of stopping the inquiry
- L2CAP: fix issue with outgoing connection before read remote supported complete when other channels exist
- L2CAP ERTM: allow SDU of szie MPS in first packet that contains L2CAP SDU Length
- L2CAP ERTM: fix memory corruption triggered if local_mtu > mps

View File

@ -4599,7 +4599,7 @@ int gap_inquiry_start(uint8_t duration_in_1280ms_units){
* @returns 0 if ok
*/
int gap_inquiry_stop(void){
if (hci_stack->inquiry_state >= GAP_INQUIRY_DURATION_MIN || hci_stack->inquiry_state <= GAP_INQUIRY_DURATION_MAX) {
if (hci_stack->inquiry_state >= GAP_INQUIRY_DURATION_MIN && hci_stack->inquiry_state <= GAP_INQUIRY_DURATION_MAX) {
// emit inquiry complete event, before it even started
uint8_t event[] = { GAP_EVENT_INQUIRY_COMPLETE, 1, 0};
hci_emit_event(event, sizeof(event), 1);