Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: has: Ensure that notifications are sent #61980

Merged
merged 14 commits into from
Oct 20, 2023

Commits on Oct 17, 2023

  1. Bluetooth: audio: has: Fix checking wrong flag

    This fixes testing and clearing features flag.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    81d5dad View commit details
    Browse the repository at this point in the history
  2. Bluetooth: audio: has: Fix indentation

    This fixes code indentation.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    52950ea View commit details
    Browse the repository at this point in the history
  3. Bluetooth: audio: has: Don't revert features value on error

    This removes revering the features value back to previous state if work
    submission failes. Even if it fails it indicates an internal sysworkq
    issue, so even retry won't help. The client can read the features value
    anyway, thus it's sane to just log an error in such case.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    b515f12 View commit details
    Browse the repository at this point in the history
  4. Bluetooth: audio: has: Fix sending notifications on reconnect

    This fixes missing setting of FLAG_CONTROL_POINT_NOTIFY flag that
    indicate whether submit control_point_work. In case the there are more
    indications/notifications to sent (is_last flag is unset), the
    FLAG_CONTROL_POINT_NOTIFY shall be set to resubmit control_point_work.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    a5c9e9b View commit details
    Browse the repository at this point in the history
  5. Bluetooth: audio: has: Factor out set_preset_availability function

    This moves common code to set_preset_availability function to be called
    from bt_has_preset_available and bt_has_preset_unavailable.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    68cd2db View commit details
    Browse the repository at this point in the history
  6. tests: Bluetooth: has: Add test Preset Changed Offline Behavior

    Verify that a HAS Server IUT sends changed characteristic notifications
    or indications when the Lower Tester reconnects.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    a3e4cca View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. Bluetooth: audio: has: Defer notifications to sysworkq

    Defer sending the features, active index, preset list and preset read
    response to sysworkq and retry sending in case failed due to buffers not
    available at the moment.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    76fe66c View commit details
    Browse the repository at this point in the history
  2. Bluetooth: audio: has: Refactor preset list to single-linked list

    This refactors the preset list to use sys_slist API. There have been
    various issues seen while iterating presets, thus it's more save to use
    well-defined and tested sys_slist API.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    9c41221 View commit details
    Browse the repository at this point in the history
  3. Bluetooth: has: Factor out bonded client persistent data

    Some of the data shall be persistent across connections to bonded
    clients. This includes notidication state flags that are used to
    determine whether notify bonded client after reconnection.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    82dea82 View commit details
    Browse the repository at this point in the history
  4. Bluetooth: has: Fix preset list notifications after reconnection

    This fixes sending proper Preset List notifications after
    reconnection. The issue was observed when the last preset
    known to the client has been removed.
    As we do not hold the information about the deleted presets,
    we need to use Generic Update procedure to:
     1. Notify the presets that have been removed in range
        (PrevIndex = current_preset_last, Index=previous_preset_last)
     2. Notify deletion of preset Index=previous_preset_last.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    00c6dd4 View commit details
    Browse the repository at this point in the history
  5. Bluetooth: audio: has: Fix missing memset of parameters

    This fixes missing memset of parameters used for indications and/or
    notifications.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    5c932a7 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2023

  1. Bluetooth: audio: has: Truncate Control Point notifications to ATT MTU

    This will truncate ATT notifications/indications if exceed ATT MTU size.
    It is up to the client to exchange MTU.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    e6a55ea View commit details
    Browse the repository at this point in the history
  2. Bluetooth: audio: has: Remove include of conn_internal header

    This makes use of bt_conn_get_info function to access the conn address.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    71574e8 View commit details
    Browse the repository at this point in the history
  3. Bluetooth: audio: has: Minor logging improvement

    This adds more logs for debugging purposes.
    
    Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
    MariuszSkamra committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    46f74aa View commit details
    Browse the repository at this point in the history