BlueNRG-MS pack for STM32CubeMX: GAP functions

STM32CubeMX BlueNRG-MS

BlueNRG-MS pack for STM32CubeMX  V4.4.0
The BlueNRG-MS pack is an additional software for STM32CubeMX.

API for GAP layer. More...

Functions

tBleStatus aci_gap_init_IDB05A1 (uint8_t role, uint8_t privacy_enabled, uint8_t device_name_char_len, uint16_t *service_handle, uint16_t *dev_name_char_handle, uint16_t *appearance_char_handle)
 Initialize the GAP layer. More...
 
tBleStatus aci_gap_init_IDB04A1 (uint8_t role, uint16_t *service_handle, uint16_t *dev_name_char_handle, uint16_t *appearance_char_handle)
 Initialize the GAP layer. More...
 
tBleStatus aci_gap_set_non_discoverable (void)
 Set the Device in non-discoverable mode. More...
 
tBleStatus aci_gap_set_limited_discoverable (uint8_t AdvType, uint16_t AdvIntervMin, uint16_t AdvIntervMax, uint8_t OwnAddrType, uint8_t AdvFilterPolicy, uint8_t LocalNameLen, const char *LocalName, uint8_t ServiceUUIDLen, uint8_t *ServiceUUIDList, uint16_t SlaveConnIntervMin, uint16_t SlaveConnIntervMax)
 Put the device in limited discoverable mode (as defined in GAP specification volume 3, section 9.2.3). More...
 
tBleStatus aci_gap_set_discoverable (uint8_t AdvType, uint16_t AdvIntervMin, uint16_t AdvIntervMax, uint8_t OwnAddrType, uint8_t AdvFilterPolicy, uint8_t LocalNameLen, const char *LocalName, uint8_t ServiceUUIDLen, uint8_t *ServiceUUIDList, uint16_t SlaveConnIntervMin, uint16_t SlaveConnIntervMax)
 Put the Device in general discoverable mode (as defined in GAP specification volume 3, section 9.2.4). More...
 
tBleStatus aci_gap_set_direct_connectable_IDB05A1 (uint8_t own_addr_type, uint8_t directed_adv_type, uint8_t initiator_addr_type, const uint8_t *initiator_addr, uint16_t adv_interv_min, uint16_t adv_interv_max)
 Set the Device in direct connectable mode (as defined in GAP specification Volume 3, Section 9.3.3). More...
 
tBleStatus aci_gap_set_direct_connectable_IDB04A1 (uint8_t own_addr_type, uint8_t initiator_addr_type, const uint8_t *initiator_addr)
 Set the Device in direct connectable mode (as defined in GAP specification Volume 3, Section 9.3.3). More...
 
tBleStatus aci_gap_set_io_capability (uint8_t io_capability)
 Set the IO capabilities of the device. More...
 
tBleStatus aci_gap_set_auth_requirement (uint8_t mitm_mode, uint8_t oob_enable, uint8_t oob_data[16], uint8_t min_encryption_key_size, uint8_t max_encryption_key_size, uint8_t use_fixed_pin, uint32_t fixed_pin, uint8_t bonding_mode)
 Set the authentication requirements for the device. More...
 
tBleStatus aci_gap_set_author_requirement (uint16_t conn_handle, uint8_t authorization_enable)
 Set the authorization requirements of the device. More...
 
tBleStatus aci_gap_pass_key_response (uint16_t conn_handle, uint32_t passkey)
 Provide the pass key that will be used during pairing. More...
 
tBleStatus aci_gap_authorization_response (uint16_t conn_handle, uint8_t authorize)
 Authorize a device to access attributes. More...
 
tBleStatus aci_gap_set_non_connectable_IDB05A1 (uint8_t adv_type, uint8_t own_address_type)
 Put the device into non-connectable mode. More...
 
tBleStatus aci_gap_set_non_connectable_IDB04A1 (uint8_t adv_type)
 Put the device into non-connectable mode. More...
 
tBleStatus aci_gap_set_undirected_connectable (uint8_t own_addr_type, uint8_t adv_filter_policy)
 Put the device into undirected connectable mode. More...
 
tBleStatus aci_gap_slave_security_request (uint16_t conn_handle, uint8_t bonding, uint8_t mitm_protection)
 Send a slave security request to the master. More...
 
tBleStatus aci_gap_update_adv_data (uint8_t AdvLen, const uint8_t *AdvData)
 Update advertising data. More...
 
tBleStatus aci_gap_delete_ad_type (uint8_t ad_type)
 Delete an AD Type. More...
 
tBleStatus aci_gap_get_security_level (uint8_t *mitm_protection, uint8_t *bonding, uint8_t *oob_data, uint8_t *passkey_required)
 Get the current security settings. More...
 
tBleStatus aci_gap_configure_whitelist (void)
 Add addresses of bonded devices into the controller's whitelist. More...
 
tBleStatus aci_gap_terminate (uint16_t conn_handle, uint8_t reason)
 Terminate a connection. More...
 
tBleStatus aci_gap_clear_security_database (void)
 Clear the security database. More...
 
tBleStatus aci_gap_allow_rebond_IDB05A1 (uint16_t conn_handle)
 Allows the security manager to complete the pairing procedure and re-bond with the master. More...
 
tBleStatus aci_gap_allow_rebond_IDB04A1 (void)
 Allows the security manager to complete the pairing procedure and re-bond with the master. More...
 
tBleStatus aci_gap_start_limited_discovery_proc (uint16_t scanInterval, uint16_t scanWindow, uint8_t own_address_type, uint8_t filterDuplicates)
 Start the limited discovery procedure. More...
 
tBleStatus aci_gap_start_general_discovery_proc (uint16_t scanInterval, uint16_t scanWindow, uint8_t own_address_type, uint8_t filterDuplicates)
 Start the general discovery procedure. More...
 
tBleStatus aci_gap_start_name_discovery_proc (uint16_t scanInterval, uint16_t scanWindow, uint8_t peer_bdaddr_type, tBDAddr peer_bdaddr, uint8_t own_bdaddr_type, uint16_t conn_min_interval, uint16_t conn_max_interval, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_conn_length, uint16_t max_conn_length)
 Start the name discovery procedure. More...
 
tBleStatus aci_gap_start_auto_conn_establish_proc_IDB05A1 (uint16_t scanInterval, uint16_t scanWindow, uint8_t own_bdaddr_type, uint16_t conn_min_interval, uint16_t conn_max_interval, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_conn_length, uint16_t max_conn_length, uint8_t num_whitelist_entries, const uint8_t *addr_array)
 Start the auto connection establishment procedure. More...
 
