Link Loss Service Client API
#include "src/ble/gatt-service/link_loss_service_client.h"
link_loss_service_client_init
void link_loss_service_client_init(void);
Initialize Link Loss Service.
link_loss_service_client_connect
uint8_t link_loss_service_client_connect(
hci_con_handle_t con_handle,
btstack_packet_handler_t packet_handler,
lls_client_connection_t * llc_connection,
gatt_service_client_characteristic_t * llc_characteristics_storage, uint8_t llc_characteristics_num,
uint16_t * lls_cid
);
Connect to a Link Loss Service instance of remote device. The client will automatically register for notifications. The mute state is received via GATTSERVICE_SUBEVENT_LLS_CLIENT_MUTE event. The mute state can be 0 - off, 1 - on, 2 - disabeled and it is valid if the ATT status is equal to ATT_ERROR_SUCCESS, see ATT errors (see bluetooth.h) for other values.
Event GATTSERVICE_SUBEVENT_LLS_CLIENT_CONNECTED is emitted with status ERROR_CODE_SUCCESS on success, otherwise GATT_CLIENT_IN_WRONG_STATE, ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE if no audio input control service is found, or ATT errors (see bluetooth.h).
Parameters
- con_handle
- packet_handler
- llc_connection
- llc_characteristics_storage: storage for characteristics
- llc_characteristics_num: == LINK_LOSS_SERVICE_CLIENT_NUM_CHARACTERISTICS
Returns
- uint8_t: status ERROR_CODE_SUCCESS on success, otherwise ERROR_CODE_COMMAND_DISALLOWED if there is already a client associated with con_handle, or BTSTACK_MEMORY_ALLOC_FAILED
link_loss_service_client_read_alert_level
uint8_t link_loss_service_client_read_alert_level(uint16_t lls_cid);
Returns
- uint8_t
link_loss_service_client_write_alert_level
uint8_t link_loss_service_client_write_alert_level(uint16_t lls_cid, lls_alert_level_t alert_level);
Returns
- uint8_t
link_loss_service_client_disconnect
uint8_t link_loss_service_client_disconnect(uint16_t lls_cid);
Disconnect.
Parameters
- lls_cid
Returns
- uint8_t: status
link_loss_service_client_deinit
void link_loss_service_client_deinit(void);
De-initialize Link Loss Service.