mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 01:13:23 +00:00
docs: use @return instead of @returns
This commit is contained in:
parent
03b8223bf9
commit
6b65794db8
@ -120,7 +120,7 @@ static bool att_db_util_hash_include_without_value(uint16_t uuid16){
|
||||
|
||||
/**
|
||||
* asserts that the requested amount of bytes can be stored in the att_db
|
||||
* @returns TRUE if space is available
|
||||
* @return TRUE if space is available
|
||||
*/
|
||||
static int att_db_util_assert_space(uint16_t size){
|
||||
uint16_t required_size = att_db_size + size + 2;
|
||||
|
@ -64,28 +64,28 @@ void att_db_util_init(void);
|
||||
/**
|
||||
* @brief Add primary service for 16-bit UUID
|
||||
* @param uuid16
|
||||
* @returns attribute handle for the new service definition
|
||||
* @return attribute handle for the new service definition
|
||||
*/
|
||||
uint16_t att_db_util_add_service_uuid16(uint16_t uuid16);
|
||||
|
||||
/**
|
||||
* @brief Add primary service for 128-bit UUID
|
||||
* @param uuid128
|
||||
* @returns attribute handle for the new service definition
|
||||
* @return attribute handle for the new service definition
|
||||
*/
|
||||
uint16_t att_db_util_add_service_uuid128(const uint8_t * uuid128);
|
||||
|
||||
/**
|
||||
* @brief Add secondary service for 16-bit UUID
|
||||
* @param uuid16
|
||||
* @returns attribute handle for the new service definition
|
||||
* @return attribute handle for the new service definition
|
||||
*/
|
||||
uint16_t att_db_util_add_secondary_service_uuid16(uint16_t uuid16);
|
||||
|
||||
/**
|
||||
* @brief Add secondary service for 128-bit UUID
|
||||
* @param uuid128
|
||||
* @returns attribute handle for the new service definition
|
||||
* @return attribute handle for the new service definition
|
||||
*/
|
||||
uint16_t att_db_util_add_secondary_service_uuid128(const uint8_t * uuid128);
|
||||
|
||||
@ -94,7 +94,7 @@ uint16_t att_db_util_add_secondary_service_uuid128(const uint8_t * uuid128);
|
||||
* @param start_group_handle
|
||||
* @param end_group_handle
|
||||
* @param uuid16
|
||||
* @returns attribute handle for the new service definition
|
||||
* @return attribute handle for the new service definition
|
||||
*/
|
||||
uint16_t att_db_util_add_included_service_uuid16(uint16_t start_group_handle, uint16_t end_group_handle, uint16_t uuid16);
|
||||
|
||||
@ -106,7 +106,7 @@ uint16_t att_db_util_add_included_service_uuid16(uint16_t start_group_handle, ui
|
||||
* @param write_permissions - see ATT_SECURITY_* in src/bluetooth.h
|
||||
* @param data returned in read operations if ATT_PROPERTY_DYNAMIC is not specified
|
||||
* @param data_len
|
||||
* @returns attribute handle of the new characteristic value declaration
|
||||
* @return attribute handle of the new characteristic value declaration
|
||||
* @note If properties contains ATT_PROPERTY_NOTIFY or ATT_PROPERTY_INDICATE flags, a Client Configuration Characteristic Descriptor (CCCD)
|
||||
* is created as well. The attribute value handle of the CCCD is the attribute value handle plus 1
|
||||
*/
|
||||
@ -120,7 +120,7 @@ uint16_t att_db_util_add_characteristic_uuid16(uint16_t uuid16, uint16_t propert
|
||||
* @param write_permissions - see ATT_SECURITY_* in src/bluetooth.h
|
||||
* @param data returned in read operations if ATT_PROPERTY_DYNAMIC is not specified
|
||||
* @param data_len
|
||||
* @returns attribute handle of the new characteristic value declaration
|
||||
* @return attribute handle of the new characteristic value declaration
|
||||
* @note If properties contains ATT_PROPERTY_NOTIFY or ATT_PROPERTY_INDICATE flags, a Client Configuration Characteristic Descriptor (CCCD)
|
||||
* is created as well. The attribute value handle of the CCCD is the attribute value handle plus 1
|
||||
*/
|
||||
@ -134,7 +134,7 @@ uint16_t att_db_util_add_characteristic_uuid128(const uint8_t * uuid128, uint16_
|
||||
* @param write_permissions - see ATT_SECURITY_* in src/bluetooth.h
|
||||
* @param data returned in read operations if ATT_PROPERTY_DYNAMIC is not specified
|
||||
* @param data_len
|
||||
* @returns attribute handle of the new characteristic descriptor declaration
|
||||
* @return attribute handle of the new characteristic descriptor declaration
|
||||
*/
|
||||
uint16_t att_db_util_add_descriptor_uuid16(uint16_t uuid16, uint16_t properties, uint8_t read_permission, uint8_t write_permission, uint8_t * data, uint16_t data_len);
|
||||
|
||||
@ -146,7 +146,7 @@ uint16_t att_db_util_add_descriptor_uuid16(uint16_t uuid16, uint16_t properties,
|
||||
* @param write_permissions - see ATT_SECURITY_* in src/bluetooth.h
|
||||
* @param data returned in read operations if ATT_PROPERTY_DYNAMIC is not specified
|
||||
* @param data_len
|
||||
* @returns attribute handle of the new characteristic descriptor declaration
|
||||
* @return attribute handle of the new characteristic descriptor declaration
|
||||
*/
|
||||
uint16_t att_db_util_add_descriptor_uuid128(const uint8_t * uuid128, uint16_t properties, uint8_t read_permission, uint8_t write_permission, uint8_t * data, uint16_t data_len);
|
||||
|
||||
|
@ -152,7 +152,7 @@ static gatt_client_t * gatt_client_get_context_for_handle(uint16_t handle){
|
||||
}
|
||||
|
||||
|
||||
// @returns gatt_client context
|
||||
// @return gatt_client context
|
||||
// returns existing one, or tries to setup new one
|
||||
static gatt_client_t * gatt_client_provide_context_for_handle(hci_con_handle_t con_handle){
|
||||
gatt_client_t * gatt_client = gatt_client_get_context_for_handle(con_handle);
|
||||
@ -702,7 +702,7 @@ static void report_gatt_included_service_uuid128(gatt_client_t * gatt_client, ui
|
||||
gatt_client->query_end_handle, uuid128);
|
||||
}
|
||||
|
||||
// @returns packet pointer
|
||||
// @return packet pointer
|
||||
// @note assume that value is part of an l2cap buffer - overwrite HCI + L2CAP packet headers
|
||||
static const int characteristic_value_event_header_size = 8;
|
||||
static uint8_t * setup_characteristic_value_packet(uint8_t type, hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t * value, uint16_t length){
|
||||
@ -720,7 +720,7 @@ static uint8_t * setup_characteristic_value_packet(uint8_t type, hci_con_handle_
|
||||
return packet;
|
||||
}
|
||||
|
||||
// @returns packet pointer
|
||||
// @return packet pointer
|
||||
// @note assume that value is part of an l2cap buffer - overwrite parts of the HCI/L2CAP/ATT packet (4/4/3) bytes
|
||||
static const int long_characteristic_value_event_header_size = 10;
|
||||
static uint8_t * setup_long_characteristic_value_packet(uint8_t type, hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t * value, uint16_t length){
|
||||
|
@ -723,7 +723,7 @@ void gatt_client_stop_listening_for_characteristic_value_updates(gatt_client_not
|
||||
* @brief Requests GATT_EVENT_CAN_WRITE_WITHOUT_RESPONSE that guarantees a single successful gatt_client_write_value_of_characteristic_without_response
|
||||
* @param callback
|
||||
* @param con_handle
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t gatt_client_request_can_write_without_response_event(btstack_packet_handler_t callback, hci_con_handle_t con_handle);
|
||||
|
||||
|
@ -84,19 +84,19 @@ void le_device_db_set_local_bd_addr(bd_addr_t bd_addr);
|
||||
* @brief add device to db
|
||||
* @param addr_type, address of the device
|
||||
* @param irk of the device
|
||||
* @returns index if successful, -1 otherwise
|
||||
* @return index if successful, -1 otherwise
|
||||
*/
|
||||
int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk);
|
||||
|
||||
/**
|
||||
* @brief get number of devices in db
|
||||
* @returns number of device in db
|
||||
* @return number of device in db
|
||||
*/
|
||||
int le_device_db_count(void);
|
||||
|
||||
/**
|
||||
* @brief get max number of devices in db for enumeration
|
||||
* @returns max number of device in db
|
||||
* @return max number of device in db
|
||||
*/
|
||||
int le_device_db_max_count(void);
|
||||
|
||||
@ -168,7 +168,7 @@ void le_device_db_remote_csrk_get(int index, sm_key_t csrk);
|
||||
/**
|
||||
* @brief query last used/seen signing counter
|
||||
* @param index
|
||||
* @returns next expected counter, 0 after devices was added
|
||||
* @return next expected counter, 0 after devices was added
|
||||
*/
|
||||
uint32_t le_device_db_remote_counter_get(int index);
|
||||
|
||||
@ -182,7 +182,7 @@ void le_device_db_remote_counter_set(int index, uint32_t counter);
|
||||
/**
|
||||
* @brief query last used/seen signing counter
|
||||
* @param index
|
||||
* @returns next expected counter, 0 after devices was added
|
||||
* @return next expected counter, 0 after devices was added
|
||||
*/
|
||||
uint32_t le_device_db_local_counter_get(int index);
|
||||
|
||||
|
@ -94,7 +94,7 @@ void le_device_db_set_local_bd_addr(bd_addr_t bd_addr){
|
||||
(void)bd_addr;
|
||||
}
|
||||
|
||||
// @returns number of device in db
|
||||
// @return number of device in db
|
||||
int le_device_db_count(void){
|
||||
int i;
|
||||
int counter = 0;
|
||||
|
@ -109,7 +109,7 @@ static uint32_t le_device_db_tlv_tag_for_index(uint8_t index){
|
||||
return (tag_0 << 24u) | (tag_1 << 16u) | (tag_2 << 8u) | index;
|
||||
}
|
||||
|
||||
// @returns success
|
||||
// @return success
|
||||
// @param index = entry_pos
|
||||
static bool le_device_db_tlv_fetch(int index, le_device_db_entry_t * entry){
|
||||
btstack_assert(le_device_db_tlv_btstack_tlv_impl != NULL);
|
||||
@ -121,7 +121,7 @@ static bool le_device_db_tlv_fetch(int index, le_device_db_entry_t * entry){
|
||||
return size == sizeof(le_device_db_entry_t);
|
||||
}
|
||||
|
||||
// @returns success
|
||||
// @return success
|
||||
// @param index = entry_pos
|
||||
static bool le_device_db_tlv_store(int index, le_device_db_entry_t * entry){
|
||||
btstack_assert(le_device_db_tlv_btstack_tlv_impl != NULL);
|
||||
@ -170,7 +170,7 @@ void le_device_db_set_local_bd_addr(bd_addr_t bd_addr){
|
||||
(void)bd_addr;
|
||||
}
|
||||
|
||||
// @returns number of device in db
|
||||
// @return number of device in db
|
||||
int le_device_db_count(void){
|
||||
return num_valid_entries;
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ static sm_setup_context_t * setup = &the_setup;
|
||||
// active connection - the one for which the_setup is used for
|
||||
static uint16_t sm_active_connection_handle = HCI_CON_HANDLE_INVALID;
|
||||
|
||||
// @returns 1 if oob data is available
|
||||
// @return 1 if oob data is available
|
||||
// stores oob data in provided 16 byte buffer if not null
|
||||
static int (*sm_get_oob_data)(uint8_t addres_type, bd_addr_t addr, uint8_t * oob_data) = NULL;
|
||||
static int (*sm_get_sc_oob_data)(uint8_t addres_type, bd_addr_t addr, uint8_t * oob_sc_peer_confirm, uint8_t * oob_sc_peer_random);
|
||||
@ -470,7 +470,7 @@ static inline void sm_pairing_packet_set_responder_key_distribution(sm_pairing_p
|
||||
packet[6] = responder_key_distribution;
|
||||
}
|
||||
|
||||
// @returns 1 if all bytes are 0
|
||||
// @return 1 if all bytes are 0
|
||||
static bool sm_is_null(uint8_t * data, int size){
|
||||
int i;
|
||||
for (i=0; i < size ; i++){
|
||||
@ -5058,7 +5058,7 @@ irk_lookup_state_t sm_identity_resolving_state(hci_con_handle_t con_handle){
|
||||
/**
|
||||
* @brief Identify device in LE Device DB
|
||||
* @param handle
|
||||
* @returns index from le_device_db or -1 if not found/identified
|
||||
* @return index from le_device_db or -1 if not found/identified
|
||||
*/
|
||||
int sm_le_device_index(hci_con_handle_t con_handle ){
|
||||
sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
|
||||
|
@ -192,7 +192,7 @@ void sm_authorization_grant(hci_con_handle_t con_handle);
|
||||
|
||||
/**
|
||||
* @brief Support for signed writes, used by att_server.
|
||||
* @returns ready
|
||||
* @return ready
|
||||
*/
|
||||
int sm_cmac_ready(void);
|
||||
|
||||
@ -223,7 +223,7 @@ int sm_address_resolution_lookup(uint8_t address_type, bd_addr_t address);
|
||||
* @brief Get Identity Resolving state
|
||||
* @param con_handle
|
||||
* @return irk_lookup_state_t
|
||||
* @note returns IRK_LOOKUP_IDLE if connection does not exist
|
||||
* @note return IRK_LOOKUP_IDLE if connection does not exist
|
||||
*/
|
||||
irk_lookup_state_t sm_identity_resolving_state(hci_con_handle_t con_handle);
|
||||
|
||||
@ -257,7 +257,7 @@ void sm_allow_ltk_reconstruction_without_le_device_db_entry(int allow);
|
||||
* @note This generates a 128 bit random number ra and then calculates Ca = f4(PKa, PKa, ra, 0)
|
||||
* New OOB data should be generated for each pairing. Ra is used for subsequent OOB pairings
|
||||
* @param callback
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t sm_generate_sc_oob_data(void (*callback)(const uint8_t * confirm_value, const uint8_t * random_value));
|
||||
|
||||
|
@ -50,7 +50,7 @@ static const btstack_audio_source_t * btstack_audio_source_instance;
|
||||
|
||||
/**
|
||||
* @brief Get BTstack Audio Sink Instance
|
||||
* @returns btstack_audio_sink implementation
|
||||
* @return btstack_audio_sink implementation
|
||||
*/
|
||||
const btstack_audio_sink_t * btstack_audio_sink_get_instance(void){
|
||||
return btstack_audio_sink_instance;
|
||||
@ -58,7 +58,7 @@ const btstack_audio_sink_t * btstack_audio_sink_get_instance(void){
|
||||
|
||||
/**
|
||||
* @brief Get BTstack Audio Source Instance
|
||||
* @returns btstack_audio_source implementation
|
||||
* @return btstack_audio_source implementation
|
||||
*/
|
||||
const btstack_audio_source_t * btstack_audio_source_get_instance(void){
|
||||
return btstack_audio_source_instance;
|
||||
|
@ -128,13 +128,13 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @brief Get BTstack Audio Sink Instance
|
||||
* @returns btstack_audio_sink implementation
|
||||
* @return btstack_audio_sink implementation
|
||||
*/
|
||||
const btstack_audio_sink_t * btstack_audio_sink_get_instance(void);
|
||||
|
||||
/**
|
||||
* @brief Get BTstack Audio Source Instance
|
||||
* @returns btstack_audio_source implementation
|
||||
* @return btstack_audio_source implementation
|
||||
*/
|
||||
const btstack_audio_source_t * btstack_audio_source_get_instance(void);
|
||||
|
||||
|
@ -56,7 +56,7 @@ void btstack_base64_decoder_init(btstack_base64_decoder_t * context){
|
||||
/**
|
||||
* @brief Decode single byte
|
||||
* @param context
|
||||
* @returns value, or BTSTACK_BASE64_DECODER_COMPLETE, BTSTACK_BASE64_DECODER_INVALID
|
||||
* @return value, or BTSTACK_BASE64_DECODER_COMPLETE, BTSTACK_BASE64_DECODER_INVALID
|
||||
*/
|
||||
int btstack_base64_decoder_process_byte(btstack_base64_decoder_t * context, uint8_t c){
|
||||
|
||||
|
@ -70,7 +70,7 @@ void btstack_base64_decoder_init(btstack_base64_decoder_t * context);
|
||||
/**
|
||||
* @brief Decode single byte
|
||||
* @brief context
|
||||
* @returns value, or BTSTACK_BASE64_DECODER_MORE, BTSTACK_BASE64_DECODER_COMPLETE, BTSTACK_BASE64_DECODER_INVALID
|
||||
* @return value, or BTSTACK_BASE64_DECODER_MORE, BTSTACK_BASE64_DECODER_COMPLETE, BTSTACK_BASE64_DECODER_INVALID
|
||||
*/
|
||||
int btstack_base64_decoder_process_byte(btstack_base64_decoder_t * context, uint8_t c);
|
||||
|
||||
|
@ -138,7 +138,7 @@ typedef uint8_t sm_key_t[16];
|
||||
#define OGF_BTSTACK 0x3d
|
||||
|
||||
// cmds for BTstack
|
||||
// get state: @returns HCI_STATE
|
||||
// get state: @return HCI_STATE
|
||||
#define BTSTACK_GET_STATE 0x01
|
||||
|
||||
// set power mode: param HCI_POWER_MODE
|
||||
|
@ -113,7 +113,7 @@ bool btstack_linked_list_remove(btstack_linked_list_t * list, btstack_linked_it
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns number of items in list
|
||||
* @return number of items in list
|
||||
*/
|
||||
int btstack_linked_list_count(btstack_linked_list_t * list){
|
||||
btstack_linked_item_t *it;
|
||||
|
@ -67,7 +67,7 @@ typedef struct {
|
||||
/**
|
||||
* @brief Test if list is empty.
|
||||
* @param list
|
||||
* @returns true if list is empty
|
||||
* @return true if list is empty
|
||||
*/
|
||||
bool btstack_linked_list_empty(btstack_linked_list_t * list);
|
||||
|
||||
@ -75,7 +75,7 @@ bool btstack_linked_list_empty(btstack_linked_list_t * list);
|
||||
* @brief Add item to list as first element.
|
||||
* @param list
|
||||
* @param item
|
||||
* @returns true if item was added, false if item already in list
|
||||
* @return true if item was added, false if item already in list
|
||||
*/
|
||||
bool btstack_linked_list_add(btstack_linked_list_t * list, btstack_linked_item_t *item);
|
||||
|
||||
@ -83,14 +83,14 @@ bool btstack_linked_list_add(btstack_linked_list_t * list, btstack_linked_item_t
|
||||
* @brief Add item to list as last element.
|
||||
* @param list
|
||||
* @param item
|
||||
* @returns true if item was added, false if item already in list
|
||||
* @return true if item was added, false if item already in list
|
||||
*/
|
||||
bool btstack_linked_list_add_tail(btstack_linked_list_t * list, btstack_linked_item_t *item);
|
||||
|
||||
/**
|
||||
* @brief Pop (get + remove) first element.
|
||||
* @param list
|
||||
* @returns first element or NULL if list is empty
|
||||
* @return first element or NULL if list is empty
|
||||
*/
|
||||
btstack_linked_item_t * btstack_linked_list_pop(btstack_linked_list_t * list);
|
||||
|
||||
@ -98,27 +98,27 @@ btstack_linked_item_t * btstack_linked_list_pop(btstack_linked_list_t * list);
|
||||
* @brief Remove item from list
|
||||
* @param list
|
||||
* @param item
|
||||
* @returns true if item was removed, false if it is no't in list
|
||||
* @return true if item was removed, false if it is no't in list
|
||||
*/
|
||||
bool btstack_linked_list_remove(btstack_linked_list_t * list, btstack_linked_item_t *item);
|
||||
|
||||
/**
|
||||
* @brief Get first element.
|
||||
* @param list
|
||||
* @returns first element or NULL if list is empty
|
||||
* @return first element or NULL if list is empty
|
||||
*/
|
||||
btstack_linked_item_t * btstack_linked_list_get_first_item(btstack_linked_list_t * list);
|
||||
|
||||
/**
|
||||
* @brief Get last element.
|
||||
* @param list
|
||||
* @returns first element or NULL if list is empty
|
||||
* @return first element or NULL if list is empty
|
||||
*/
|
||||
btstack_linked_item_t * btstack_linked_list_get_last_item(btstack_linked_list_t * list);
|
||||
|
||||
/**
|
||||
* @brief Counts number of items in list
|
||||
* @returns number of items in list
|
||||
* @return number of items in list
|
||||
*/
|
||||
int btstack_linked_list_count(btstack_linked_list_t * list);
|
||||
|
||||
@ -135,14 +135,14 @@ void btstack_linked_list_iterator_init(btstack_linked_list_iterator_t * it, btst
|
||||
/**
|
||||
* @brief Has next element
|
||||
* @param it iterator context
|
||||
* @returns true if next element is available
|
||||
* @return true if next element is available
|
||||
*/
|
||||
bool btstack_linked_list_iterator_has_next(btstack_linked_list_iterator_t * it);
|
||||
|
||||
/**
|
||||
* @brief Get next list eleemnt
|
||||
* @param it iterator context
|
||||
* @returns list element
|
||||
* @return list element
|
||||
*/
|
||||
btstack_linked_item_t * btstack_linked_list_iterator_next(btstack_linked_list_iterator_t * it);
|
||||
|
||||
|
@ -58,7 +58,7 @@ typedef void * btstack_memory_pool_t;
|
||||
// initialize memory pool with with given storage, block size and count
|
||||
void btstack_memory_pool_create(btstack_memory_pool_t *pool, void * storage, int count, int block_size);
|
||||
|
||||
// get free block from pool, @returns NULL or pointer to block
|
||||
// get free block from pool, @return NULL or pointer to block
|
||||
void * btstack_memory_pool_get(btstack_memory_pool_t *pool);
|
||||
|
||||
// return previously reserved block to memory pool
|
||||
|
@ -86,7 +86,7 @@ void btstack_network_packet_sent(void);
|
||||
/**
|
||||
* @brief Get network name after network was activated
|
||||
* @note e.g. tapX on Linux, might not be useful on all platforms
|
||||
* @returns network name
|
||||
* @return network name
|
||||
*/
|
||||
const char * btstack_network_get_name(void);
|
||||
|
||||
|
@ -65,7 +65,7 @@ typedef struct {
|
||||
/**
|
||||
* @brief Init resample context
|
||||
* @param num_channels
|
||||
* @returns btstack_audio implementation
|
||||
* @return btstack_audio implementation
|
||||
*/
|
||||
void btstack_resample_init(btstack_resample_t * context, int num_channels);
|
||||
|
||||
@ -81,7 +81,7 @@ void btstack_resample_set_factor(btstack_resample_t * context, uint32_t factor);
|
||||
* @param input_buffer
|
||||
* @param num_frames
|
||||
* @param output_buffer
|
||||
* @returns number destination frames
|
||||
* @return number destination frames
|
||||
*/
|
||||
uint16_t btstack_resample_block(btstack_resample_t * context, const int16_t * input_buffer, uint32_t num_frames, int16_t * output_buffer);
|
||||
|
||||
|
@ -126,7 +126,7 @@ void btstack_run_loop_base_dump_timer(void){
|
||||
}
|
||||
/**
|
||||
* @brief Get time until first timer fires
|
||||
* @returns -1 if no timers, time until next timeout otherwise
|
||||
* @return -1 if no timers, time until next timeout otherwise
|
||||
*/
|
||||
int32_t btstack_run_loop_base_get_time_until_timeout(uint32_t now){
|
||||
if (btstack_run_loop_base_timers == NULL) return -1;
|
||||
|
@ -140,7 +140,7 @@ void btstack_run_loop_base_add_timer(btstack_timer_source_t * timer);
|
||||
/**
|
||||
* @brief Remove timer source.
|
||||
* @param timer to remove
|
||||
* @returns true if timer was removed
|
||||
* @return true if timer was removed
|
||||
*/
|
||||
bool btstack_run_loop_base_remove_timer(btstack_timer_source_t * timer);
|
||||
|
||||
@ -157,7 +157,7 @@ void btstack_run_loop_base_dump_timer(void);
|
||||
|
||||
/**
|
||||
* @brief Get time until first timer fires
|
||||
* @returns -1 if no timers, time until next timeout otherwise
|
||||
* @return -1 if no timers, time until next timeout otherwise
|
||||
*/
|
||||
int32_t btstack_run_loop_base_get_time_until_timeout(uint32_t now);
|
||||
|
||||
@ -170,7 +170,7 @@ void btstack_run_loop_base_add_data_source(btstack_data_source_t * data_source);
|
||||
/**
|
||||
* @brief Remove data source from run loop
|
||||
* @param data_source to remove
|
||||
* @returns true if data srouce was removed
|
||||
* @return true if data srouce was removed
|
||||
*/
|
||||
bool btstack_run_loop_base_remove_data_source(btstack_data_source_t * data_source);
|
||||
|
||||
|
@ -56,7 +56,7 @@ typedef struct {
|
||||
* @param tag
|
||||
* @param buffer
|
||||
* @param buffer_size
|
||||
* @returns size of value
|
||||
* @return size of value
|
||||
*/
|
||||
int (*get_tag)(void * context, uint32_t tag, uint8_t * buffer, uint32_t buffer_size);
|
||||
|
||||
@ -66,7 +66,7 @@ typedef struct {
|
||||
* @param tag
|
||||
* @param data
|
||||
* @param data_size
|
||||
* @returns 0 on success
|
||||
* @return 0 on success
|
||||
*/
|
||||
int (*store_tag)(void * context, uint32_t tag, const uint8_t * data, uint32_t data_size);
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* @param tag
|
||||
* @param buffer
|
||||
* @param buffer_size
|
||||
* @returns size of value
|
||||
* @return size of value
|
||||
*/
|
||||
static int btstack_tlv_none_get_tag(void * context, uint32_t tag, uint8_t * buffer, uint32_t buffer_size){
|
||||
return 0;
|
||||
|
@ -56,7 +56,7 @@
|
||||
/**
|
||||
* @brief Initialize SLIP wrapper for existing btstack_uart_block_t instance without SLIP support
|
||||
* @param uart_block_without_slip
|
||||
* @returns btstack_uart_t instance with SLIP support for use with hci_trasnport_h5
|
||||
* @return btstack_uart_t instance with SLIP support for use with hci_trasnport_h5
|
||||
*/
|
||||
const btstack_uart_t * btstack_uart_slip_wrapper_instance(const btstack_uart_t * uart_without_slip);
|
||||
|
||||
|
@ -173,7 +173,7 @@ uint32_t btstack_max(uint32_t a, uint32_t b){
|
||||
|
||||
/**
|
||||
* @brief Calculate delta between two points in time
|
||||
* @returns time_a - time_b - result > 0 if time_a is newer than time_b
|
||||
* @return time_a - time_b - result > 0 if time_a is newer than time_b
|
||||
*/
|
||||
int32_t btstack_time_delta(uint32_t time_a, uint32_t time_b){
|
||||
return (int32_t)(time_a - time_b);
|
||||
|
@ -89,7 +89,7 @@ uint32_t btstack_max(uint32_t a, uint32_t b);
|
||||
|
||||
/**
|
||||
* @brief Calculate delta between two points in time
|
||||
* @returns time_a - time_b - result > 0 if time_a is newer than time_b
|
||||
* @return time_a - time_b - result > 0 if time_a is newer than time_b
|
||||
*/
|
||||
int32_t btstack_time_delta(uint32_t time_a, uint32_t time_b);
|
||||
|
||||
@ -143,7 +143,7 @@ static inline uint16_t btstack_flip_16(uint16_t value){
|
||||
|
||||
/**
|
||||
* @brief Check for big endian system
|
||||
* @returns 1 if on big endian
|
||||
* @return 1 if on big endian
|
||||
*/
|
||||
static inline int btstack_is_big_endian(void){
|
||||
uint16_t sample = 0x0100;
|
||||
@ -152,7 +152,7 @@ static inline int btstack_is_big_endian(void){
|
||||
|
||||
/**
|
||||
* @brief Check for little endian system
|
||||
* @returns 1 if on little endian
|
||||
* @return 1 if on little endian
|
||||
*/
|
||||
static inline int btstack_is_little_endian(void){
|
||||
uint16_t sample = 0x0001;
|
||||
|
@ -695,14 +695,14 @@ void avrcp_register_packet_handler(btstack_packet_handler_t callback);
|
||||
* @brief Connect to AVRCP service on a remote device, emits AVRCP_SUBEVENT_CONNECTION_ESTABLISHED with status
|
||||
* @param remote_addr
|
||||
* @param avrcp_cid outgoing parameter, valid if status == ERROR_CODE_SUCCESS
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_connect(bd_addr_t remote_addr, uint16_t * avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Disconnect from AVRCP service
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_disconnect(uint16_t avrcp_cid);
|
||||
|
||||
|
@ -76,7 +76,7 @@ void avrcp_browsing_register_packet_handler(btstack_packet_handler_t callback);
|
||||
* @param ertm_buffer_size
|
||||
* @param ertm_config
|
||||
* @param avrcp_browsing_cid outgoing parameter, valid if status == ERROR_CODE_SUCCESS
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_browsing_connect(bd_addr_t remote_addr, uint8_t * ertm_buffer, uint32_t ertm_buffer_size, l2cap_ertm_config_t * ertm_config, uint16_t * avrcp_browsing_cid);
|
||||
|
||||
@ -86,21 +86,21 @@ uint8_t avrcp_browsing_connect(bd_addr_t remote_addr, uint8_t * ertm_buffer, uin
|
||||
* @param ertm_buffer
|
||||
* @param ertm_buffer_size
|
||||
* @param ertm_config
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_browsing_configure_incoming_connection(uint16_t avrcp_browsing_cid, uint8_t * ertm_buffer, uint32_t ertm_buffer_size, l2cap_ertm_config_t * ertm_config);
|
||||
|
||||
/**
|
||||
* @brief Decline incoming connection Browsing Service.
|
||||
* @param avrcp_browsing_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_browsing_decline_incoming_connection(uint16_t avrcp_browsing_cid);
|
||||
|
||||
/**
|
||||
* @brief Disconnect from AVRCP Browsing service
|
||||
* @param avrcp_browsing_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_browsing_disconnect(uint16_t avrcp_browsing_cid);
|
||||
|
||||
|
@ -89,7 +89,7 @@ void avrcp_controller_register_packet_handler(btstack_packet_handler_t callback)
|
||||
* @brief Set max num fragments in whuch message can be transmited.
|
||||
* @param avrcp_cid
|
||||
* @param max_num_fragments
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_set_max_num_fragments(uint16_t avrcp_cid, uint8_t max_num_fragments);
|
||||
|
||||
@ -97,28 +97,28 @@ uint8_t avrcp_controller_set_max_num_fragments(uint16_t avrcp_cid, uint8_t max_n
|
||||
/**
|
||||
* @brief Unit info.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_unit_info(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Subunit info.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_subunit_info(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Get capabilities.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_get_supported_company_ids(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Get supported Events.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_get_supported_events(uint16_t avrcp_cid);
|
||||
|
||||
@ -126,21 +126,21 @@ uint8_t avrcp_controller_get_supported_events(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Start continuous cmd (play, pause, volume up, ...). Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_start_press_and_hold_cmd(uint16_t avrcp_cid, avrcp_operation_id_t operation_id);
|
||||
|
||||
/**
|
||||
* @brief Stops continuous cmd (play, pause, volume up, ...). Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_release_press_and_hold_cmd(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Play. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_play(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_play(uint16_t avrcp_cid);
|
||||
@ -148,7 +148,7 @@ uint8_t avrcp_controller_press_and_hold_play(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Stop. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_stop(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_stop(uint16_t avrcp_cid);
|
||||
@ -156,7 +156,7 @@ uint8_t avrcp_controller_press_and_hold_stop(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Pause. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_pause(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_pause(uint16_t avrcp_cid);
|
||||
@ -164,7 +164,7 @@ uint8_t avrcp_controller_press_and_hold_pause(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Single step - fast forward. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_fast_forward(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_fast_forward(uint16_t avrcp_cid);
|
||||
@ -173,7 +173,7 @@ uint8_t avrcp_controller_press_and_hold_fast_forward(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Single step rewind. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_rewind(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_rewind(uint16_t avrcp_cid);
|
||||
@ -181,7 +181,7 @@ uint8_t avrcp_controller_press_and_hold_rewind(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Forward. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_forward(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_forward(uint16_t avrcp_cid);
|
||||
@ -189,7 +189,7 @@ uint8_t avrcp_controller_press_and_hold_forward(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Backward. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_backward(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_backward(uint16_t avrcp_cid);
|
||||
@ -197,14 +197,14 @@ uint8_t avrcp_controller_press_and_hold_backward(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Turns the volume to high. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_volume_up(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_volume_up(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Turns the volume to low. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_volume_down(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_volume_down(uint16_t avrcp_cid);
|
||||
@ -212,7 +212,7 @@ uint8_t avrcp_controller_press_and_hold_volume_down(uint16_t avrcp_cid);
|
||||
/**
|
||||
* @brief Puts the sound out. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_mute(uint16_t avrcp_cid);
|
||||
uint8_t avrcp_controller_press_and_hold_mute(uint16_t avrcp_cid);
|
||||
@ -221,7 +221,7 @@ uint8_t avrcp_controller_press_and_hold_mute(uint16_t avrcp_cid);
|
||||
* @brief Get play status. Returns event of type AVRCP_SUBEVENT_PLAY_STATUS (length, position, play_status).
|
||||
* If TG does not support SongLength And SongPosition on TG, then TG shall return 0xFFFFFFFF.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_get_play_status(uint16_t avrcp_cid);
|
||||
|
||||
@ -229,7 +229,7 @@ uint8_t avrcp_controller_get_play_status(uint16_t avrcp_cid);
|
||||
* @brief Enable notification. Response via AVRCP_SUBEVENT_NOTIFICATION_STATE.
|
||||
* @param avrcp_cid
|
||||
* @param event_id
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_enable_notification(uint16_t avrcp_cid, avrcp_notification_event_id_t event_id);
|
||||
|
||||
@ -237,28 +237,28 @@ uint8_t avrcp_controller_enable_notification(uint16_t avrcp_cid, avrcp_notificat
|
||||
* @brief Disable notification. Response via AVRCP_SUBEVENT_NOTIFICATION_STATE.
|
||||
* @param avrcp_cid
|
||||
* @param event_id
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_disable_notification(uint16_t avrcp_cid, avrcp_notification_event_id_t event_id);
|
||||
|
||||
/**
|
||||
* @brief Get info on now playing media using subset of attribute IDs
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_get_element_attributes(uint16_t avrcp_cid, uint8_t num_attributes, avrcp_media_attribute_id_t * attributes);
|
||||
|
||||
/**
|
||||
* @brief Get info on now playing media using all IDs.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_get_now_playing_info(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Set absolute volume 0-127 (corresponds to 0-100%). Response via AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_set_absolute_volume(uint16_t avrcp_cid, uint8_t volume);
|
||||
|
||||
@ -266,28 +266,28 @@ uint8_t avrcp_controller_set_absolute_volume(uint16_t avrcp_cid, uint8_t volume)
|
||||
/**
|
||||
* @brief Skip to next playing media. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_skip(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Query repeat and shuffle mode. Response via AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_query_shuffle_and_repeat_modes(uint16_t avrcp_cid);
|
||||
|
||||
/**
|
||||
* @brief Set shuffle mode. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_set_shuffle_mode(uint16_t avrcp_cid, avrcp_shuffle_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Set repeat mode. Event AVRCP_SUBEVENT_OPERATION_COMPLETE returns operation id and status.
|
||||
* @param avrcp_cid
|
||||
* @returns status
|
||||
* @return status
|
||||
*/
|
||||
uint8_t avrcp_controller_set_repeat_mode(uint16_t avrcp_cid, avrcp_repeat_mode_t mode);
|
||||
|
||||
|
@ -83,7 +83,7 @@ typedef struct {
|
||||
* @param addr to lookup
|
||||
* @param link_key (out)
|
||||
* @param type (out)
|
||||
* @returns 1 on success
|
||||
* @return 1 on success
|
||||
*/
|
||||
int (*get_link_key)(bd_addr_t bd_addr, link_key_t link_key, link_key_type_t * type);
|
||||
|
||||
@ -106,7 +106,7 @@ typedef struct {
|
||||
/**
|
||||
* @brief Setup iterator
|
||||
* @param it
|
||||
* @returns 1 on success
|
||||
* @return 1 on success
|
||||
*/
|
||||
int (*iterator_init)(btstack_link_key_iterator_t * it);
|
||||
|
||||
@ -116,7 +116,7 @@ typedef struct {
|
||||
* @brief addr
|
||||
* @brief link_key
|
||||
* @brief type of link key
|
||||
* @returns 1, if valid link key found
|
||||
* @return 1, if valid link key found
|
||||
*/
|
||||
int (*iterator_get_next)(btstack_link_key_iterator_t * it, bd_addr_t bd_addr, link_key_t link_key, link_key_type_t * type);
|
||||
|
||||
|
@ -841,7 +841,7 @@ void hfp_set_sco_packet_types(uint16_t packet_types);
|
||||
|
||||
/**
|
||||
* @brief Get packet types for SCO connections
|
||||
* @returns packet_types
|
||||
* @return packet_types
|
||||
*/
|
||||
uint16_t hfp_get_sco_packet_types(void);
|
||||
|
||||
|
@ -132,14 +132,14 @@ uint32_t de_get_len_safe(const uint8_t * header, uint32_t size){
|
||||
return de_len;
|
||||
}
|
||||
|
||||
// @returns OK, if UINT16 value was read
|
||||
// @return OK, if UINT16 value was read
|
||||
int de_element_get_uint16(const uint8_t * element, uint16_t * value){
|
||||
if (de_get_size_type(element) != DE_SIZE_16) return 0;
|
||||
*value = big_endian_read_16(element, de_get_header_size(element));
|
||||
return 1;
|
||||
}
|
||||
|
||||
// @returns: element is valid UUID
|
||||
// @return: element is valid UUID
|
||||
int de_get_normalized_uuid(uint8_t *uuid128, const uint8_t *element){
|
||||
de_type_t uuidType = de_get_element_type(element);
|
||||
de_size_t uuidSize = de_get_size_type(element);
|
||||
@ -162,7 +162,7 @@ int de_get_normalized_uuid(uint8_t *uuid128, const uint8_t *element){
|
||||
return 1;
|
||||
}
|
||||
|
||||
// @returns 0 if no UUID16 or UUID32 is present, and UUID32 otherwise
|
||||
// @return 0 if no UUID16 or UUID32 is present, and UUID32 otherwise
|
||||
uint32_t de_get_uuid32(const uint8_t * element){
|
||||
uint8_t uuid128[16];
|
||||
int validUuid128 = de_get_normalized_uuid(uuid128, element);
|
||||
@ -206,7 +206,7 @@ void de_create_sequence(uint8_t *header){
|
||||
de_store_descriptor_with_len( header, DE_DES, DE_SIZE_VAR_16, 0); // DES, 2 Byte Length
|
||||
}
|
||||
|
||||
/* starts a sub-sequence, @returns handle for sub-sequence */
|
||||
/* starts a sub-sequence, @return handle for sub-sequence */
|
||||
uint8_t * de_push_sequence(uint8_t *header){
|
||||
int element_len = de_get_len(header);
|
||||
de_store_descriptor_with_len(header+element_len, DE_DES, DE_SIZE_VAR_16, 0); // DES, 2 Byte Length
|
||||
|
26
src/gap.h
26
src/gap.h
@ -479,7 +479,7 @@ void gap_set_connection_parameters(uint16_t conn_scan_interval, uint16_t conn_sc
|
||||
* @param conn_interval_max (unit: 1.25ms)
|
||||
* @param conn_latency
|
||||
* @param supervision_timeout (unit: 10ms)
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
int gap_request_connection_parameter_update(hci_con_handle_t con_handle, uint16_t conn_interval_min,
|
||||
uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout);
|
||||
@ -491,7 +491,7 @@ int gap_request_connection_parameter_update(hci_con_handle_t con_handle, uint16_
|
||||
* @param conn_interval_max (unit: 1.25ms)
|
||||
* @param conn_latency
|
||||
* @param supervision_timeout (unit: 10ms)
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
int gap_update_connection_parameters(hci_con_handle_t con_handle, uint16_t conn_interval_min,
|
||||
uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout);
|
||||
@ -514,7 +514,7 @@ void gap_set_connection_parameter_range(le_connection_parameter_range_t * range)
|
||||
* @param conn_interval_max (unit: 1.25ms)
|
||||
* @param conn_latency
|
||||
* @param supervision_timeout (unit: 10ms)
|
||||
* @returns 1 if included
|
||||
* @return 1 if included
|
||||
*/
|
||||
int gap_connection_parameter_range_included(le_connection_parameter_range_t * existing_range, uint16_t le_conn_interval_min, uint16_t le_conn_interval_max, uint16_t le_conn_latency, uint16_t le_supervision_timeout);
|
||||
|
||||
@ -529,7 +529,7 @@ void gap_set_max_number_peripheral_connections(int max_peripheral_connections);
|
||||
* @brief Add Device to Whitelist
|
||||
* @param address_typ
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_whitelist_add(bd_addr_type_t address_type, const bd_addr_t address);
|
||||
|
||||
@ -537,13 +537,13 @@ uint8_t gap_whitelist_add(bd_addr_type_t address_type, const bd_addr_t address);
|
||||
* @brief Remove Device from Whitelist
|
||||
* @param address_typ
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_whitelist_remove(bd_addr_type_t address_type, const bd_addr_t address);
|
||||
|
||||
/**
|
||||
* @brief Clear Whitelist
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_whitelist_clear(void);
|
||||
|
||||
@ -555,7 +555,7 @@ uint8_t gap_connect(const bd_addr_t addr, bd_addr_type_t addr_type);
|
||||
/**
|
||||
* @brief Connect with Whitelist
|
||||
* @note Explicit whitelist management and this connect with whitelist replace deprecated gap_auto_connection_* functions
|
||||
* @returns - if ok
|
||||
* @return - if ok
|
||||
*/
|
||||
uint8_t gap_connect_with_whitelist(void);
|
||||
|
||||
@ -569,7 +569,7 @@ uint8_t gap_connect_cancel(void);
|
||||
* @deprecated Please setup Whitelist with gap_whitelist_* and start connecting with gap_connect_with_whitelist
|
||||
* @param address_type
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_auto_connection_start(bd_addr_type_t address_type, const bd_addr_t address);
|
||||
|
||||
@ -578,7 +578,7 @@ uint8_t gap_auto_connection_start(bd_addr_type_t address_type, const bd_addr_t a
|
||||
* @deprecated Please setup Whitelist with gap_whitelist_* and start connecting with gap_connect_with_whitelist
|
||||
* @param address_type
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_auto_connection_stop(bd_addr_type_t address_type, const bd_addr_t address);
|
||||
|
||||
@ -596,7 +596,7 @@ uint8_t gap_auto_connection_stop_all(void);
|
||||
* @param tx_phys 1 = 1M, 2 = 2M, 4 = Coded
|
||||
* @param rx_phys 1 = 1M, 2 = 2M, 4 = Coded
|
||||
* @param phy_options 0 = no preferred coding for Coded, 1 = S=2 coding (500 kbit), 2 = S=8 coding (125 kbit)
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_le_set_phy(hci_con_handle_t con_handle, uint8_t all_phys, uint8_t tx_phys, uint8_t rx_phys, uint8_t phy_options);
|
||||
|
||||
@ -701,7 +701,7 @@ bool gap_get_link_key_for_bd_addr(bd_addr_t addr, link_key_t link_key, link_key_
|
||||
/**
|
||||
* @brief Setup Link Key iterator
|
||||
* @param it
|
||||
* @returns 1 on success
|
||||
* @return 1 on success
|
||||
* @note On most desktop ports, the Link Key DB uses a TLV and there is one TLV storage per
|
||||
* Controller resp. its Bluetooth Address. As the Bluetooth Address is retrieved during
|
||||
* power up, this function only works, when the stack is in working state for these ports.
|
||||
@ -714,7 +714,7 @@ int gap_link_key_iterator_init(btstack_link_key_iterator_t * it);
|
||||
* @brief addr
|
||||
* @brief link_key
|
||||
* @brief type of link key
|
||||
* @returns 1, if valid link key found
|
||||
* @return 1, if valid link key found
|
||||
* @see note on gap_link_key_iterator_init
|
||||
*/
|
||||
int gap_link_key_iterator_get_next(btstack_link_key_iterator_t * it, bd_addr_t bd_addr, link_key_t link_key, link_key_type_t * type);
|
||||
@ -738,7 +738,7 @@ int gap_inquiry_start(uint8_t duration_in_1280ms_units);
|
||||
/**
|
||||
* @brief Stop GAP Classic Inquiry
|
||||
* @brief Stop GAP Classic Inquiry
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
* @events: GAP_EVENT_INQUIRY_COMPLETE
|
||||
*/
|
||||
int gap_inquiry_stop(void);
|
||||
|
27
src/hci.c
27
src/hci.c
@ -272,7 +272,7 @@ void gap_set_connection_parameter_range(le_connection_parameter_range_t *range){
|
||||
* @param conn_interval_max (unit: 1.25ms)
|
||||
* @param conn_latency
|
||||
* @param supervision_timeout (unit: 10ms)
|
||||
* @returns 1 if included
|
||||
* @return 1 if included
|
||||
*/
|
||||
int gap_connection_parameter_range_included(le_connection_parameter_range_t * existing_range, uint16_t le_conn_interval_min, uint16_t le_conn_interval_max, uint16_t le_conn_latency, uint16_t le_supervision_timeout){
|
||||
if (le_conn_interval_min < existing_range->le_conn_interval_min) return 0;
|
||||
@ -712,7 +712,8 @@ bool hci_is_packet_buffer_reserved(void){
|
||||
return hci_stack->hci_packet_buffer_reserved;
|
||||
}
|
||||
|
||||
// reserves outgoing packet buffer. @returns 1 if successful
|
||||
// reserves outgoing packet buffer.
|
||||
// @return 1 if successful
|
||||
bool hci_reserve_packet_buffer(void){
|
||||
if (hci_stack->hci_packet_buffer_reserved) {
|
||||
log_error("hci_reserve_packet_buffer called but buffer already reserved");
|
||||
@ -5963,7 +5964,7 @@ void gap_set_connection_parameters(uint16_t conn_scan_interval, uint16_t conn_sc
|
||||
* @param conn_interval_max (unit: 1.25ms)
|
||||
* @param conn_latency
|
||||
* @param supervision_timeout (unit: 10ms)
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
int gap_update_connection_parameters(hci_con_handle_t con_handle, uint16_t conn_interval_min,
|
||||
uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout){
|
||||
@ -5985,7 +5986,7 @@ int gap_update_connection_parameters(hci_con_handle_t con_handle, uint16_t conn_
|
||||
* @param conn_interval_max (unit: 1.25ms)
|
||||
* @param conn_latency
|
||||
* @param supervision_timeout (unit: 10ms)
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
int gap_request_connection_parameter_update(hci_con_handle_t con_handle, uint16_t conn_interval_min,
|
||||
uint16_t conn_interval_max, uint16_t conn_latency, uint16_t supervision_timeout){
|
||||
@ -6243,7 +6244,7 @@ static void hci_whitelist_clear(void){
|
||||
|
||||
/**
|
||||
* @brief Clear Whitelist
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_whitelist_clear(void){
|
||||
hci_whitelist_clear();
|
||||
@ -6255,7 +6256,7 @@ uint8_t gap_whitelist_clear(void){
|
||||
* @brief Add Device to Whitelist
|
||||
* @param address_typ
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_whitelist_add(bd_addr_type_t address_type, const bd_addr_t address){
|
||||
uint8_t status = hci_whitelist_add(address_type, address);
|
||||
@ -6270,7 +6271,7 @@ uint8_t gap_whitelist_add(bd_addr_type_t address_type, const bd_addr_t address){
|
||||
* @brief Remove Device from Whitelist
|
||||
* @param address_typ
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_whitelist_remove(bd_addr_type_t address_type, const bd_addr_t address){
|
||||
uint8_t status = hci_whitelist_remove(address_type, address);
|
||||
@ -6283,9 +6284,9 @@ uint8_t gap_whitelist_remove(bd_addr_type_t address_type, const bd_addr_t addres
|
||||
|
||||
#ifdef ENABLE_LE_CENTRAL
|
||||
/**
|
||||
* @brief Connect with Whitelist
|
||||
* @note Explicit whitelist management and this connect with whitelist replace deprecated gap_auto_connection_* functions
|
||||
* @returns - if ok
|
||||
* @brief Connect with Whitelist
|
||||
* @note Explicit whitelist management and this connect with whitelist replace deprecated gap_auto_connection_* functions
|
||||
* @return - if ok
|
||||
*/
|
||||
uint8_t gap_connect_with_whitelist(void){
|
||||
if (hci_stack->le_connecting_request != LE_CONNECTING_IDLE){
|
||||
@ -6300,7 +6301,7 @@ uint8_t gap_connect_with_whitelist(void){
|
||||
* @brief Auto Connection Establishment - Start Connecting to device
|
||||
* @param address_typ
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_auto_connection_start(bd_addr_type_t address_type, const bd_addr_t address){
|
||||
if (hci_stack->le_connecting_request == LE_CONNECTING_DIRECT){
|
||||
@ -6322,7 +6323,7 @@ uint8_t gap_auto_connection_start(bd_addr_type_t address_type, const bd_addr_t a
|
||||
* @brief Auto Connection Establishment - Stop Connecting to device
|
||||
* @param address_typ
|
||||
* @param address
|
||||
* @returns 0 if ok
|
||||
* @return 0 if ok
|
||||
*/
|
||||
uint8_t gap_auto_connection_stop(bd_addr_type_t address_type, const bd_addr_t address){
|
||||
if (hci_stack->le_connecting_request == LE_CONNECTING_DIRECT){
|
||||
@ -6390,7 +6391,7 @@ int gap_inquiry_start(uint8_t duration_in_1280ms_units){
|
||||
|
||||
/**
|
||||
* @brief Stop GAP Classic Inquiry
|
||||
* @returns 0 if ok
|
||||
* @return 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)) {
|
||||
|
@ -3206,7 +3206,7 @@ static void l2cap_emit_connection_parameter_update_response(hci_con_handle_t con
|
||||
(*l2cap_event_packet_handler)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
}
|
||||
|
||||
// @returns valid
|
||||
// @return valid
|
||||
static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t * command, uint8_t sig_id){
|
||||
hci_connection_t * connection;
|
||||
uint16_t result;
|
||||
|
@ -136,7 +136,7 @@ void mesh_network_key_init(void);
|
||||
/**
|
||||
* @brief Get internal index of free network key storage entry
|
||||
* @note index 0 is reserved for primary network key
|
||||
* @returns index or MESH_KEYS_INVALID_INDEX if none found
|
||||
* @return index or MESH_KEYS_INVALID_INDEX if none found
|
||||
*/
|
||||
uint16_t mesh_network_key_get_free_index(void);
|
||||
|
||||
@ -158,13 +158,13 @@ bool mesh_network_key_remove(mesh_network_key_t * network_key);
|
||||
/**
|
||||
* @brief Get network_key for netkey_index
|
||||
* @param netkey_index
|
||||
* @returns mesh_network_key_t or NULL
|
||||
* @return mesh_network_key_t or NULL
|
||||
*/
|
||||
mesh_network_key_t * mesh_network_key_list_get(uint16_t netkey_index);
|
||||
|
||||
/**
|
||||
* @brief Get number of stored network_keys
|
||||
* @returns count
|
||||
* @return count
|
||||
*/
|
||||
int mesh_network_key_list_count(void);
|
||||
|
||||
@ -222,7 +222,7 @@ void mesh_transport_set_device_key(const uint8_t * device_key);
|
||||
/**
|
||||
* @brief Get internal index of free transport key storage entry
|
||||
* @note index 0 is reserved for device key
|
||||
* @returns index or 0u if none found
|
||||
* @return index or 0u if none found
|
||||
*/
|
||||
uint16_t mesh_transport_key_get_free_index(void);
|
||||
|
||||
|
@ -329,49 +329,49 @@ void mesh_network_setup_pdu_header(mesh_network_pdu_t * network_pdu, uint16_t ne
|
||||
* @param ctl
|
||||
* @param src
|
||||
* @param dst
|
||||
* @returns 1 if valid,
|
||||
* @return 1 if valid,
|
||||
*/
|
||||
int mesh_network_addresses_valid(uint8_t ctl, uint16_t src, uint16_t dst);
|
||||
|
||||
/**
|
||||
* @brief Check if Unicast address
|
||||
* @param addr
|
||||
* @returns 1 if unicast
|
||||
* @return 1 if unicast
|
||||
*/
|
||||
int mesh_network_address_unicast(uint16_t addr);
|
||||
|
||||
/**
|
||||
* @brief Check if Unicast address
|
||||
* @param addr
|
||||
* @returns 1 if unicast
|
||||
* @return 1 if unicast
|
||||
*/
|
||||
int mesh_network_address_group(uint16_t addr);
|
||||
|
||||
/**
|
||||
* @brief Check if All Proxies address
|
||||
* @param addr
|
||||
* @returns 1 if all proxies
|
||||
* @return 1 if all proxies
|
||||
*/
|
||||
int mesh_network_address_all_proxies(uint16_t addr);
|
||||
|
||||
/**
|
||||
* @brief Check if All Nodes address
|
||||
* @param addr
|
||||
* @returns 1 if all nodes
|
||||
* @return 1 if all nodes
|
||||
*/
|
||||
int mesh_network_address_all_nodes(uint16_t addr);
|
||||
|
||||
/**
|
||||
* @brief Check if All Friends address
|
||||
* @param addr
|
||||
* @returns 1 if all friends
|
||||
* @return 1 if all friends
|
||||
*/
|
||||
int mesh_network_address_all_friends(uint16_t addr);
|
||||
|
||||
/**
|
||||
* @brief Check if All Relays address
|
||||
* @param addr
|
||||
* @returns 1 if all relays
|
||||
* @return 1 if all relays
|
||||
*/
|
||||
int mesh_network_address_all_relays(uint16_t addr);
|
||||
|
||||
@ -379,7 +379,7 @@ int mesh_network_address_all_relays(uint16_t addr);
|
||||
/**
|
||||
* @brief Check if Virtual address
|
||||
* @param addr
|
||||
* @returns 1 if virtual
|
||||
* @return 1 if virtual
|
||||
*/
|
||||
int mesh_network_address_virtual(uint16_t addr);
|
||||
|
||||
@ -399,13 +399,13 @@ void mesh_subnet_remove(mesh_subnet_t * subnet);
|
||||
/**
|
||||
* @brief Get subnet for netkey_index
|
||||
* @param netkey_index
|
||||
* @returns mesh_subnet_t or NULL
|
||||
* @return mesh_subnet_t or NULL
|
||||
*/
|
||||
mesh_subnet_t * mesh_subnet_get_by_netkey_index(uint16_t netkey_index);
|
||||
|
||||
/**
|
||||
* @brief Get number of stored subnets
|
||||
* @returns count
|
||||
* @return count
|
||||
*/
|
||||
int mesh_subnet_list_count(void);
|
||||
|
||||
|
@ -65,7 +65,7 @@ typedef void (*mesh_operation_handler)(struct mesh_model * mesh_model, mesh_pdu_
|
||||
|
||||
// function to publish the current state of a model
|
||||
// @param mesh_model to publish
|
||||
// @returns mesh_pdu with status message
|
||||
// @return mesh_pdu with status message
|
||||
typedef mesh_pdu_t * (*mesh_publish_state_t)(struct mesh_model * mesh_model);
|
||||
|
||||
typedef enum {
|
||||
@ -218,7 +218,7 @@ void mesh_node_add_element(mesh_element_t * element);
|
||||
|
||||
/**
|
||||
* @brief Get number elements
|
||||
* @returns number of elements on this node
|
||||
* @return number of elements on this node
|
||||
*/
|
||||
uint16_t mesh_node_element_count(void);
|
||||
|
||||
@ -301,7 +301,7 @@ void mesh_node_set_device_uuid(const uint8_t * device_uuid);
|
||||
|
||||
/**
|
||||
* @brief Get Device UUID
|
||||
* @returns device_uuid if set, NULL otherwise
|
||||
* @return device_uuid if set, NULL otherwise
|
||||
*/
|
||||
const uint8_t * mesh_node_get_device_uuid(void);
|
||||
|
||||
@ -315,19 +315,19 @@ void mesh_node_set_info(uint16_t company_id, uint16_t product_id, uint16_t produ
|
||||
|
||||
/**
|
||||
* @brief Get node info: company_id
|
||||
* @returns company_id
|
||||
* @return company_id
|
||||
*/
|
||||
uint16_t mesh_node_get_company_id(void);
|
||||
|
||||
/**
|
||||
* @brief Get node info: product_id
|
||||
* @returns product_id
|
||||
* @return product_id
|
||||
*/
|
||||
uint16_t mesh_node_get_product_id(void);
|
||||
|
||||
/**
|
||||
* @brief Get node info: product_version_id
|
||||
* @returns product_version_id
|
||||
* @return product_version_id
|
||||
*/
|
||||
uint16_t mesh_node_get_product_version_id(void);
|
||||
|
||||
|
@ -67,7 +67,7 @@ void mesh_proxy_stop_advertising_unprovisioned_device(void);
|
||||
/**
|
||||
* @brief Set Advertising with Node ID on given subnet
|
||||
* @param netkey_index of subnet
|
||||
* @returns MESH_FOUNDATION_STATUS_SUCCESS, MESH_FOUNDATION_STATUS_FEATURE_NOT_SUPPORTED, or MESH_FOUNDATION_STATUS_INVALID_NETKEY_INDEX
|
||||
* @return MESH_FOUNDATION_STATUS_SUCCESS, MESH_FOUNDATION_STATUS_FEATURE_NOT_SUPPORTED, or MESH_FOUNDATION_STATUS_INVALID_NETKEY_INDEX
|
||||
* @note Node ID is only advertised on one subnet at a time and it is limited to 60 seconds
|
||||
*/
|
||||
uint8_t mesh_proxy_set_advertising_with_node_id(uint16_t netkey_index, mesh_node_identity_state_t state);
|
||||
@ -76,7 +76,7 @@ uint8_t mesh_proxy_set_advertising_with_node_id(uint16_t netkey_index, mesh_node
|
||||
* @brief Check if Advertising with Node ID is active
|
||||
* @param netey_index of subnet
|
||||
* @param out_state current state
|
||||
* @returns MESH_FOUNDATION_STATUS_SUCCESS or MESH_FOUNDATION_STATUS_INVALID_NETKEY_INDEX
|
||||
* @return MESH_FOUNDATION_STATUS_SUCCESS or MESH_FOUNDATION_STATUS_INVALID_NETKEY_INDEX
|
||||
*/
|
||||
uint8_t mesh_proxy_get_advertising_with_node_id_status(uint16_t netkey_index, mesh_node_identity_state_t * out_state );
|
||||
|
||||
|
@ -56,7 +56,7 @@ typedef struct {
|
||||
|
||||
/*
|
||||
* @brief reserve 1 x mesh_upper_transport_pdu_t and 14 x mesh_network_pdu_t to allow composition of max access/control message
|
||||
* @returns true if enough buffer allocated
|
||||
* @return true if enough buffer allocated
|
||||
*/
|
||||
bool mesh_upper_transport_message_reserve(void);
|
||||
|
||||
@ -101,7 +101,7 @@ void mesh_upper_transport_message_add_uint32(mesh_upper_transport_builder_t * bu
|
||||
/**
|
||||
* @brief finalize message
|
||||
* @param builder
|
||||
* @returns upper_transport_pdu if message was successfully constructed
|
||||
* @return upper_transport_pdu if message was successfully constructed
|
||||
*/
|
||||
mesh_upper_transport_pdu_t * mesh_upper_transport_message_finalize(mesh_upper_transport_builder_t * builder);
|
||||
|
||||
|
@ -82,7 +82,7 @@ void pb_adv_close_link(uint16_t pb_adv_cid, uint8_t reason);
|
||||
/**
|
||||
* Setup Link with unprovisioned device
|
||||
* @param DeviceUUID - data not copied
|
||||
* @returns pb_adv_cid or 0
|
||||
* @return pb_adv_cid or 0
|
||||
*/
|
||||
uint16_t pb_adv_create_link(const uint8_t * device_uuid);
|
||||
#endif
|
||||
|
@ -241,7 +241,7 @@ void pb_gatt_close_link(hci_con_handle_t con_handle, uint8_t reason){
|
||||
/**
|
||||
* Setup Link with unprovisioned device
|
||||
* @param device_uuid
|
||||
* @returns con_handle or HCI_CON_HANDLE_INVALID
|
||||
* @return con_handle or HCI_CON_HANDLE_INVALID
|
||||
*/
|
||||
uint16_t pb_gatt_create_link(const uint8_t * device_uuid){
|
||||
UNUSED(device_uuid);
|
||||
|
@ -65,7 +65,7 @@ void provisioning_provisioner_register_packet_handler(btstack_packet_handler_t p
|
||||
/**
|
||||
* @brief Start Provisioning device with provided device_uuid
|
||||
* @param device_uuid
|
||||
* @returns pb_adv_cid or 0
|
||||
* @return pb_adv_cid or 0
|
||||
*/
|
||||
uint16_t provisioning_provisioner_start_provisioning(const uint8_t * device_uuid);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user