tBleStatus aci_gap_start_auto_conn_establish_proc_IDB04A1 (uint16_t scanInterval, uint16_t scanWindow, uint8_t own_bdaddr_type, uint16_t conn_min_interval, uint16_t conn_max_interval, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_conn_length, uint16_t max_conn_length, uint8_t use_reconn_addr, const tBDAddr reconn_addr, uint8_t num_whitelist_entries, const uint8_t *addr_array)
 
tBleStatus aci_gap_start_general_conn_establish_proc_IDB05A1 (uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window, uint8_t own_address_type, uint8_t filter_duplicates)
 Start a general connection establishment procedure. More...
 
tBleStatus aci_gap_start_general_conn_establish_proc_IDB04A1 (uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window, uint8_t own_address_type, uint8_t filter_duplicates, uint8_t use_reconn_addr, const tBDAddr reconn_addr)
 
tBleStatus aci_gap_start_selective_conn_establish_proc (uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window, uint8_t own_address_type, uint8_t filter_duplicates, uint8_t num_whitelist_entries, const uint8_t *addr_array)
 Start a selective connection establishment procedure. More...
 
tBleStatus aci_gap_create_connection (uint16_t scanInterval, uint16_t scanWindow, uint8_t peer_bdaddr_type, tBDAddr peer_bdaddr, uint8_t own_bdaddr_type, uint16_t conn_min_interval, uint16_t conn_max_interval, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_conn_length, uint16_t max_conn_length)
 Start the direct connection establishment procedure. More...
 
tBleStatus aci_gap_terminate_gap_procedure (uint8_t procedure_code)
 Terminate the specified GAP procedure. EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with the procedure code set to the corresponding procedure. More...
 
tBleStatus aci_gap_start_connection_update (uint16_t conn_handle, uint16_t conn_min_interval, uint16_t conn_max_interval, uint16_t conn_latency, uint16_t supervision_timeout, uint16_t min_conn_length, uint16_t max_conn_length)
 Start the connection parameter update procedure. More...
 
tBleStatus aci_gap_send_pairing_request (uint16_t conn_handle, uint8_t force_rebond)
 Send a pairing request. More...
 
tBleStatus aci_gap_resolve_private_address_IDB05A1 (const tBDAddr private_address, tBDAddr actual_address)
 Resolve a private address. More...
 
tBleStatus aci_gap_resolve_private_address_IDB04A1 (const tBDAddr private_address)
 Resolve a private address. More...
 
tBleStatus aci_gap_get_bonded_devices (uint8_t *num_devices, uint8_t *device_list, uint8_t device_list_size)
 This command gets the list of bonded devices. More...
 
tBleStatus aci_gap_set_broadcast_mode (uint16_t adv_interv_min, uint16_t adv_interv_max, uint8_t adv_type, uint8_t own_addr_type, uint8_t adv_data_length, const uint8_t *adv_data, uint8_t num_whitelist_entries, const uint8_t *addr_array)
 Puts the device into broadcast mode. More...
 
tBleStatus aci_gap_start_observation_procedure (uint16_t scan_interval, uint16_t scan_window, uint8_t scan_type, uint8_t own_address_type, uint8_t filter_duplicates)
 Starts an observation procedure, when the device is in Observer role. More...
 
tBleStatus aci_gap_is_device_bonded (uint8_t peer_address_type, const tBDAddr peer_address)
 The command finds whether a device is bonded. More...
 

Detailed Description

API for GAP layer.

Function Documentation

◆ aci_gap_allow_rebond_IDB04A1()

tBleStatus aci_gap_allow_rebond_IDB04A1 ( void  )

Allows the security manager to complete the pairing procedure and re-bond with the master.

Note
This command can be issued by the application if a EVT_BLUE_GAP_BOND_LOST event is generated.
Returns
Value indicating success or error code.

◆ aci_gap_allow_rebond_IDB05A1()

tBleStatus aci_gap_allow_rebond_IDB05A1 ( uint16_t  conn_handle)

Allows the security manager to complete the pairing procedure and re-bond with the master.

Note
This command can be issued by the application if a EVT_BLUE_GAP_BOND_LOST event is generated.
Parameters
conn_handle
Returns
Value indicating success or error code.

◆ aci_gap_authorization_response()

tBleStatus aci_gap_authorization_response ( uint16_t  conn_handle,
uint8_t  authorize 
)

Authorize a device to access attributes.

Note
Application should send this command after it has received a EVT_BLUE_GAP_AUTHORIZATION_REQUEST.
Parameters
conn_handleConnection handle
authorize
Returns
Value indicating success or error code.

◆ aci_gap_clear_security_database()

tBleStatus aci_gap_clear_security_database ( void  )

Clear the security database.

Note
All the devices in the security database will be removed.
Returns
Value indicating success or error code.

◆ aci_gap_configure_whitelist()

tBleStatus aci_gap_configure_whitelist ( void  )

Add addresses of bonded devices into the controller's whitelist.

Note
The command will return an error if there are no devices in the database or if it was unable to add the device into the whitelist.
Returns
Value indicating success or error code.

◆ aci_gap_create_connection()

tBleStatus aci_gap_create_connection ( uint16_t  scanInterval,
uint16_t  scanWindow,
uint8_t  peer_bdaddr_type,
tBDAddr  peer_bdaddr,
uint8_t  own_bdaddr_type,
uint16_t  conn_min_interval,
uint16_t  conn_max_interval,
uint16_t  conn_latency,
uint16_t  supervision_timeout,
uint16_t  min_conn_length,
uint16_t  max_conn_length 
)

Start the direct connection establishment procedure.

Note
A LE_Create_Connection call will be made to the controller by GAP with the initiator filter policy set to �ignore whitelist and process connectable advertising packets only for the specified device�. The procedure can be terminated explicitly by the upper layer by issuing the command aci_gap_terminate_gap_procedure(). When a command is issued to terminate the procedure by upper layer, a LE_Create_Connection_Cancel call will be made to the controller by GAP. On termination of the procedure, a EVT_LE_CONN_COMPLETE event is returned. The procedure can be explicitly terminated by the upper layer by issuing the command aci_gap_terminate_gap_procedure() with the procedure_code set to GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC.
Parameters
scanIntervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scanWindowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
peer_bdaddr_typeType of the peer address (PUBLIC_ADDR, STATIC_RANDOM_ADDR).
peer_bdaddrAddress of the peer device with which a connection has to be established.
own_bdaddr_typeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
conn_min_intervalMinimum value for the connection event interval. This shall be less than or equal to Conn_Interval_Max.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_max_intervalMaximum value for the connection event interval. This shall be greater than or equal to Conn_Interval_Min.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_latencySlave latency for the connection in number of connection events.
Range: 0x0000 to 0x01F4
supervision_timeoutSupervision timeout for the LE Link.
Range: 0x000A to 0x0C80
Time = N x 10 msec
Time Range: 100 msec to 32 seconds
min_conn_lengthMinimum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
max_conn_lengthMaximum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
Returns
Value indicating success or error code.

