dotstack API Reference
1.10.37
|
The GAP profile defines the generic procedures related to discovery of Bluetooth devices and link management aspects of connecting to Bluetooth devices. More...
Macros | |
#define | bt_gap_request_remote_name(addr, name_buffer, name_buffer_len, callback, callback_param) bt_gap_request_remote_name_ex(addr, HCI_PAGE_SCAN_REPETITION_MODE_R2, 0, name_buffer, name_buffer_len, callback, callback_param) |
Request remote BR/EDR controller's name. More... | |
#define | bt_gap_connect(addr, acl_config, callback, callback_param) |
Make a connection between two BR/EDR devices. More... | |
Functions | |
bt_bool | bt_gap_find_devices (bt_find_devices_t *find, bt_gap_callback_fp callback, void *callback_param) |
Discover nearby Bluetooth (BR/EDR) devices. More... | |
bt_bool | bt_gap_cancel_find_devices (void) |
Terminate inquiry started with bt_gap_find_devices(). More... | |
bt_bool | bt_gap_set_local_name (const char *device_name, bt_int name_len, bt_gap_callback_fp callback, void *callback_param) |
Set the name of the local BR/EDR controller. More... | |
bt_bool | bt_gap_set_class_of_device (bt_ulong cod, bt_gap_callback_fp callback, void *callback_param) |
Set the class of device of the local BR/EDR controller. More... | |
void | bt_gap_get_local_address (bt_bdaddr_t *addr) |
Get the local BR/EDR controller's address. More... | |
bt_bool | bt_gap_set_scan_params (bt_bool discoverable, bt_ulong discoverable_period, bt_byte discoverable_mode, bt_bool connectable, bt_ulong connectable_period, bt_gap_callback_fp callback, void *callback_param) |
Set discoverability and connectability of the local BR/EDR controller. More... | |
bt_bool | bt_gap_request_remote_name_ex (bt_bdaddr_t *addr, bt_byte pg_scan_rpt_mode, bt_int clock_offset, char *name_buffer, bt_uint name_buffer_len, bt_gap_callback_fp callback, void *callback_param) |
Request remote BR/EDR controller's name. More... | |
bt_bool | bt_gap_set_link_role (bt_bdaddr_t *addr, bt_byte role, bt_gap_callback_fp callback, void *callback_param) |
Set link role. More... | |
bt_bool | bt_gap_set_link_policy (bt_bdaddr_t *addr, bt_uint policy, bt_gap_callback_fp callback, void *callback_param) |
Set link policy. More... | |
bt_bool | bt_gap_connect_ex (bt_bdaddr_t *addr, bt_uint packet_type, bt_byte pg_scan_rpt_mode, bt_byte role_switch, bt_uint acl_config, bt_uint clock_offset, bt_gap_callback_fp callback, void *callback_param) |
Make a connection between two BR/EDR devices. More... | |
bt_bool | bt_gap_disconnect (bt_bdaddr_t *addr, bt_gap_callback_fp callback, void *callback_param) |
Terminate a connection between two BR/EDR devices. More... | |
bt_bool | bt_gap_sniff_mode (bt_bdaddr_t *addr, bt_int min_interval, bt_int max_interval, bt_int attempt_slots, bt_int timeout, bt_gap_callback_fp callback, void *callback_param) |
Put a connection into Sniff mode. More... | |
bt_bool | bt_gap_exit_sniff_mode (bt_bdaddr_t *addr, bt_gap_callback_fp callback, void *callback_param) |
Exit SNIFF mode. More... | |
bt_bool | bt_gap_eir_add_local_name (const char *local_name) |
Add local name EIR data. More... | |
bt_bool | bt_gap_eir_add (bt_byte data_type, const bt_byte *data, bt_byte length) |
Add arbitrary EIR data. More... | |
bt_bool | bt_gap_eir_add_uuid16 (bt_byte data_type, const bt_uint *uuid_list, bt_byte uuid_list_size) |
Add a list of 16-bit UUIDs EIR data. More... | |
bt_bool | bt_gap_eir_add_uuid32 (bt_byte data_type, const bt_uuid32 *uuid_list, bt_byte uuid_list_size) |
Add a list of 32-bit UUIDs EIR data. More... | |
bt_bool | bt_gap_eir_add_uuid128 (bt_byte data_type, const bt_uuid_t *uuid_list, bt_byte uuid_list_size) |
Add a list of 128-bit UUIDs EIR data. More... | |
bt_bool | bt_gap_eir_add_vendor (bt_uint vendor_id, bt_byte *data, bt_byte data_len) |
Add vendor specific EIR data. More... | |
bt_bool | bt_gap_eir_add_tx_power_level (bt_byte tx_power_level) |
Add transmission power level EIR data. More... | |
bt_bool | bt_gap_eir_add_device_id (bt_uint vendor_id_source, bt_uint vendor_id, bt_uint product_id, bt_uint version) |
Add device Id EIR data. More... | |
bt_bool | bt_gap_eir_write (bt_gap_callback_fp callback, void *callback_param) |
Write EIR data to controller. More... | |
void | bt_gap_eir_clear (void) |
Clear EIR data list. More... | |
bt_bool | bt_gap_le_ad_add_local_name (const char *local_name) |
Add local name LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add (bt_byte data_type, const bt_byte *data, bt_byte length) |
Add arbitrary LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_uuid16 (bt_byte data_type, const bt_uint *uuid_list, bt_byte uuid_list_size) |
Add a list of 16-bit UUIDs LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_uuid32 (bt_byte data_type, const bt_uuid32 *uuid_list, bt_byte uuid_list_size) |
Add a list of 32-bit UUIDs LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_uuid128 (bt_byte data_type, const bt_uuid_t *uuid_list, bt_byte uuid_list_size) |
Add a list of 128-bit UUIDs LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_vendor (bt_uint vendor_id, bt_byte *data, bt_byte data_len) |
Add vendor specific LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_tx_power_level (bt_byte tx_power_level) |
Add transmission power level LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_flags (bt_byte flags) |
Add flags LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_device_id (bt_uint vendor_id_source, bt_uint vendor_id, bt_uint product_id, bt_uint version) |
Add device Id LE Advertising data. More... | |
bt_bool | bt_gap_le_ad_add_ibeacon (const bt_uuid_t *uuid, bt_uint major, bt_uint minor, bt_byte tx_power_level) |
Add Apple beacon Advertising data. More... | |
bt_bool | bt_gap_le_ad_set (bt_gap_callback_fp callback, void *callback_param) |
Write LE Advertising data to controller. More... | |
void | bt_gap_le_ad_clear (void) |
Clear LE Advertising data list. More... | |
bt_bool | bt_gap_le_scan_add_local_name (const char *local_name) |
Add local name LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add (bt_byte data_type, const bt_byte *data, bt_byte length) |
Add arbitrary LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_uuid16 (bt_byte data_type, const bt_uint *uuid_list, bt_byte uuid_list_size) |
Add a list of 16-bit UUIDs LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_uuid32 (bt_byte data_type, const bt_uuid32 *uuid_list, bt_byte uuid_list_size) |
Add a list of 32-bit UUIDs LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_uuid128 (bt_byte data_type, const bt_uuid_t *uuid_list, bt_byte uuid_list_size) |
Add a list of 128-bit UUIDs LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_vendor (bt_uint vendor_id, bt_byte *data, bt_byte data_len) |
Add vendor specific LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_tx_power_level (bt_byte tx_power_level) |
Add transmission power level LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_flags (bt_byte flags) |
Add flags LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_device_id (bt_uint vendor_id_source, bt_uint vendor_id, bt_uint product_id, bt_uint version) |
Add device Id LE Scan data. More... | |
bt_bool | bt_gap_le_scan_add_ibeacon (const bt_uuid_t *uuid, bt_uint major, bt_uint minor, bt_byte tx_power_level) |
Add Apple beacon Scan data. More... | |
bt_bool | bt_gap_le_scan_set (bt_gap_callback_fp callback, void *callback_param) |
Write LE Scan data to controller. More... | |
void | bt_gap_le_scan_clear (void) |
Clear LE Scan data list. More... | |
bt_bool | bt_gap_le_set_advertising_parameters (bt_uint adv_interval_min, bt_uint adv_interval_max, bt_byte adv_type, bt_byte own_address_type, bt_byte direct_address_type, bt_bdaddr_t *direct_address, bt_byte adv_channel_map, bt_byte adv_filter_policy, bt_gap_callback_fp callback, void *callback_param) |
Set Advertising parameters. More... | |
bt_bool | bt_gap_le_advertise (bt_bool enable, bt_gap_callback_fp callback, void *callback_param) |
Enable or disable advertising. More... | |
bt_bool | bt_gap_le_update_conn_parameters (bt_bdaddr_t *addr, bt_uint min_interval, bt_uint max_interval, bt_uint slave_latency, bt_uint supervision_timeout, bt_gap_callback_fp callback, void *callback_param) |
Update connection parameters. More... | |
bt_bool | bt_gap_le_read_phy (bt_bdaddr_t *addr, bt_gap_callback_fp callback, void *callback_param) |
Read current PHYs. More... | |
bt_bool | bt_gap_le_set_default_phy (bt_byte all_phys, bt_byte tx_phys, bt_byte rx_phys, bt_gap_callback_fp callback, void *callback_param) |
Set default PHYs. More... | |
bt_bool | bt_gap_le_set_phy (bt_bdaddr_t *addr, bt_byte all_phys, bt_byte tx_phys, bt_byte rx_phys, bt_uint phy_options, bt_gap_callback_fp callback, void *callback_param) |
Set current PHYs. More... | |
bt_bool | bt_gap_get_rssi (bt_bdaddr_t *addr, bt_char *rssi, bt_gap_callback_fp callback, void *callback_param) |
Get RSSI. More... | |
The GAP profile defines the generic procedures related to discovery of Bluetooth devices and link management aspects of connecting to Bluetooth devices.
All functions in this module that have a callback
are executed through a queue. I.e., when a function is called a request is put into the queue and the function returns. The request is executed later. By default the depth of the queue is 1. Only one function at a time can be called. The second function can only be executed in the callback of the first one. The length of the queue can be changed by adding GAP_MAX_CMD_BUFFERS option to the stack configuration file. This allows to enqueue several requests sequentially.
#define bt_gap_connect | ( | addr, | |
acl_config, | |||
callback, | |||
callback_param | |||
) |
Make a connection between two BR/EDR devices.
This function makes an ACL connection between two BR/EDR devices. No other protocol connections are made. The connection is made with all packet types allowed, page scan repetition mode R0 and role switch allowed.
addr | The address of the remote device. |
acl_config | Connection security settings. The acl_config parameter can be a combination of the following values:
|
callback | A callback function that is called when the link policy has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. #define bt_gap_request_remote_name | ( | addr, | |
name_buffer, | |||
name_buffer_len, | |||
callback, | |||
callback_param | |||
) | bt_gap_request_remote_name_ex(addr, HCI_PAGE_SCAN_REPETITION_MODE_R2, 0, name_buffer, name_buffer_len, callback, callback_param) |
Request remote BR/EDR controller's name.
This function requests a remote BR/EDR controller's name. This is simplified version of bt_gap_request_remote_name_ex(). It can be used if only the address of the remote device is known. bt_gap_request_remote_name_ex() has 2 more parameters which can only be obtained during inquiry - page scan repetition mode and clock offset.
addr | The address of the remote device. |
name_buffer | A pointer to a buffer where the remote device's name will be stored. The pointer has to be permanent, i.e., it cannot be allocate on the stack. The last byte of the buffer is always set to 0. So to receive N bytes of the remote name the buffer has to be N+1 bytes. |
name_buffer_len | The length of the name_buffer . |
callback | A callback function that is called when the scan mode has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_cancel_find_devices | ( | void | ) |
Terminate inquiry started with bt_gap_find_devices().
This function terminates inquiry started with bt_gap_find_devices(). The function first checks if inquiry is already in progess and tries to terminate it. If inquiry has not yet started it goes through the GAP command queue and removes all pending requests.
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_connect_ex | ( | bt_bdaddr_t * | addr, |
bt_uint | packet_type, | ||
bt_byte | pg_scan_rpt_mode, | ||
bt_byte | role_switch, | ||
bt_uint | acl_config, | ||
bt_uint | clock_offset, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Make a connection between two BR/EDR devices.
This function makes an ACL connection between two BR/EDR devices. No other protocol connections are made.
addr | The address of the remote device. |
packet_type | A mask that defines which packets the controller can use on the connection. The packet_type parameter can be a combination of the following values:
|
pg_scan_rpt_mode | Page scan repetition mode. The value for this parameter is obtained from inquiry. It is safe to set this parameter to HCI_PAGE_SCAN_REPETITION_MODE_R2 if now known. The pg_scan_rpt_mode parameter can be one of the following values:
|
role_switch | Defines if role switch is allowed. The initiator of the connection is the master at the beginning, but the device which a connection is made to can change the role in the process. This parameter defines if the switch is allowed. The role_switch parameter can be one of the following values:
|
acl_config | Connection security settings. The acl_config parameter can be a combination of the following values:
|
clock_offset | Remote device's clock offset |
callback | A callback function that is called when the connection has been created. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_disconnect | ( | bt_bdaddr_t * | addr, |
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Terminate a connection between two BR/EDR devices.
This function terminates an ACL connection between two BR/EDR devices.
addr | The address of the remote device. |
callback | A callback function that is called when the connection has been terminated. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add | ( | bt_byte | data_type, |
const bt_byte * | data, | ||
bt_byte | length | ||
) |
Add arbitrary EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
data_type | EIR data type. The data_type parameter can be on of the following values:
|
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_device_id | ( | bt_uint | vendor_id_source, |
bt_uint | vendor_id, | ||
bt_uint | product_id, | ||
bt_uint | version | ||
) |
Add device Id EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
vendor_id_source | Vendor Id source. |
vendor_id | Vendor Id. |
product_id | Product Id. |
version | Version. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_local_name | ( | const char * | local_name | ) |
Add local name EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
local_name | Local device name. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_tx_power_level | ( | bt_byte | tx_power_level | ) |
Add transmission power level EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_uuid128 | ( | bt_byte | data_type, |
const bt_uuid_t * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 128-bit UUIDs EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
data_type | EIR data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 128-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_uuid16 | ( | bt_byte | data_type, |
const bt_uint * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 16-bit UUIDs EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
data_type | EIR data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 16-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_uuid32 | ( | bt_byte | data_type, |
const bt_uuid32 * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 32-bit UUIDs EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
data_type | EIR data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 32-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_add_vendor | ( | bt_uint | vendor_id, |
bt_byte * | data, | ||
bt_byte | data_len | ||
) |
Add vendor specific EIR data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_eir_write().
vendor_id | Vendor Id. |
data | A pointer to vendor specific EIR data. |
data_len | Length of the vendor specific EIR data. |
TRUE
if the function succeeds. FALSE
otherwise. void bt_gap_eir_clear | ( | void | ) |
Clear EIR data list.
This function clears an internal buffer that stores EIR data.
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_eir_write | ( | bt_gap_callback_fp | callback, |
void * | callback_param | ||
) |
Write EIR data to controller.
This function writes the EIR data list creates with bt_gap_eir_add-functions to the controller.
callback | A callback function that is called when the EIR data has been written. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_exit_sniff_mode | ( | bt_bdaddr_t * | addr, |
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Exit SNIFF mode.
This function ends the Sniff mode and puts a BR/EDR connection into Active mode.
addr | The address of the remote device. |
callback | A callback function that is called when the connection has been put into active mode. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_find_devices | ( | bt_find_devices_t * | find, |
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Discover nearby Bluetooth (BR/EDR) devices.
This function starts inquiry procedure to find nearby BR/EDR devices.
find | A pointer to a structure that is used to specify inquiry parameters and a buffer where to save information about found devices. The pointer has to be persistent, i.e., it cannot be allocate on the stack. |
callback | A callback function that is called when inquiry is completed. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. void bt_gap_get_local_address | ( | bt_bdaddr_t * | addr | ) |
Get the local BR/EDR controller's address.
This function returns the Bluetooth address of the local BR/EDR controller..
addr | A pointer to bt_bdaddr_t structure where the address is written to. |
bt_bool bt_gap_get_rssi | ( | bt_bdaddr_t * | addr, |
bt_char * | rssi, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Get RSSI.
This function gets the RSSI value from a remote device.
addr | The address of the remote device. |
rssi | A pointer to a buffer where the RSSI is stored. The buffer has to be persistent, i.e., it cannot be allocate on the stack. |
callback | A callback function that is called when the RSSI value has been received. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add | ( | bt_byte | data_type, |
const bt_byte * | data, | ||
bt_byte | length | ||
) |
Add arbitrary LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
data_type | Advertising data type. |
data_type | A pointer to Advertising data. |
length | Length of the Advertising data. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_device_id | ( | bt_uint | vendor_id_source, |
bt_uint | vendor_id, | ||
bt_uint | product_id, | ||
bt_uint | version | ||
) |
Add device Id LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
vendor_id_source | Vendor Id source. |
vendor_id | Vendor Id. |
product_id | Product Id. |
version | Version. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_flags | ( | bt_byte | flags | ) |
Add flags LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
flags | Flags. The flags parameter is a combination of teh following values:
|
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_ibeacon | ( | const bt_uuid_t * | uuid, |
bt_uint | major, | ||
bt_uint | minor, | ||
bt_byte | tx_power_level | ||
) |
Add Apple beacon Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
uuid | Beacon UUID. |
major | Major version number of the beacon. |
minor | Minor version number of the beacon. |
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_local_name | ( | const char * | local_name | ) |
Add local name LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_tx_power_level | ( | bt_byte | tx_power_level | ) |
Add transmission power level LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_uuid128 | ( | bt_byte | data_type, |
const bt_uuid_t * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 128-bit UUIDs LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
data_type | Advertising data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 128-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_uuid16 | ( | bt_byte | data_type, |
const bt_uint * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 16-bit UUIDs LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
data_type | Advertising data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 16-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_uuid32 | ( | bt_byte | data_type, |
const bt_uuid32 * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 32-bit UUIDs LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
data_type | Advertising data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 32-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_add_vendor | ( | bt_uint | vendor_id, |
bt_byte * | data, | ||
bt_byte | data_len | ||
) |
Add vendor specific LE Advertising data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_ad_set().
vendor_id | Vendor Id. |
data | A pointer to vendor specific Advertising data. |
data_len | Length of the vendor specific Advertising data. |
TRUE
if the function succeeds. FALSE
otherwise. void bt_gap_le_ad_clear | ( | void | ) |
Clear LE Advertising data list.
This function clears an internal buffer that stores Advertising data.
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_ad_set | ( | bt_gap_callback_fp | callback, |
void * | callback_param | ||
) |
Write LE Advertising data to controller.
This function writes the Advertising data list created with bt_gap_le_ad__add-functions to the controller.
callback | A callback function that is called when the Advertising data has been written. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_advertise | ( | bt_bool | enable, |
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Enable or disable advertising.
This function enables or disables advertising.
enable | Minimum advertising interval. |
callback | A callback function that is called when the state of advertising has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_read_phy | ( | bt_bdaddr_t * | addr, |
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Read current PHYs.
This function reads the current transmitter PHY and receiver PHY on the connection identified by address
parameter.
addr | The address of the remote device. |
callback | A callback function that is called when PHYs have been read. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add | ( | bt_byte | data_type, |
const bt_byte * | data, | ||
bt_byte | length | ||
) |
Add arbitrary LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
data_type | Scan data type. |
data_type | A pointer to Scan data. |
length | Length of the Scan data. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_device_id | ( | bt_uint | vendor_id_source, |
bt_uint | vendor_id, | ||
bt_uint | product_id, | ||
bt_uint | version | ||
) |
Add device Id LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
vendor_id_source | Vendor Id source. |
vendor_id | Vendor Id. |
product_id | Product Id. |
version | Version. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_flags | ( | bt_byte | flags | ) |
Add flags LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
flags | Flags. The flags parameter is a combination of teh following values:
|
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_ibeacon | ( | const bt_uuid_t * | uuid, |
bt_uint | major, | ||
bt_uint | minor, | ||
bt_byte | tx_power_level | ||
) |
Add Apple beacon Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
uuid | Beacon UUID. |
major | Major version number of the beacon. |
minor | Minor version number of the beacon. |
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_local_name | ( | const char * | local_name | ) |
Add local name LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_tx_power_level | ( | bt_byte | tx_power_level | ) |
Add transmission power level LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
tx_power_level | Transmission power level. |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_uuid128 | ( | bt_byte | data_type, |
const bt_uuid_t * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 128-bit UUIDs LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
data_type | Scan data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 128-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_uuid16 | ( | bt_byte | data_type, |
const bt_uint * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 16-bit UUIDs LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
data_type | Scan data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 16-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_uuid32 | ( | bt_byte | data_type, |
const bt_uuid32 * | uuid_list, | ||
bt_byte | uuid_list_size | ||
) |
Add a list of 32-bit UUIDs LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
data_type | Scan data type. The data_type parameter can be on of the following values:
|
uuid_list | A pointer to an array of 32-bit UUIDs. |
uuid_list_size | Number of elements in the uuid_list . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_add_vendor | ( | bt_uint | vendor_id, |
bt_byte * | data, | ||
bt_byte | data_len | ||
) |
Add vendor specific LE Scan data.
This function does not send the data to controller. The data is only saved in an internal buffer. The actual write is initiated with bt_gap_le_scan_set().
vendor_id | Vendor Id. |
data | A pointer to vendor specific Scan data. |
data_len | Length of the vendor specific Scan data. |
TRUE
if the function succeeds. FALSE
otherwise. void bt_gap_le_scan_clear | ( | void | ) |
Clear LE Scan data list.
This function clears an internal buffer that stores Scan data.
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_scan_set | ( | bt_gap_callback_fp | callback, |
void * | callback_param | ||
) |
Write LE Scan data to controller.
This function writes the Scan data list created with bt_gap_le_scan_add-functions to the controller.
callback | A callback function that is called when the Scan data has been written. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_set_advertising_parameters | ( | bt_uint | adv_interval_min, |
bt_uint | adv_interval_max, | ||
bt_byte | adv_type, | ||
bt_byte | own_address_type, | ||
bt_byte | direct_address_type, | ||
bt_bdaddr_t * | direct_address, | ||
bt_byte | adv_channel_map, | ||
bt_byte | adv_filter_policy, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set Advertising parameters.
This function sets Advertising parameters. It should be called when advertising is disabled.
adv_interval_min | Minimum advertising interval. |
adv_interval_max | Maximum advertising interval. |
adv_type | Advertising type. The adv_type parameter can be one of the following values:
|
own_address_type | Local controller's address type. The own_address_type parameter can be one of the following values:
|
direct_address_type | Remote controller's address type. This parameter is used only when adv_type is HCI_LE_ADV_TYPE_DIRECT_HIGH or HCI_LE_ADV_TYPE_DIRECT_LOW The direct_address_type parameter can be one of the following values:
|
direct_address | Remote controller's address. This parameter is mandatory if adv_type is HCI_LE_ADV_TYPE_DIRECT_HIGH or HCI_LE_ADV_TYPE_DIRECT_LOW. Fro all other advertising types direct_address can be set to NULL. |
adv_channel_map | Advertising channel map. The adv_channel_map is a combination of the following values:
adv_channel_map can be set to HCI_LE_ADV_CHANNEL_MAP_ENABLE_ALL |
adv_filter_policy | Advertising filter policy. The adv_filter_policy parameter can be one of the following values:
|
callback | A callback function that is called when the advertising parameters have been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_set_default_phy | ( | bt_byte | all_phys, |
bt_byte | tx_phys, | ||
bt_byte | rx_phys, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set default PHYs.
This function sets default transmitter PHY and receiver PHY used on all subsequent connections.
all_phys | Specifies whether the host has no preference among the PHYs that the Controller supports in a given direction or whether it has specified particular PHYs that it prefers in the tx_phys or rx_phys parameter. This can be a combination of the following values:
|
tx_phys | Indicates the transmitter PHYs that the Host prefers the Controller to use. This can be a combination of the following values:
|
rx_phys | Indicates the receiver PHYs that the Host prefers the Controller to use. This can be a combination of the following values:
|
callback | A callback function that is called when PHYs have been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_set_phy | ( | bt_bdaddr_t * | addr, |
bt_byte | all_phys, | ||
bt_byte | tx_phys, | ||
bt_byte | rx_phys, | ||
bt_uint | phy_options, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set current PHYs.
This function sets the PHYs preferences on the connection identified by addr
parameter.
addr | The address of the remote device. |
all_phys | Specifies whether the host has no preference among the PHYs that the Controller supports in a given direction or whether it has specified particular PHYs that it prefers in the tx_phys or rx_phys parameter. This can be a combination of the following values:
|
tx_phys | Indicates the transmitter PHYs that the Host prefers the Controller to use. This can be a combination of the following values:
|
rx_phys | Indicates the receiver PHYs that the Host prefers the Controller to use. This can be a combination of the following values:
|
phy_options | PHY options. This can be one of the following values:
|
callback | A callback function that is called when PHYs have been read. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_le_update_conn_parameters | ( | bt_bdaddr_t * | addr, |
bt_uint | min_interval, | ||
bt_uint | max_interval, | ||
bt_uint | slave_latency, | ||
bt_uint | supervision_timeout, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Update connection parameters.
This function updates connection parameters. The function can only be used if local device is Slave.
addr | The address of the remote device. |
min_interval | Minimum connection interval. |
max_interval | Maximum connection interval. |
slave_latency | Slave latency. |
supervision_timeout | Connection supervision timeout. |
callback | A callback function that is called when connection parameters have been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_request_remote_name_ex | ( | bt_bdaddr_t * | addr, |
bt_byte | pg_scan_rpt_mode, | ||
bt_int | clock_offset, | ||
char * | name_buffer, | ||
bt_uint | name_buffer_len, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Request remote BR/EDR controller's name.
This function requests a remote BR/EDR controller's name.
addr | The address of the remote device. |
pg_scan_rpt_mode | Page Scan repetition mode. If the scan repetition mode of the remote device is unknown this parameters can be safely set HCI_PAGE_SCAN_REPETITION_MODE_R2. The scan repetition mode is obtained during inquiry. The pg_scan_rpt_mode parameter can be one of the following values:
|
clock_offset | Clock offset. If the clock offset of the remote device is unknown it can be safely set to 0. The clock offset is obtained during inquiry. |
name_buffer | A pointer to a buffer where the remote device's name will be stored. The pointer has to be permanent, i.e., it cannot be allocate on the stack. The last byte of the buffer is always set to 0. So to receive N bytes of the remote name the buffer has to be N+1 bytes. |
name_buffer_len | The length of the name_buffer . |
callback | A callback function that is called when the scan mode has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_set_class_of_device | ( | bt_ulong | cod, |
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set the class of device of the local BR/EDR controller.
This function sets the class of device of the local BR/EDR controller..
device_name | The class of device. |
callback | A callback function that is called when the class of device has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_set_link_policy | ( | bt_bdaddr_t * | addr, |
bt_uint | policy, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set link policy.
This function sets the policy of an existing connection.
addr | The address of the remote device. |
policy | The new policy of the connection. The policy parameter can be a combination of the following values:
|
callback | A callback function that is called when the link policy has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_set_link_role | ( | bt_bdaddr_t * | addr, |
bt_byte | role, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set link role.
This function sets the role of the local BR/EDR controller on an existing connection.
addr | The address of the remote device. |
role | The new role of the local controller The role parameter can be one of the following values:
|
callback | A callback function that is called when the role has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_set_local_name | ( | const char * | device_name, |
bt_int | name_len, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set the name of the local BR/EDR controller.
This function set the name of the local BR/EDR controller..
device_name | A pointer to a string that will be written to the controller. |
name_len | The length of the device_name . |
callback | A callback function that is called when the name has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_set_scan_params | ( | bt_bool | discoverable, |
bt_ulong | discoverable_period, | ||
bt_byte | discoverable_mode, | ||
bt_bool | connectable, | ||
bt_ulong | connectable_period, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Set discoverability and connectability of the local BR/EDR controller.
This function controls the discoverability and connectability of the local BR/EDR controller.
discoverable | Defines if the controller is discoverable or not. |
discoverable_period | Defines the period (in seconds) for which the controller is discoverable. If this parameter is 0 the controller is discoverable forever. |
discoverable_mode | Defines the discoverable mode - general or limited. The discoverable_mode parameter can be one of the following values:
|
connectable | Defines if the controller is connectable or not. |
discoverable_period | Defines the period (in seconds) for which the controller is connectable. If this parameter is 0 the controller is connectable forever. |
callback | A callback function that is called when the scan mode has been set. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise. bt_bool bt_gap_sniff_mode | ( | bt_bdaddr_t * | addr, |
bt_int | min_interval, | ||
bt_int | max_interval, | ||
bt_int | attempt_slots, | ||
bt_int | timeout, | ||
bt_gap_callback_fp | callback, | ||
void * | callback_param | ||
) |
Put a connection into Sniff mode.
This function puts a BR/EDR connection into SNIFF mode.
addr | The address of the remote device. |
min_interval | Minimum sniff interval. |
max_interval | Maximum sniff interval. |
attempt_slots | Number of baseband receive slots for sniff attempt. |
timeout | Number of baseband receive slots for sniff timeout. |
callback | A callback function that is called when the connection has been put into sniff mode. |
callback_param | A pointer to arbitrary data to be passed to the callback . |
TRUE
if the function succeeds. FALSE
otherwise.