| 
    Zephyr Project API
    3.2.0
    
   A Scalable Open Source RTOS 
   | 
 
Hearing Access Service (HAS) More...
Data Structures | |
| struct | bt_has_preset_record | 
| Preset record definition.  More... | |
| struct | bt_has_client_cb | 
| Hearing Access Service Client callback structure.  More... | |
| struct | bt_has_preset_ops | 
| Preset operations structure.  More... | |
| struct | bt_has_preset_register_param | 
| Register structure for preset.  More... | |
Macros | |
| #define | BT_HAS_PRESET_INDEX_NONE 0x00 | 
| #define | BT_HAS_PRESET_INDEX_FIRST 0x01 | 
| #define | BT_HAS_PRESET_INDEX_LAST 0xFF | 
| #define | BT_HAS_PRESET_NAME_MIN 1 | 
| #define | BT_HAS_PRESET_NAME_MAX 40 | 
Typedefs | |
| typedef uint8_t(* | bt_has_preset_func_t) (uint8_t index, enum bt_has_properties properties, const char *name, void *user_data) | 
| Preset iterator callback.  More... | |
Enumerations | |
| enum | bt_has_hearing_aid_type { BT_HAS_HEARING_AID_TYPE_BINAURAL , BT_HAS_HEARING_AID_TYPE_MONAURAL , BT_HAS_HEARING_AID_TYPE_BANDED } | 
| enum | bt_has_properties { BT_HAS_PROP_NONE = 0 , BT_HAS_PROP_WRITABLE = BIT(0) , BT_HAS_PROP_AVAILABLE = BIT(1) } | 
| enum | bt_has_capabilities { BT_HAS_PRESET_SUPPORT = BIT(0) } | 
| enum | { BT_HAS_PRESET_ITER_STOP = 0 , BT_HAS_PRESET_ITER_CONTINUE } | 
Functions | |
| int | bt_has_client_cb_register (const struct bt_has_client_cb *cb) | 
| Registers the callbacks used by the Hearing Access Service client.  More... | |
| int | bt_has_client_discover (struct bt_conn *conn) | 
| Discover Hearing Access Service on a remote device.  More... | |
| int | bt_has_client_conn_get (const struct bt_has *has, struct bt_conn **conn) | 
| Get the Bluetooth connection object of the service object.  More... | |
| int | bt_has_client_presets_read (struct bt_has *has, uint8_t index, uint8_t max_count) | 
| Read Preset Records.  More... | |
| int | bt_has_client_preset_set (struct bt_has *has, uint8_t index, bool sync) | 
| Set Active Preset.  More... | |
| int | bt_has_client_preset_next (struct bt_has *has, bool sync) | 
| Activate Next Preset.  More... | |
| int | bt_has_client_preset_prev (struct bt_has *has, bool sync) | 
| Activate Previous Preset.  More... | |
| int | bt_has_preset_register (const struct bt_has_preset_register_param *param) | 
| Register preset.  More... | |
| int | bt_has_preset_unregister (uint8_t index) | 
| Unregister Preset.  More... | |
| int | bt_has_preset_available (uint8_t index) | 
| Set the preset as available.  More... | |
| int | bt_has_preset_unavailable (uint8_t index) | 
| Set the preset as unavailable.  More... | |
| void | bt_has_preset_foreach (uint8_t index, bt_has_preset_func_t func, void *user_data) | 
| Preset iterator.  More... | |
| int | bt_has_preset_active_set (uint8_t index) | 
| Set active preset.  More... | |
| uint8_t | bt_has_preset_active_get (void) | 
| Get active preset.  More... | |
| static int | bt_has_preset_active_clear (void) | 
| Clear out active preset.  More... | |
| int | bt_has_preset_name_change (uint8_t index, const char *name) | 
| Change the Preset Name.  More... | |
Hearing Access Service (HAS)
The Hearing Access Service is used to identify a hearing aid and optionally to control hearing aid presets.
[Experimental] Users should note that the APIs can change as a part of ongoing development.
| #define BT_HAS_PRESET_INDEX_FIRST 0x01 | 
#include <include/zephyr/bluetooth/audio/has.h>
| #define BT_HAS_PRESET_INDEX_LAST 0xFF | 
#include <include/zephyr/bluetooth/audio/has.h>
| #define BT_HAS_PRESET_INDEX_NONE 0x00 | 
#include <include/zephyr/bluetooth/audio/has.h>
Preset index definitions
| #define BT_HAS_PRESET_NAME_MAX 40 | 
#include <include/zephyr/bluetooth/audio/has.h>
Preset name maximum length
| #define BT_HAS_PRESET_NAME_MIN 1 | 
#include <include/zephyr/bluetooth/audio/has.h>
Preset name minimum length
| bt_has_preset_func_t | 
#include <include/zephyr/bluetooth/audio/has.h>
Preset iterator callback.
| index | The index of preset found. | 
| properties | Preset properties. | 
| name | Preset name. | 
| user_data | Data given. | 
| anonymous enum | 
#include <include/zephyr/bluetooth/audio/has.h>
| Enumerator | |
|---|---|
| BT_HAS_PRESET_ITER_STOP | |
| BT_HAS_PRESET_ITER_CONTINUE | |
| enum bt_has_capabilities | 
#include <include/zephyr/bluetooth/audio/has.h>
Hearing Aid device capablilities
| Enumerator | |
|---|---|
| BT_HAS_PRESET_SUPPORT | |
#include <include/zephyr/bluetooth/audio/has.h>
Hearing Aid device type
| Enumerator | |
|---|---|
| BT_HAS_HEARING_AID_TYPE_BINAURAL | |
| BT_HAS_HEARING_AID_TYPE_MONAURAL | |
| BT_HAS_HEARING_AID_TYPE_BANDED | |
| enum bt_has_properties | 
#include <include/zephyr/bluetooth/audio/has.h>
Preset Properties values
| Enumerator | |
|---|---|
| BT_HAS_PROP_NONE | No properties set  | 
| BT_HAS_PROP_WRITABLE | Preset name can be written by the client  | 
| BT_HAS_PROP_AVAILABLE | Preset availability  | 
| int bt_has_client_cb_register | ( | const struct bt_has_client_cb * | cb | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Registers the callbacks used by the Hearing Access Service client.
| cb | The callback structure. | 
| int bt_has_client_conn_get | ( | const struct bt_has * | has, | 
| struct bt_conn ** | conn | ||
| ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Get the Bluetooth connection object of the service object.
The caller gets a new reference to the connection object which must be released with bt_conn_unref() once done using the object.
| [in] | has | Pointer to the Hearing Access Service object. | 
| [out] | conn | Connection object. | 
| int bt_has_client_discover | ( | struct bt_conn * | conn | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Discover Hearing Access Service on a remote device.
Client method to find a Hearing Access Service on a server identified by conn. The bt_has_client_cb::discover callback will be called when the discovery procedure is complete to provide user a Hearing Access Service (HAS) object.
| conn | Bluetooth connection object. | 
| int bt_has_client_preset_next | ( | struct bt_has * | has, | 
| bool | sync | ||
| ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Activate Next Preset.
Client procedure to set next available preset as active. The status is returned in the bt_has_client_cb::preset_switch callback.
| has | Pointer to the Hearing Access Service object. | 
| sync | Request active preset synchronization in set. | 
| int bt_has_client_preset_prev | ( | struct bt_has * | has, | 
| bool | sync | ||
| ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Activate Previous Preset.
Client procedure to set previous available preset as active. The status is returned in the bt_has_client_cb::preset_switch callback.
| has | Pointer to the Hearing Access Service object. | 
| sync | Request active preset synchronization in set. | 
#include <include/zephyr/bluetooth/audio/has.h>
Set Active Preset.
Client procedure to set preset identified by index as active. The status is returned in the bt_has_client_cb::preset_switch callback.
| has | Pointer to the Hearing Access Service object. | 
| index | Preset index to activate. | 
| sync | Request active preset synchronization in set. | 
#include <include/zephyr/bluetooth/audio/has.h>
Read Preset Records.
Client method to read up to max_count presets starting from given index. The preset records are returned in the bt_has_client_cb::preset_read_rsp callback (called once for each preset).
| has | Pointer to the Hearing Access Service object. | 
| index | The index to start with. | 
| max_count | Maximum number of presets to read. | 
      
  | 
  inlinestatic | 
#include <include/zephyr/bluetooth/audio/has.h>
Clear out active preset.
Used by server to deactivate currently active preset.
| uint8_t bt_has_preset_active_get | ( | void | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Get active preset.
Function used to get the currently active preset index.
| int bt_has_preset_active_set | ( | uint8_t | index | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Set active preset.
Function used to set the preset identified by the index as the active preset. The preset index will be notified to peer devices.
| index | Preset index. | 
| int bt_has_preset_available | ( | uint8_t | index | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Set the preset as available.
Set the BT_HAS_PROP_AVAILABLE property bit. This will notify preset availability to peer devices. Only available preset can be selected as active preset.
| index | The index of preset that's became available. | 
| void bt_has_preset_foreach | ( | uint8_t | index, | 
| bt_has_preset_func_t | func, | ||
| void * | user_data | ||
| ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Preset iterator.
Iterate presets. Optionally, match non-zero index if given.
| index | Preset index, passing BT_HAS_PRESET_INDEX_NONE skips index matching. | 
| func | Callback function. | 
| user_data | Data to pass to the callback. | 
| int bt_has_preset_name_change | ( | uint8_t | index, | 
| const char * | name | ||
| ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Change the Preset Name.
Change the name of the preset identified by index.
| index | The index of the preset to change the name of. | 
| name | Name to write. | 
| int bt_has_preset_register | ( | const struct bt_has_preset_register_param * | param | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Register preset.
Register preset. The preset will be a added to the list of exposed preset records. This symbol is linkable if  CONFIG_BT_HAS_PRESET_COUNT   is non-zero.
| param | Preset registration parameter. | 
| int bt_has_preset_unavailable | ( | uint8_t | index | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Set the preset as unavailable.
Clear the BT_HAS_PROP_AVAILABLE property bit. This will notify preset availability to peer devices. Unavailable preset cannot be selected as active preset.
| index | The index of preset that's became unavailable. | 
| int bt_has_preset_unregister | ( | uint8_t | index | ) | 
#include <include/zephyr/bluetooth/audio/has.h>
Unregister Preset.
Unregister preset. The preset will be removed from the list of preset records.
| index | The index of preset that's being requested to unregister. |