◆ aci_gap_delete_ad_type()

tBleStatus aci_gap_delete_ad_type ( uint8_t  ad_type)

Delete an AD Type.

Note
This command can be used to delete the specified AD type from the advertisement data if present.
Parameters
ad_typeOne of the allowed AD types (see AD Types)
Returns
Value indicating success or error code.

◆ aci_gap_get_bonded_devices()

tBleStatus aci_gap_get_bonded_devices ( uint8_t *  num_devices,
uint8_t *  device_list,
uint8_t  device_list_size 
)

This command gets the list of bonded devices.

Note
It returns the number of addresses and the corresponding address types and values. Example:
uint8_t num_devices = 0;
uint8_t device_list[12*7];
ret = aci_gap_get_bonded_devices(&num_devices, device_list, sizeof(device_list));
for(int i = 0; i < num_devices; i+=7){
uint8_t addr_type = device_list[i];
uint8_t addr = device_list[i+1];
printf("Type: %d, Addr: %02X%02X%02X%02X%02X%02X\n",addr_type,addr[5],addr[4],addr[3],addr[2],addr[1],addr[0]);
}
Parameters
[out]num_devicesThe number of bonded devices.
[out]device_listList of addresses. It contains a sequence of [address type, address] pairs, where address type can be PUBLIC_ADDR or
device_list_sizeMaximum size of the device_list buffer used to return the device list.
Returns
Value indicating success or error code.

◆ aci_gap_get_security_level()

tBleStatus aci_gap_get_security_level ( uint8_t *  mitm_protection,
uint8_t *  bonding,
uint8_t *  oob_data,
uint8_t *  passkey_required 
)

Get the current security settings.

Note
This command can be used to get the current security settings of the device.
Parameters
mitm_protection
  • 0: Not required
  • 1: Required
bonding
  • 0: No bonding mode
  • 1: Bonding mode
oob_data
  • 0: Data absent
  • 1: Data present
passkey_required
  • 0: Not required
  • 1: Fixed pin is present which is being used
  • 2: Passkey required for pairing. An event will be generated when required.
Returns
Value indicating success or error code.

◆ aci_gap_init_IDB04A1()

tBleStatus aci_gap_init_IDB04A1 ( uint8_t  role,
uint16_t *  service_handle,
uint16_t *  dev_name_char_handle,
uint16_t *  appearance_char_handle 
)

Initialize the GAP layer.

Note
Register the GAP service with the GATT. All the standard GAP characteristics will also be added:
  • Device Name
  • Appearance
  • Peripheral Privacy Flag (peripheral role only)
  • Reconnection Address (peripheral role only)
  • Peripheral Preferred Connection Parameters (peripheral role only)
    uint16_t service_handle, dev_name_char_handle, appearance_char_handle;
    ret = aci_gap_init_IDB04A1(1, &service_handle, &dev_name_char_handle, &appearance_char_handle);
    if(ret){
    PRINTF("GAP_Init failed.\n");
    reboot();
    }
    const char *name = "BlueNRG";
    ret = aci_gatt_update_char_value(service_handle, dev_name_char_handle, 0, strlen(name), (uint8_t *)name);
    if(ret){
    PRINTF("aci_gatt_update_char_value failed.\n");
    }
Parameters
roleOne of the allowed roles: GAP_PERIPHERAL_ROLE or GAP_CENTRAL_ROLE. See GAP roles.
[out]service_handleHandle of the GAP service.
[out]dev_name_char_handleDevice Name Characteristic handle
[out]appearance_char_handleAppearance Characteristic handle
Return values
tBleStatusValue indicating success or error code.

◆ aci_gap_init_IDB05A1()

tBleStatus aci_gap_init_IDB05A1 ( uint8_t  role,
uint8_t  privacy_enabled,
uint8_t  device_name_char_len,
uint16_t *  service_handle,
uint16_t *  dev_name_char_handle,
uint16_t *  appearance_char_handle 
)

Initialize the GAP layer.

Note
Register the GAP service with the GATT. All the standard GAP characteristics will also be added:
  • Device Name
  • Appearance
  • Peripheral Preferred Connection Parameters (peripheral role only)
    uint16_t service_handle, dev_name_char_handle, appearance_char_handle;
    ret = aci_gap_init_IDB05A1(1, 0, 0x07, &service_handle, &dev_name_char_handle, &appearance_char_handle);
    if(ret){
    PRINTF("GAP_Init failed.\n");
    reboot();
    }
    const char *name = "BlueNRG";
    ret = aci_gatt_update_char_value(service_handle, dev_name_char_handle, 0, strlen(name), (uint8_t *)name);
    if(ret){
    PRINTF("aci_gatt_update_char_value failed.\n");
    }
Parameters
roleBitmap of allowed roles: see GAP roles.
privacy_enabledEnable (1) or disable (0) privacy.
device_name_char_lenLength of the device name characteristic
[out]service_handleHandle of the GAP service.
[out]dev_name_char_handleDevice Name Characteristic handle
[out]appearance_char_handleAppearance Characteristic handle
Return values
tBleStatusValue indicating success or error code.

◆ aci_gap_is_device_bonded()

tBleStatus aci_gap_is_device_bonded ( uint8_t  peer_address_type,
const tBDAddr  peer_address 
)

The command finds whether a device is bonded.

Note
If the device is using a resolvable private address and it has been bonded, then the command will return BLE_STATUS_SUCCESS.
Parameters
peer_address_typeThe address type of the peer device
peer_addressAddress used by the peer device while advertising.
Returns
Value indicating success or error code.

◆ aci_gap_pass_key_response()

tBleStatus aci_gap_pass_key_response ( uint16_t  conn_handle,
uint32_t  passkey 
)

Provide the pass key that will be used during pairing.

Note
This command should be sent by the Host in response to EVT_BLUE_GAP_PASS_KEY_REQUEST event.
Parameters
conn_handleConnection handle
passkeyPass key that will be used during the pairing process. Must be a number between 0 and 999999.
Returns
Value indicating success or error code.

◆ aci_gap_resolve_private_address_IDB04A1()

tBleStatus aci_gap_resolve_private_address_IDB04A1 ( const tBDAddr  private_address)

Resolve a private address.

Note
This command tries to resolve the address provided with the IRKs present in its database. If the address is resolved successfully with any one of the IRKs present in the database, it returns success.
Parameters
addressAddress to be resolved.
Returns
Value indicating success or error code.

◆ aci_gap_resolve_private_address_IDB05A1()

tBleStatus aci_gap_resolve_private_address_IDB05A1 ( const tBDAddr  private_address,
tBDAddr  actual_address 
)

Resolve a private address.

Note
This command tries to resolve the address provided with the IRKs present in its database. If the address is resolved successfully with any one of the IRKs present in the database, it returns success.
Parameters
[in]addressAddress to be resolved.
[out]actual_addressThe public or static random address of the peer device, distributed during pairing phase.
Returns
Value indicating success or error code.

