sl_bt_api.h

1 /***************************************************************************/
17 #ifndef SL_BT_API_H
18 #define SL_BT_API_H
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include <string.h>
25 #include "sl_bt_types.h"
26 #include "sl_status.h"
27 
28 
29 
30 #if defined(__IAR_SYSTEMS_ICC__)
31  #define SL_BT_DEPRECATED_API #pragma deprecated
32 #elif defined(__GNUC__)
33  #define SL_BT_DEPRECATED_API __attribute__((deprecated))
34 #else
35  #define SL_BT_DEPRECATED_API
36 #endif
37 
38 #define SL_BT_MSG_ID(HDR) ((HDR)&0xffff00f8)
39 #define SL_BT_MSG_HEADER_LEN (4)
40 #define SL_BT_MSG_LEN(HDR) ((((HDR)&0x7)<<8)|(((HDR)&0xff00)>>8))
41 #define SL_BT_BIT_ENCRYPTED (1 << 6) // Bit indicating whether the packet is encrypted
42 #define SL_BT_MSG_ENCRYPTED(HDR) ((HDR) & SL_BT_BIT_ENCRYPTED)
43 
47 typedef void (*sl_bt_handler)(const void*);
48 
54 void sli_bt_set_cmd_handler_delegate(void (*cmd_handler_delegate)(uint32_t,
55  sl_bt_handler,
56  const void*));
57 
58 
sl_status_t sl_bt_gatt_server_disable_capabilities(uint32_t caps)
void * sli_bt_get_command_response()
void sl_bt_priority_handle(void)
sl_status_t sl_bt_gatt_write_characteristic_value_without_response(uint8_t connection, uint16_t characteristic, size_t value_len, const uint8_t *value, uint16_t *sent_len)
sl_status_t sl_bt_coex_set_parameters(uint8_t priority, uint8_t request, uint8_t pwm_period, uint8_t pwm_dutycycle)
uint32_t sl_bt_event_pending_len()
sl_status_t sl_bt_cte_receiver_disable_silabs_cte()
sl_status_t sl_bt_gatt_write_descriptor_value(uint8_t connection, uint16_t descriptor, size_t value_len, const uint8_t *value)
sl_status_t sl_bt_cte_receiver_disable_connection_cte(uint8_t connection)
sl_status_t sl_bt_advertiser_create_set(uint8_t *handle)
sl_status_t sl_bt_system_data_buffer_clear()
sl_status_t sl_bt_sm_configure(uint8_t flags, uint8_t io_capabilities)
sl_status_t sl_bt_dfu_flash_upload(size_t data_len, const uint8_t *data)
sl_status_t sl_bt_cte_receiver_disable_connectionless_cte(uint16_t sync)
sl_status_t sl_bt_gatt_read_characteristic_value(uint8_t connection, uint16_t characteristic)
sl_status_t sl_bt_gatt_discover_primary_services_by_uuid(uint8_t connection, size_t uuid_len, const uint8_t *uuid)
sl_status_t sl_bt_gatt_server_write_attribute_value(uint16_t attribute, uint16_t offset, size_t value_len, const uint8_t *value)
sl_status_t sl_bt_sync_open(bd_addr address, uint8_t address_type, uint8_t adv_sid, uint16_t *sync)
sl_status_t sl_bt_advertiser_clear_random_address(uint8_t handle)
sl_status_t sl_bt_advertiser_set_phy(uint8_t handle, uint8_t primary_phy, uint8_t secondary_phy)
sl_status_t sl_bt_gatt_set_max_mtu(uint16_t max_mtu, uint16_t *max_mtu_out)
sl_status_t sl_bt_connection_open(bd_addr address, uint8_t address_type, uint8_t initiating_phy, uint8_t *connection)
sl_status_t sl_bt_cte_receiver_enable_connection_cte(uint8_t connection, uint16_t interval, uint8_t cte_length, uint8_t cte_type, uint8_t slot_durations, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_sm_passkey_confirm(uint8_t connection, uint8_t confirm)
sl_status_t sl_bt_gap_set_data_channel_classification(size_t channel_map_len, const uint8_t *channel_map)
sl_status_t sl_bt_coex_set_options(uint32_t mask, uint32_t options)
sl_status_t sl_bt_advertiser_set_report_scan_request(uint8_t handle, uint8_t report_scan_req)
sl_status_t sl_bt_sync_set_parameters(uint16_t skip, uint16_t timeout, uint32_t flags)
sl_status_t sl_bt_gatt_send_characteristic_confirmation(uint8_t connection)
sl_status_t sl_bt_sm_set_minimum_key_size(uint8_t minimum_key_size)
sl_status_t sl_bt_gatt_server_find_attribute(uint16_t start, size_t type_len, const uint8_t *type, uint16_t *attribute)
sl_status_t sl_bt_ota_set_rf_path(uint8_t enable, uint8_t antenna)
sl_status_t sl_bt_advertiser_set_configuration(uint8_t handle, uint32_t configurations)
sl_status_t sl_bt_wait_event(sl_bt_msg_t *event)
sl_status_t sl_bt_nvm_erase_all()
sl_status_t sl_bt_gatt_discover_descriptors(uint8_t connection, uint16_t characteristic)
sl_status_t sl_bt_sm_set_passkey(int32_t passkey)
sl_status_t sl_bt_gatt_server_read_attribute_type(uint16_t attribute, size_t max_type_size, size_t *type_len, uint8_t *type)
sl_status_t sl_bt_sm_bonding_confirm(uint8_t connection, uint8_t confirm)
sl_status_t sl_bt_cte_transmitter_disable_connectionless_cte(uint8_t handle)
sl_status_t sl_bt_sm_add_to_whitelist(bd_addr address, uint8_t address_type)
sl_status_t sl_bt_gatt_server_send_user_read_response(uint8_t connection, uint16_t characteristic, uint8_t att_errorcode, size_t value_len, const uint8_t *value, uint16_t *sent_len)
sl_status_t sl_bt_connection_disable_slave_latency(uint8_t connection, uint8_t disable)
sl_status_t sl_bt_sm_set_bondable_mode(uint8_t bondable)
sl_status_t sl_bt_test_dtm_tx(uint8_t packet_type, uint8_t length, uint8_t channel, uint8_t phy)
sl_status_t sl_bt_cte_transmitter_set_dtm_parameters(uint8_t cte_length, uint8_t cte_type, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_sm_enter_passkey(uint8_t connection, int32_t passkey)
static sl_bt_msg_t * sl_bt_get_command_response()
Definition: sl_bt_api.h:4021
sl_status_t sl_bt_sm_use_sc_oob(uint8_t enable, size_t max_oob_data_size, size_t *oob_data_len, uint8_t *oob_data)
sl_status_t sl_bt_coex_get_counters(uint8_t reset, size_t max_counters_size, size_t *counters_len, uint8_t *counters)
sl_status_t sl_bt_advertiser_delete_set(uint8_t handle)
void sl_bt_dfu_reset(uint8_t dfu)
sl_status_t sl_bt_advertiser_set_long_data(uint8_t handle, uint8_t packet_type)
sl_status_t sl_bt_cte_receiver_set_sync_cte_type(uint8_t sync_cte_type)
sl_status_t sl_bt_gatt_read_multiple_characteristic_values(uint8_t connection, size_t characteristic_list_len, const uint8_t *characteristic_list)
sl_status_t sl_bt_gatt_prepare_characteristic_value_reliable_write(uint8_t connection, uint16_t characteristic, uint16_t offset, size_t value_len, const uint8_t *value, uint16_t *sent_len)
sl_status_t sl_bt_gatt_discover_primary_services(uint8_t connection)
sl_status_t sl_bt_sm_increase_security(uint8_t connection)
sl_status_t sl_bt_nvm_load(uint16_t key, size_t max_value_size, size_t *value_len, uint8_t *value)
sl_status_t sl_bt_cte_receiver_clear_dtm_parameters()
void sl_bt_send_system_awake()
sl_status_t sl_bt_gatt_server_send_characteristic_notification(uint8_t connection, uint16_t characteristic, size_t value_len, const uint8_t *value, uint16_t *sent_len)
sl_status_t sl_bt_test_dtm_end()
sl_status_t sl_bt_gatt_find_included_services(uint8_t connection, uint32_t service)
sl_status_t sl_bt_gatt_set_characteristic_notification(uint8_t connection, uint16_t characteristic, uint8_t flags)
void sl_bt_send_system_error(uint16_t reason, uint8_t data_len, const uint8_t *data)
sl_status_t sl_bt_connection_read_channel_map(uint8_t connection, size_t max_channel_map_size, size_t *channel_map_len, uint8_t *channel_map)
sl_status_t sl_bt_gatt_server_get_enabled_capabilities(uint32_t *caps)
sl_status_t sl_bt_advertiser_stop_periodic_advertising(uint8_t handle)
sl_status_t sl_bt_system_set_lazy_soft_timer(uint32_t time, uint32_t slack, uint8_t handle, uint8_t single_shot)
sl_status_t sl_bt_system_hello()
sl_status_t sl_bt_advertiser_set_tx_power(uint8_t handle, int16_t power, int16_t *set_power)
Bluetooth address.
Definition: sl_bt_types.h:56
sl_status_t sl_bt_advertiser_set_data(uint8_t handle, uint8_t packet_type, size_t adv_data_len, const uint8_t *adv_data)
sl_status_t sl_bt_dfu_flash_set_address(uint32_t address)
sl_status_t sl_bt_system_halt(uint8_t halt)
sl_status_t sl_bt_cte_receiver_enable_silabs_cte(uint8_t slot_durations, uint8_t cte_count, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_gatt_server_enable_capabilities(uint32_t caps)
sl_status_t sl_bt_nvm_erase(uint16_t key)
sl_status_t sl_bt_gatt_prepare_characteristic_value_write(uint8_t connection, uint16_t characteristic, uint16_t offset, size_t value_len, const uint8_t *value, uint16_t *sent_len)
sl_status_t sl_bt_sm_delete_bonding(uint8_t bonding)
sl_status_t sl_bt_advertiser_stop(uint8_t handle)
sl_status_t sl_bt_gatt_write_characteristic_value(uint8_t connection, uint16_t characteristic, size_t value_len, const uint8_t *value)
sl_status_t sl_bt_cte_transmitter_clear_dtm_parameters()
sl_status_t sl_bt_user_message_to_target(size_t data_len, const uint8_t *data, size_t max_response_size, size_t *response_len, uint8_t *response)
sl_status_t sl_bt_cte_transmitter_enable_connectionless_cte(uint8_t handle, uint8_t cte_length, uint8_t cte_type, uint8_t cte_count, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_scanner_start(uint8_t scanning_phy, uint8_t discover_mode)
sl_status_t sl_bt_cte_receiver_set_dtm_parameters(uint8_t cte_length, uint8_t cte_type, uint8_t slot_durations, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_sm_set_oob_data(size_t oob_data_len, const uint8_t *oob_data)
sl_status_t sl_bt_advertiser_clear_configuration(uint8_t handle, uint32_t configurations)
sl_status_t sl_bt_gatt_read_characteristic_value_from_offset(uint8_t connection, uint16_t characteristic, uint16_t offset, uint16_t maxlen)
sl_status_t sl_bt_dfu_flash_upload_finish()
sl_status_t sl_bt_connection_set_default_preferred_phy(uint8_t preferred_phy, uint8_t accepted_phy)
sl_status_t sl_bt_system_get_random_data(uint8_t length, size_t max_data_size, size_t *data_len, uint8_t *data)
sl_status_t sl_bt_connection_set_parameters(uint8_t connection, uint16_t min_interval, uint16_t max_interval, uint16_t latency, uint16_t timeout, uint16_t min_ce_length, uint16_t max_ce_length)
sl_status_t sl_bt_nvm_save(uint16_t key, size_t value_len, const uint8_t *value)
sl_status_t sl_bt_advertiser_set_channel_map(uint8_t handle, uint8_t channel_map)
sl_status_t sl_bt_gatt_server_set_max_mtu(uint16_t max_mtu, uint16_t *max_mtu_out)
sl_status_t sl_bt_cte_transmitter_enable_connection_cte(uint8_t connection, uint8_t cte_types, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_pop_event(sl_bt_msg_t *event)
bool sl_bt_event_pending(void)
sl_status_t sl_bt_sync_close(uint16_t sync)
sl_status_t sl_bt_gatt_server_get_mtu(uint8_t connection, uint16_t *mtu)
sl_status_t sl_bt_gatt_discover_characteristics(uint8_t connection, uint32_t service)
sl_status_t sl_bt_cte_receiver_enable_connectionless_cte(uint16_t sync, uint8_t slot_durations, uint8_t cte_count, size_t switching_pattern_len, const uint8_t *switching_pattern)
void sl_bt_handle_command(uint32_t hdr, void *data)
sl_status_t sl_bt_sm_set_debug_mode()
sl_status_t sl_bt_connection_set_default_parameters(uint16_t min_interval, uint16_t max_interval, uint16_t latency, uint16_t timeout, uint16_t min_ce_length, uint16_t max_ce_length)
sl_status_t sl_bt_gap_set_privacy_mode(uint8_t privacy, uint8_t interval)
sl_status_t sl_bt_advertiser_set_random_address(uint8_t handle, uint8_t addr_type, bd_addr address, bd_addr *address_out)
void sl_bt_send_rsp_user_message_to_target(uint16_t result, uint8_t data_len, uint8_t *data)
sl_status_t sl_bt_cte_transmitter_disable_silabs_cte(uint8_t handle)
uint8_t sl_bt_is_sensitive_message(uint32_t message_id)
sl_status_t sl_bt_scanner_set_timing(uint8_t phys, uint16_t scan_interval, uint16_t scan_window)
sl_status_t sl_bt_scanner_set_mode(uint8_t phys, uint8_t scan_mode)
void sl_bt_send_evt_user_message_to_host(uint8_t data_len, uint8_t *data)
sl_status_t sl_bt_gatt_read_characteristic_value_by_uuid(uint8_t connection, uint32_t service, size_t uuid_len, const uint8_t *uuid)
sl_status_t sl_bt_gatt_read_descriptor_value(uint8_t connection, uint16_t descriptor)
sl_status_t sl_bt_advertiser_start_periodic_advertising(uint8_t handle, uint16_t interval_min, uint16_t interval_max, uint32_t flags)
sl_status_t sl_bt_system_set_max_tx_power(int16_t power, int16_t *set_power)
sl_status_t sl_bt_scanner_stop()
sl_status_t sl_bt_sm_delete_bondings()
void sl_bt_external_signal(uint32_t signals)
sl_status_t sl_bt_cte_transmitter_disable_connection_cte(uint8_t connection)
sl_status_t sl_bt_ota_set_device_name(size_t name_len, const uint8_t *name)
void sl_bt_system_reset(uint8_t dfu)
sl_status_t sl_bt_sm_set_sc_remote_oob_data(size_t oob_data_len, const uint8_t *oob_data)
sl_status_t sl_bt_gap_enable_whitelisting(uint8_t enable)
sl_status_t sl_bt_advertiser_start(uint8_t handle, uint8_t discover, uint8_t connect)
sl_status_t sl_bt_gatt_server_set_capabilities(uint32_t caps, uint32_t reserved)
sl_status_t sl_bt_system_data_buffer_write(size_t data_len, const uint8_t *data)
sl_status_t sl_bt_ota_set_configuration(uint32_t flags)
sl_status_t sl_bt_gatt_discover_characteristics_by_uuid(uint8_t connection, uint32_t service, size_t uuid_len, const uint8_t *uuid)
sl_status_t sl_bt_gatt_server_read_attribute_value(uint16_t attribute, uint16_t offset, size_t max_value_size, size_t *value_len, uint8_t *value)
sl_status_t sl_bt_system_set_identity_address(bd_addr address, uint8_t type)
sl_status_t sl_bt_system_linklayer_configure(uint8_t key, size_t data_len, const uint8_t *data)
sl_status_t sl_bt_cte_transmitter_enable_silabs_cte(uint8_t handle, uint8_t cte_length, uint8_t cte_type, uint8_t cte_count, size_t switching_pattern_len, const uint8_t *switching_pattern)
sl_status_t sl_bt_gatt_server_send_user_write_response(uint8_t connection, uint16_t characteristic, uint8_t att_errorcode)
sl_status_t sl_bt_coex_set_directional_priority_pulse(uint8_t pulse)
sl_status_t sl_bt_system_get_counters(uint8_t reset, uint16_t *tx_packets, uint16_t *rx_packets, uint16_t *crc_errors, uint16_t *failures)
Definition: sl_bt_types.h:2743
sl_status_t sl_bt_system_get_identity_address(bd_addr *address, uint8_t *type)
sl_status_t sl_bt_ota_set_advertising_data(uint8_t packet_type, size_t adv_data_len, const uint8_t *adv_data)
sl_status_t sl_bt_system_set_soft_timer(uint32_t time, uint8_t handle, uint8_t single_shot)
sl_status_t sl_bt_connection_get_rssi(uint8_t connection)
sl_status_t sl_bt_sm_store_bonding_configuration(uint8_t max_bonding_count, uint8_t policy_flags)
sl_status_t sl_bt_gatt_execute_characteristic_value_write(uint8_t connection, uint8_t flags)
sl_status_t sl_bt_advertiser_set_timing(uint8_t handle, uint32_t interval_min, uint32_t interval_max, uint16_t duration, uint8_t maxevents)
sl_status_t sl_bt_sm_list_all_bondings()
sl_status_t sl_bt_test_dtm_rx(uint8_t channel, uint8_t phy)
sl_status_t sl_bt_connection_close(uint8_t connection)