◆ aci_gap_send_pairing_request()

tBleStatus aci_gap_send_pairing_request ( uint16_t  conn_handle,
uint8_t  force_rebond 
)

Send a pairing request.

Note
Send the SM pairing request to start a pairing process from a Central. The authentication requirements and IO capabilities should be set before issuing this command using aci_gap_set_io_capability() and aci_gap_set_auth_requirement(). A EVT_BLUE_GAP_PAIRING_CMPLT event is returned after the pairing process is completed.
Parameters
conn_handleHandle of the connection for which the pairing request has to be sent.
force_rebond
  • 0x00: Pairing request is sent only if the device has not previously bonded
  • 0x01: Pairing request will be sent even if the device was previously bonded
Returns
Value indicating success or error code.

◆ aci_gap_set_auth_requirement()

tBleStatus aci_gap_set_auth_requirement ( uint8_t  mitm_mode,
uint8_t  oob_enable,
uint8_t  oob_data[16],
uint8_t  min_encryption_key_size,
uint8_t  max_encryption_key_size,
uint8_t  use_fixed_pin,
uint32_t  fixed_pin,
uint8_t  bonding_mode 
)

Set the authentication requirements for the device.

Note
If the oob_enable is set to 0, oob_data will be ignored. This command has to be given only when the device is not in a connected state.
Parameters
mitm_modeMITM mode:
oob_enableIf OOB data are present or not:
oob_dataOut-Of-Band data
min_encryption_key_sizeMinimum size of the encryption key to be used during the pairing process
max_encryption_key_sizeMaximum size of the encryption key to be used during the pairing process
use_fixed_pinIf application wants to use a fixed pin or not:
fixed_pinIf use_fixed_pin is USE_FIXED_PIN_FOR_PAIRING, this is the value of the pin that will be used during pairing if MIMT protection is enabled. Any value between 0 to 999999 is accepted.
bonding_modeOne of the bonding modes:
Returns
Value indicating success or error code.

◆ aci_gap_set_author_requirement()

tBleStatus aci_gap_set_author_requirement ( uint16_t  conn_handle,
uint8_t  authorization_enable 
)

Set the authorization requirements of the device.

Note
This command has to be given when connected to a device if authorization is required to access services which require authorization.
Parameters
conn_handleHandle of the connection.
authorization_enable
  • AUTHORIZATION_NOT_REQUIRED : Authorization not required
  • AUTHORIZATION_REQUIRED : Authorization required. This enables the authorization requirement in the device and when a remote device tries to read/write a characeristic with authorization requirements, the stack will send back an error response with "Insufficient authorization" error code. After pairing is complete a EVT_BLUE_GAP_AUTHORIZATION_REQUEST event will be sent to the Host.
Returns
Value indicating success or error code.

◆ aci_gap_set_broadcast_mode()

tBleStatus aci_gap_set_broadcast_mode ( uint16_t  adv_interv_min,
uint16_t  adv_interv_max,
uint8_t  adv_type,
uint8_t  own_addr_type,
uint8_t  adv_data_length,
const uint8_t *  adv_data,
uint8_t  num_whitelist_entries,
const uint8_t *  addr_array 
)

Puts the device into broadcast mode.

Note
A privacy enabled device uses either a resolvable private address or a non-resolvable private address as specified in the own_addr_type parameter of the command.
Parameters
adv_interv_minMinimum advertising interval. Range: 0x00A0 to 0x4000 Time = N * 0.625 msec Time Range: 100 ms to 10.24 sec
adv_interv_maxMaximum advertising interval. Range: 0x00A0 to 0x4000 Time = N * 0.625 msec Time Range: 100 ms to 10.24 sec
adv_typeOne of the allowed advertising types:
own_addr_typeIf Privacy is disabled, the broadcaster address can be
adv_data_lengthLength of the advertising data in the advertising packet
adv_dataAdvertising data used by the device while advertising
num_whitelist_entriesNumber of devices to be added to whitelist
addr_arrayIt will contain the addresses that have to be added into the whitelist. The format of the addr_array should be: address type followed by address. Example:
uint8_t addr_array[] = {PUBLIC_ADDR,0x01,0x00,0x00,0xe1,0x80,0x02,
PUBLIC_ADDR,0x02,0x00,0x00,0xe1,0x80,0x02};
Returns
Value indicating success or error code.

◆ aci_gap_set_direct_connectable_IDB04A1()

tBleStatus aci_gap_set_direct_connectable_IDB04A1 ( uint8_t  own_addr_type,
uint8_t  initiator_addr_type,
const uint8_t *  initiator_addr 
)

Set the Device in direct connectable mode (as defined in GAP specification Volume 3, Section 9.3.3).

Note
If the privacy is enabled, the reconnection address is used for advertising, otherwise the address of the type specified in OwnAddrType is used. The device will be in directed connectable mode only for 1.28 seconds. If no connection is established within this duration, the device enters non discoverable mode and advertising will have to be again enabled explicitly. The controller generates a EVT_LE_CONN_COMPLETE event with the status set to HCI_DIRECTED_ADV_TIMEOUT if the connection was not established and 0x00 if the connection was successfully established.

Usage example:

const uint8_t central_address = {0x43,0x27,0x84,0xE1,0x80,0x02};
Parameters
own_addr_typeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
initiator_addr_typeType of peer address (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
initiator_addrInitiator's address (Little Endian).
Returns
Value indicating success or error code.

◆ aci_gap_set_direct_connectable_IDB05A1()

tBleStatus aci_gap_set_direct_connectable_IDB05A1 ( uint8_t  own_addr_type,
uint8_t  directed_adv_type,
uint8_t  initiator_addr_type,
const uint8_t *  initiator_addr,
uint16_t  adv_interv_min,
uint16_t  adv_interv_max 
)

Set the Device in direct connectable mode (as defined in GAP specification Volume 3, Section 9.3.3).

Note
If the privacy is enabled, the reconnection address is used for advertising, otherwise the address of the type specified in OwnAddrType is used. The device will be in directed connectable mode only for 1.28 seconds. If no connection is established within this duration, the device enters non discoverable mode and advertising will have to be again enabled explicitly. The controller generates a EVT_LE_CONN_COMPLETE event with the status set to HCI_DIRECTED_ADV_TIMEOUT if the connection was not established and 0x00 if the connection was successfully established.

Usage example:

const uint8_t central_address[] = {0x43,0x27,0x84,0xE1,0x80,0x02};
Parameters
own_addr_typeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
directed_adv_typeType of directed advertising (HIGH_DUTY_CYCLE_DIRECTED_ADV, LOW_DUTY_CYCLE_DIRECTED_ADV).
initiator_addr_typeType of peer address (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
initiator_addrInitiator's address (Little Endian).
adv_interv_minMinimum advertising interval for low duty cycle directed advertising. Range: 0x0020 to 0x4000 Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec.
adv_interv_maxMaximum advertising interval for low duty cycle directed advertising. Range: 0x0020 to 0x4000 Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec.
Returns
Value indicating success or error code.

◆ aci_gap_set_discoverable()

tBleStatus aci_gap_set_discoverable ( uint8_t  AdvType,
uint16_t  AdvIntervMin,
uint16_t  AdvIntervMax,
uint8_t  OwnAddrType,
uint8_t  AdvFilterPolicy,
uint8_t  LocalNameLen,
const char *  LocalName,
uint8_t  ServiceUUIDLen,
uint8_t *  ServiceUUIDList,
uint16_t  SlaveConnIntervMin,
uint16_t  SlaveConnIntervMax 
)

Put the Device in general discoverable mode (as defined in GAP specification volume 3, section 9.2.4).

Note
The device will be discoverable until the Host issue Aci_Gap_Set_Non_Discoverable command. The Adv_Interval_Min and Adv_Interval_Max parameters are optional. If both are set to 0, the GAP uses the default values for advertising intervals (1.28 s and 2.56 s respectively for IDB04A1). When using connectable undirected advertising events:
  • Adv_Interval_Min = 30 ms
  • Adv_Interval_Max = 60 ms using non-connectable advertising events or scannable undirected advertising events:
  • Adv_Interval_Min = 100 ms
  • Adv_Interval_Max = 150 ms Host can set the Local Name, a Service UUID list and the Slave Connection Interval Range. If provided, these data will be inserted into the advertising packet payload as AD data. These parameters are optional in this command. These values can be also set using aci_gap_update_adv_data() separately. The total size of data in advertising packet cannot exceed 31 bytes. With this command, the BLE Stack will also add automatically the following standard AD types:
  • AD Flags
  • TX Power Level
Usage example:
#define ADV_INTERVAL_MIN_MS 800
#define ADV_INTERVAL_MAX_MS 900
#define CONN_INTERVAL_MIN_MS 100
#define CONN_INTERVAL_MAX_MS 300
const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
const uint8_t serviceUUIDList[] = {AD_TYPE_16_BIT_SERV_UUID,0x34,0x12};
ret = aci_gap_set_discoverable(ADV_IND, (ADV_INTERVAL_MIN_MS*1000)/625,
(ADV_INTERVAL_MAX_MS*1000)/625,
sizeof(local_name), local_name,
0, NULL,
(CONN_INTERVAL_MIN_MS*1000)/1250,
(CONN_INTERVAL_MAX_MS*1000)/1250);
Parameters
AdvTypeOne of the advertising types:
AdvIntervMinMinimum advertising interval. Range: 0x0020 to 0x4000 Default: 1.28 s Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
AdvIntervMaxMaximum advertising interval. Range: 0x0020 to 0x4000 Default: 2.56 s Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
OwnAddrTypeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
AdvFilterPolicyFilter policy:
LocalNameLenLength of LocalName array.
LocalNameArray containing the Local Name AD data. First byte is the AD type: AD_TYPE_SHORTENED_LOCAL_NAME or AD_TYPE_COMPLETE_LOCAL_NAME.
ServiceUUIDLenLength of ServiceUUIDList array.
ServiceUUIDListThis is the list of the UUIDs AD Types as defined in Volume 3, Section 11.1.1 of GAP Specification. First byte is the AD Type.
SlaveConnIntervMinSlave connection interval minimum value suggested by Peripheral. If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000, Slave Connection Interval Range AD structure will be added in advertising data. Connection interval is defined in the following manner: connIntervalmin = Slave_Conn_Interval_Min x 1.25ms Slave_Conn_Interval_Min range: 0x0006 to 0x0C80 Value of 0xFFFF indicates no specific minimum.
SlaveConnIntervMaxSlave connection interval maximum value suggested by Peripheral. If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000, Slave Connection Interval Range AD structure will be added in advertising data. ConnIntervalmax = Slave_Conn_Interval_Max x 1.25ms Slave_Conn_Interval_Max range: 0x0006 to 0x0C80 Slave_ Conn_Interval_Max shall be equal to or greater than the Slave_Conn_Interval_Min. Value of 0xFFFF indicates no specific maximum.
Return values
tBleStatusValue indicating success or error code.

◆ aci_gap_set_io_capability()

tBleStatus aci_gap_set_io_capability ( uint8_t  io_capability)

Set the IO capabilities of the device.

Note
This command has to be given only when the device is not in a connected state.
Parameters
io_capabilityOne of the allowed codes for IO Capability:
Returns
Value indicating success or error code.

◆ aci_gap_set_limited_discoverable()

tBleStatus aci_gap_set_limited_discoverable ( uint8_t  AdvType,
uint16_t  AdvIntervMin,
uint16_t  AdvIntervMax,
uint8_t  OwnAddrType,
uint8_t  AdvFilterPolicy,
uint8_t  LocalNameLen,
const char *  LocalName,
uint8_t  ServiceUUIDLen,
uint8_t *  ServiceUUIDList,
uint16_t  SlaveConnIntervMin,
uint16_t  SlaveConnIntervMax 
)

Put the device in limited discoverable mode (as defined in GAP specification volume 3, section 9.2.3).

Note
The device will be discoverable for TGAP (lim_adv_timeout) = 180 seconds. The advertising can be disabled at any time by issuing aci_gap_set_non_discoverable() command. The AdvIntervMin and AdvIntervMax parameters are optional. If both are set to 0, the GAP will use default values (250 ms and 500 ms respectively). Host can set the Local Name, a Service UUID list and the Slave Connection Minimum and Maximum. If provided, these data will be inserted into the advertising packet payload as AD data. These parameters are optional in this command. These values can be also set using aci_gap_update_adv_data() separately. The total size of data in advertising packet cannot exceed 31 bytes. With this command, the BLE Stack will also add automatically the following standard AD types:
  • AD Flags
  • TX Power Level
When advertising timeout happens (i.e. limited discovery period has elapsed), controller generates EVT_BLUE_GAP_LIMITED_DISCOVERABLE event.

Example:

#define ADV_INTERVAL_MIN_MS 100
#define ADV_INTERVAL_MAX_MS 200
const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
const uint8_t serviceUUIDList[] = {AD_TYPE_16_BIT_SERV_UUID,0x34,0x12};
ret = aci_gap_set_limited_discoverable(ADV_IND, (ADV_INTERVAL_MIN_MS*1000)/0.625,
(ADV_INTERVAL_MAX_MS*1000)/0.625,
sizeof(local_name), local_name,
sizeof(serviceUUIDList), serviceUUIDList,
0, 0);
Parameters
AdvTypeOne of the advertising types:
AdvIntervMinMinimum advertising interval. Range: 0x0020 to 0x4000 Default: 250 ms Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
AdvIntervMaxMaximum advertising interval. Range: 0x0020 to 0x4000 Default: 500 ms Time = N * 0.625 msec Time Range: 20 ms to 10.24 sec (minimum 100 ms for ADV_SCAN_IND or ADV_NONCONN_IND).
OwnAddrTypeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
AdvFilterPolicyFilter policy:
  • NO_WHITE_LIST_USE
  • WHITE_LIST_FOR_ONLY_SCAN
  • WHITE_LIST_FOR_ONLY_CONN
  • WHITE_LIST_FOR_ALL
LocalNameLenLength of LocalName array.
LocalNameArray containing the Local Name AD data. First byte is the AD type: AD_TYPE_SHORTENED_LOCAL_NAME or AD_TYPE_COMPLETE_LOCAL_NAME.
ServiceUUIDLenLength of ServiceUUIDList array.
ServiceUUIDListThis is the list of the UUIDs AD Types as defined in Volume 3, Section 11.1.1 of GAP Specification. First byte is the AD Type.
SlaveConnIntervMinSlave connection interval minimum value suggested by Peripheral. If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000, Slave Connection Interval Range AD structure will be added in advertising data. Connection interval is defined in the following manner: connIntervalmin = Slave_Conn_Interval_Min x 1.25ms Slave_Conn_Interval_Min range: 0x0006 to 0x0C80 Value of 0xFFFF indicates no specific minimum.
SlaveConnIntervMaxSlave connection interval maximum value suggested by Peripheral. If SlaveConnIntervMin and SlaveConnIntervMax are not 0x0000, Slave Connection Interval Range AD structure will be added in advertising data. ConnIntervalmax = Slave_Conn_Interval_Max x 1.25ms Slave_Conn_Interval_Max range: 0x0006 to 0x0C80 Slave_ Conn_Interval_Max shall be equal to or greater than the Slave_Conn_Interval_Min. Value of 0xFFFF indicates no specific maximum.
Return values
tBleStatusValue indicating success or error code.

◆ aci_gap_set_non_connectable_IDB04A1()

tBleStatus aci_gap_set_non_connectable_IDB04A1 ( uint8_t  adv_type)

Put the device into non-connectable mode.

Parameters
adv_typeOne of the allowed advertising types:
Returns
Value indicating success or error code.

◆ aci_gap_set_non_connectable_IDB05A1()

tBleStatus aci_gap_set_non_connectable_IDB05A1 ( uint8_t  adv_type,
uint8_t  own_address_type 
)

Put the device into non-connectable mode.

Parameters
adv_typeOne of the allowed advertising types:
own_address_typeIf Privacy is disabled, then the peripheral address can be
Returns
Value indicating success or error code.

◆ aci_gap_set_non_discoverable()

tBleStatus aci_gap_set_non_discoverable ( void  )

Set the Device in non-discoverable mode.

Note
This command will disable the LL advertising.
Return values
tBleStatusValue indicating success or error code.

◆ aci_gap_set_undirected_connectable()

tBleStatus aci_gap_set_undirected_connectable ( uint8_t  own_addr_type,
uint8_t  adv_filter_policy 
)

Put the device into undirected connectable mode.

Note
If privacy is enabled in the device, a resolvable private address is generated and used as the advertiser's address. If not, the address of the type specified in own_addr_type is used for advertising.
Parameters
own_addr_typeType of our address used during advertising: if BLUENRG (IDB04A1)
adv_filter_policyFilter policy:
Returns
Value indicating success or error code.

◆ aci_gap_slave_security_request()

tBleStatus aci_gap_slave_security_request ( uint16_t  conn_handle,
uint8_t  bonding,
uint8_t  mitm_protection 
)

Send a slave security request to the master.

Note
This command has to be issued to notify the master of the security requirements of the slave. The master may encrypt the link, initiate the pairing procedure, or reject the request.
Parameters
conn_handleConnection handle
bondingOne of the bonding modes:
mitm_protectionIf MITM protection is required or not:
Returns
Value indicating success or error code.

◆ aci_gap_start_auto_conn_establish_proc_IDB04A1()

tBleStatus aci_gap_start_auto_conn_establish_proc_IDB04A1 ( uint16_t  scanInterval,
uint16_t  scanWindow,
uint8_t  own_bdaddr_type,
uint16_t  conn_min_interval,
uint16_t  conn_max_interval,
uint16_t  conn_latency,
uint16_t  supervision_timeout,
uint16_t  min_conn_length,
uint16_t  max_conn_length,
uint8_t  use_reconn_addr,
const tBDAddr  reconn_addr,
uint8_t  num_whitelist_entries,
const uint8_t *  addr_array 
)

◆ aci_gap_start_auto_conn_establish_proc_IDB05A1()

tBleStatus aci_gap_start_auto_conn_establish_proc_IDB05A1 ( uint16_t  scanInterval,
uint16_t  scanWindow,
uint8_t  own_bdaddr_type,
uint16_t  conn_min_interval,
uint16_t  conn_max_interval,
uint16_t  conn_latency,
uint16_t  supervision_timeout,
uint16_t  min_conn_length,
uint16_t  max_conn_length,
uint8_t  num_whitelist_entries,
const uint8_t *  addr_array 
)

Start the auto connection establishment procedure.

Note
The devices specified are added to the white list of the controller and a LE_Create_Connection call will be made to the controller by GAP with the initiator filter policy set to �use whitelist to determine which advertiser to connect to�. When a command is issued to terminate the procedure by upper layer, a LE_Create_Connection_Cancel call will be made to the controller by GAP. The procedure is terminated when either a connection is successfully established with one of the specified devices in the white list or the procedure is explicitly terminated by issuing the command aci_gap_terminate_gap_procedure() with the procedure code set to GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC. A EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with the procedure code set to GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC.
Parameters
scanIntervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scanWindowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
own_bdaddr_typeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
conn_min_intervalMinimum value for the connection event interval. This shall be less than or equal to Conn_Interval_Max.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_max_intervalMaximum value for the connection event interval. This shall be greater than or equal to Conn_Interval_Min.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_latencySlave latency for the connection in number of connection events.
Range: 0x0000 to 0x01F4
supervision_timeoutSupervision timeout for the LE Link.
Range: 0x000A to 0x0C80
Time = N x 10 msec
Time Range: 100 msec to 32 seconds
min_conn_lengthMinimum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
max_conn_lengthMaximum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
num_whitelist_entriesNumber of devices that have to be added to the whitelist.
addr_arrayaddr_array will contain the addresses that have to be added into the whitelist. The format of the addr_array should be: address type followed by address. Example:
uint8_t addr_array[] = {PUBLIC_ADDR,0x01,0x00,0x00,0xe1,0x80,0x02,
PUBLIC_ADDR,0x02,0x00,0x00,0xe1,0x80,0x02};
Returns
Value indicating success or error code.

◆ aci_gap_start_connection_update()

tBleStatus aci_gap_start_connection_update ( uint16_t  conn_handle,
uint16_t  conn_min_interval,
uint16_t  conn_max_interval,
uint16_t  conn_latency,
uint16_t  supervision_timeout,
uint16_t  min_conn_length,
uint16_t  max_conn_length 
)

Start the connection parameter update procedure.

Note
Allowed by the Central to update the connection parameter of the specified connection. A Link Layer Connection Update procedure is started on the controller. On completion of the procedure, a EVT_LE_CONN_UPDATE_COMPLETE event is returned to the upper layer.
Parameters
conn_handleHandle of the connection for which the update procedure has to be started.
conn_min_intervalMinimum value for the connection event interval. This shall be less than or equal to Conn_Interval_Max.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_max_intervalMaximum value for the connection event interval. This shall be greater than or equal to Conn_Interval_Min.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_latencySlave latency for the connection in number of connection events.
Range: 0x0000 to 0x01F4
supervision_timeoutSupervision timeout for the LE Link.
Range: 0x000A to 0x0C80
Time = N x 10 msec
Time Range: 100 msec to 32 seconds
min_conn_lengthMinimum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
max_conn_lengthMaximum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
Returns
Value indicating success or error code.

◆ aci_gap_start_general_conn_establish_proc_IDB04A1()

tBleStatus aci_gap_start_general_conn_establish_proc_IDB04A1 ( uint8_t  scan_type,
uint16_t  scan_interval,
uint16_t  scan_window,
uint8_t  own_address_type,
uint8_t  filter_duplicates,
uint8_t  use_reconn_addr,
const tBDAddr  reconn_addr 
)

◆ aci_gap_start_general_conn_establish_proc_IDB05A1()

tBleStatus aci_gap_start_general_conn_establish_proc_IDB05A1 ( uint8_t  scan_type,
uint16_t  scan_interval,
uint16_t  scan_window,
uint8_t  own_address_type,
uint8_t  filter_duplicates 
)

Start a general connection establishment procedure.

Note
The host enables scanning in the controller with the scanner filter policy set to �accept all advertising packets� and from the scanning results all the devices are sent to the upper layer using the event EVT_BLUE_GAP_DEVICE_FOUND (for IDB04A1) or EVT_LE_ADVERTISING_REPORT (for IDB05A1). The upper layer then has to select one of the devices to which it wants to connect by issuing the command aci_gap_create_connection(). The procedure is terminated when a connection is established or the upper layer terminates the procedure by issuing the command aci_gap_terminate_gap_procedure() with the procedure code set to GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC. On completion of the procedure a EVT_BLUE_GAP_PROCEDURE_COMPLETE event is generated with the procedure code set to GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC.
Parameters
scan_typePassive or active scanning (PASSIVE_SCAN, ACTIVE_SCAN)
scan_intervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scan_windowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
own_address_typeType of our address used during active scanning (PUBLIC_ADDR, STATIC_RANDOM_ADDR).
filter_duplicatesDuplicate filtering enabled or not.
  • 0x00: Do not filter the duplicates
  • 0x01: Filter duplicates
Returns
Value indicating success or error code.

◆ aci_gap_start_general_discovery_proc()

tBleStatus aci_gap_start_general_discovery_proc ( uint16_t  scanInterval,
uint16_t  scanWindow,
uint8_t  own_address_type,
uint8_t  filterDuplicates 
)

Start the general discovery procedure.

Note
The controller is commanded to start active scanning. The procedure is terminated when either the upper layers issue a command to terminate the procedure by issuing the command aci_gap_terminate_gap_procedure() with the procedure code set to GAP_GENERAL_DISCOVERY_PROC or a timeout happens. When the procedure is terminated due to any of the above reasons, EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with the procedure code set to GAP_GENERAL_DISCOVERY_PROC. The device found when the procedure is ongoing is returned to the upper layers through the event EVT_BLUE_GAP_DEVICE_FOUND (for IDB04A1) or EVT_LE_ADVERTISING_REPORT (for IDB05A1).
Parameters
scanIntervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scanWindowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
own_address_typeType of our address used during advertising (PUBLIC_ADDR, STATIC_RANDOM_ADDR).
filterDuplicatesDuplicate filtering enabled or not.
  • 0x00: Do not filter the duplicates
  • 0x01: Filter duplicates
Returns
Value indicating success or error code.

◆ aci_gap_start_limited_discovery_proc()

tBleStatus aci_gap_start_limited_discovery_proc ( uint16_t  scanInterval,
uint16_t  scanWindow,
uint8_t  own_address_type,
uint8_t  filterDuplicates 
)

Start the limited discovery procedure.

Note
The controller is commanded to start active scanning. When this procedure is started, only the devices in limited discoverable mode are returned to the upper layers. The procedure is terminated when either the upper layers issue a command to terminate the procedure by issuing the command aci_gap_terminate_gap_procedure() with the procedure code set to GAP_LIMITED_DISCOVERY_PROC or a timeout happens. When the procedure is terminated due to any of the above reasons, EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with the procedure code set to GAP_LIMITED_DISCOVERY_PROC. The device found when the procedure is ongoing is returned to the upper layers through the event EVT_BLUE_GAP_DEVICE_FOUND (for IDB04A1) or EVT_LE_ADVERTISING_REPORT (for IDB05A1).
Parameters
scanIntervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scanWindowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
own_address_typeType of our address used during advertising (PUBLIC_ADDR, STATIC_RANDOM_ADDR).
filterDuplicatesDuplicate filtering enabled or not.
  • 0x00: Do not filter the duplicates
  • 0x01: Filter duplicates
Returns
Value indicating success or error code.

◆ aci_gap_start_name_discovery_proc()

tBleStatus aci_gap_start_name_discovery_proc ( uint16_t  scanInterval,
uint16_t  scanWindow,
uint8_t  peer_bdaddr_type,
tBDAddr  peer_bdaddr,
uint8_t  own_bdaddr_type,
uint16_t  conn_min_interval,
uint16_t  conn_max_interval,
uint16_t  conn_latency,
uint16_t  supervision_timeout,
uint16_t  min_conn_length,
uint16_t  max_conn_length 
)

Start the name discovery procedure.

Note
A LE_Create_Connection call will be made to the controller by GAP with the initiator filter policy set to �ignore whitelist and process connectable advertising packets only for the specified device�. Once a connection is established, GATT procedure is started to read the device name characteristic. When the read is completed (successfully or unsuccessfully), a EVT_BLUE_GAP_PROCEDURE_COMPLETE event is given to the upper layer. The event also contains the name of the device if the device name was read successfully.
Parameters
scanIntervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scanWindowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
peer_bdaddr_typeType of the peer address (PUBLIC_ADDR, STATIC_RANDOM_ADDR).
peer_bdaddrAddress of the peer device with which a connection has to be established.
own_bdaddr_typeType of our address used during advertising (PUBLIC_ADDR,STATIC_RANDOM_ADDR).
conn_min_intervalMinimum value for the connection event interval. This shall be less than or equal to Conn_Interval_Max.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_max_intervalMaximum value for the connection event interval. This shall be greater than or equal to Conn_Interval_Min.
Range: 0x0006 to 0x0C80
Time = N x 1.25 msec
Time Range: 7.5 msec to 4 seconds
conn_latencySlave latency for the connection in number of connection events.
Range: 0x0000 to 0x01F4
supervision_timeoutSupervision timeout for the LE Link.
Range: 0x000A to 0x0C80
Time = N x 10 msec
Time Range: 100 msec to 32 seconds
min_conn_lengthMinimum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
max_conn_lengthMaximum length of connection needed for the LE connection.
Range: 0x0000 - 0xFFFF
Time = N x 0.625 msec.
Returns
Value indicating success or error code.

◆ aci_gap_start_observation_procedure()

tBleStatus aci_gap_start_observation_procedure ( uint16_t  scan_interval,
uint16_t  scan_window,
uint8_t  scan_type,
uint8_t  own_address_type,
uint8_t  filter_duplicates 
)

Starts an observation procedure, when the device is in Observer role.

Note
The host enables scanning in the controller. The advertising reports are sent to the upper layer using standard EVT_LE_ADVERTISING_REPORT subevent in EVT_LE_META_EVENT. See Bluetooth Core v4.0, Vol. 2, part E, Ch. 7.7.65.2, LE Advertising Report Event.
Parameters
scan_intervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range from 2.5 msec to 10240 msec. For a number N, Time = N * 0.625 msec.
scan_windowAmount of time for the duration of the LE scan. scan_window shall be less than or equal to scan_interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range from 2.5 msec to 10240 msec. For a number N, Time = N * 0.625 msec.
scan_typePassive or active scanning (PASSIVE_SCAN, ACTIVE_SCAN)
own_address_typeIf Privacy is disabled, then the scanner address can be
filter_duplicatesDuplicate filtering enabled or not.
  • 0x00: Do not filter the duplicates
  • 0x01: Filter duplicates
Returns
Value indicating success or error code.

◆ aci_gap_start_selective_conn_establish_proc()

tBleStatus aci_gap_start_selective_conn_establish_proc ( uint8_t  scan_type,
uint16_t  scan_interval,
uint16_t  scan_window,
uint8_t  own_address_type,
uint8_t  filter_duplicates,
uint8_t  num_whitelist_entries,
const uint8_t *  addr_array 
)

Start a selective connection establishment procedure.

Note
The GAP adds the specified device addresses into white list and enables scanning in the controller with the scanner filter policy set to �accept packets only from devices in whitelist�. All the devices found are sent to the upper layer by the event EVT_BLUE_GAP_DEVICE_FOUND (for IDB04A1) or EVT_LE_ADVERTISING_REPORT (for IDB05A1). The upper layer then has to select one of the devices to which it wants to connect by issuing the command aci_gap_create_connection(). On completion of the procedure a EVT_BLUE_GAP_PROCEDURE_COMPLETE event is generated with the procedure code set to GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC. The procedure is terminated when a connection is established or the upper layer terminates the procedure by issuing the command aci_gap_terminate_gap_procedure with the procedure code set to GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC.
Parameters
scan_typePassive or active scanning (PASSIVE_SCAN, ACTIVE_SCAN)
scan_intervalTime interval from when the Controller started its last LE scan until it begins the subsequent LE scan. The scan interval should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
scan_windowAmount of time for the duration of the LE scan. Scan_Window shall be less than or equal to Scan_Interval. The scan window should be a number in the range 0x0004 to 0x4000. This corresponds to a time range 2.5 msec to 10240 msec. For a number N, Time = N x 0.625 msec.
own_address_typeType of our address used during active scanning (PUBLIC_ADDR, STATIC_RANDOM_ADDR).
filter_duplicatesDuplicate filtering enabled or not.
  • 0x00: Do not filter the duplicates
  • 0x01: Filter duplicates
num_whitelist_entriesNumber of devices that have to be added to the whitelist.
addr_arrayaddr_array will contain the addresses that have to be added into the whitelist. The format of the addr_array should be: address type followed by address. Example:
uint8_t addr_array[] = {PUBLIC_ADDR,0x01,0x00,0x00,0xe1,0x80,0x02,
PUBLIC_ADDR,0x02,0x00,0x00,0xe1,0x80,0x02};
Returns
Value indicating success or error code.

◆ aci_gap_terminate()

tBleStatus aci_gap_terminate ( uint16_t  conn_handle,
uint8_t  reason 
)

Terminate a connection.

Note
A EVT_DISCONN_COMPLETE event will be generated when the link is disconnected.
Parameters
conn_handleConnection handle
reasonReason for requesting disconnection. The error code can be any of ones as specified for the disconnected command in the HCI specification (See HCI Error codes).
Returns
Value indicating success or error code.

◆ aci_gap_terminate_gap_procedure()

tBleStatus aci_gap_terminate_gap_procedure ( uint8_t  procedure_code)

Terminate the specified GAP procedure. EVT_BLUE_GAP_PROCEDURE_COMPLETE event is returned with the procedure code set to the corresponding procedure.

Parameters
procedure_codeOne of the procedure codes (GAP procedure codes).
Returns
Value indicating success or error code.

◆ aci_gap_update_adv_data()

tBleStatus aci_gap_update_adv_data ( uint8_t  AdvLen,
const uint8_t *  AdvData 
)

Update advertising data.

Note
This command can be used to update the advertising data for a particular AD type. If the AD type specified does not exist, then it is added to the advertising data. If the overall advertising data length is more than 31 octets after the update, then the command is rejected and the old data is retained.
Parameters
AdvLenLength of AdvData array
AdvDataAdvertisement Data, formatted as specified in Bluetooth specification (Volume 3, Part C, 11), including data length. It can contain more than one AD type. Example
const char local_name[] = {AD_TYPE_COMPLETE_LOCAL_NAME,'B','l','u','e','N','R','G'};
const uint8_t serviceUUIDList[] = {AD_TYPE_16_BIT_SERV_UUID,0x34,0x12};
const uint8_t manuf_data[] = {4, AD_TYPE_MANUFACTURER_SPECIFIC_DATA, 0x05, 0x02, 0x01};
8, local_name, 3, serviceUUIDList, 0, 0);
ret = aci_gap_update_adv_data(5, manuf_data);
Returns
Value indicating success or error code.
Generated on Mon Apr 15 2019 18:10:40 for BlueNRG-MS pack for STM32CubeMX by   doxygen 1.8.13