GAP Privacy Exported Functions
- group Gap_Privacy_Exported_Functions
-
Typedefs
-
typedef T_APP_RESULT (*P_FUN_PRIVACY_CB)(uint8_t msg_type, T_LE_PRIVACY_CB_DATA msg_data)
-
Callback for GAP to notify APP.
- Param msg_type:
-
[in] Callback msg type.
- Param msg_data:
-
[in] Message data T_LE_PRIVACY_CB_DATA.
- Retval result:
- Return:
-
Result.
Functions
-
T_GAP_CAUSE le_privacy_set_param(T_LE_PRIVACY_PARAM_TYPE param, uint8_t len, void *p_value)
-
Set a LE privacy parameter.
This function can be called with a LE Privacy Parameter type and it will set the LE Privacy Parameter. LE Privacy Parameters are defined in T_LE_PRIVACY_PARAM_TYPE.
- 参数:
param – [in] LE Privacy parameter type: T_LE_PRIVACY_PARAM_TYPE.
len – [in] Length of data to write.
p_value – [in] Pointer to data to write.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_get_param(T_LE_PRIVACY_PARAM_TYPE param, void *p_value)
-
Get an LE privacy parameter.
This function can be called with an LE Privacy Parameter type and it will get an LE Privacy Parameter. LE Privacy Parameters are defined in T_LE_PRIVACY_PARAM_TYPE.
- 参数:
param – [in] GAP parameter type: T_LE_PRIVACY_PARAM_TYPE.
p_value – [inout] Pointer to location to get the parameter value. This is dependent on the parameter ID and will be cast to the appropriate data type (For example: if the data type of param is uint16_t, p_value will be cast to a pointer of uint16_t).
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
void le_privacy_register_cb(P_FUN_PRIVACY_CB p_privacy_cb)
-
Register privacy callback to Bluetooth Host.
- 参数:
-
p_privacy_cb – [in] Callback function provided by the APP to handle LE privacy messages sent from the Bluetooth Host.
NULL -> Not send GAP privacy messages to APP.
Other -> Use application-defined callback function.
- 返回:
-
void.
-
T_GAP_CAUSE le_privacy_set_addr_resolution(bool enable)
-
Enable/disable LE privacy address resolution mode.
- 参数:
-
enable – [in] Enable or disable address resolution.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_read_peer_resolv_addr(T_GAP_IDENT_ADDR_TYPE peer_identity_address_type, uint8_t *peer_identity_address)
-
Read peer resolvable random address.
- 参数:
peer_identity_address_type – [in] Peer identity address type.
peer_identity_address – [in] Peer identity address.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_read_local_resolv_addr(T_GAP_IDENT_ADDR_TYPE peer_identity_address_type, uint8_t *peer_identity_address)
-
Read local resolvable random address.
- 参数:
peer_identity_address_type – [in] Peer identity address type.
peer_identity_address – [in] Peer identity address.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_set_resolv_priv_addr_timeout(void)
-
Set resolvable private address timeout.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_modify_resolv_list(T_GAP_RESOLV_LIST_OP operation, T_GAP_IDENT_ADDR_TYPE peer_identity_address_type, uint8_t *peer_identity_address)
-
Modify local resolvable device list.
When operation equals GAP_RESOLV_LIST_OP_ADD, this function cannot be used if local device uses different local addresses to bond with the same remote device. In this situation, le_privacy_add_resolv_list shall be called.
备注
This function can be called to add, remove, or clear the resolvable list.
- 参数:
operation – [in] Type, T_GAP_RESOLV_LIST_OP.
peer_identity_address_type – [in] Peer identity address type.
peer_identity_address – [in] Peer identity address.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_add_resolv_list(T_GAP_IDENT_ADDR_TYPE peer_identity_address_type, uint8_t *peer_identity_address, uint8_t *peer_irk, bool use_local_irk)
-
Add device to local resolving list.
- 参数:
peer_identity_address_type – [in] Peer identity address type.
peer_identity_address – [in] Peer identity address.
-
peer_irk – [in] Pointer to peer IRK (16 octets).
NULL: no peer IRK, use all-zero IRK.
-
use_local_irk – [in] Indicates whether local IRK has been distributed to the peer device.
False: local IRK has not been distributed to the peer device
True: local IRK has been distributed to the peer device.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
Others – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_CAUSE le_privacy_set_mode(T_GAP_IDENT_ADDR_TYPE peer_identity_address_type, uint8_t *peer_identity_address, T_GAP_PRIVACY_MODE privacy_mode)
-
Set privacy mode.
- 参数:
peer_identity_address_type – [in] Peer identity address type.
peer_identity_address – [in] Peer identity address.
privacy_mode – [in] Privacy mode T_GAP_PRIVACY_MODE.
- 返回值:
GAP_CAUSE_SUCCESS – Operation success.
GAP_CAUSE_SEND_REQ_FAILED – Operation failure.
- 返回:
-
Operation result.
-
T_GAP_IDENT_ADDR_TYPE le_privacy_convert_addr_type(T_GAP_REMOTE_ADDR_TYPE type)
-
Convert remote Bluetooth device address type to identity address type.
- 参数:
-
type – [in] Bluetooth device address type T_GAP_REMOTE_ADDR_TYPE.
- 返回值:
GAP_IDENT_ADDR_PUBLIC – Public identity address.
GAP_IDENT_ADDR_RAND – Random identity address.
- 返回:
-
Identity address type T_GAP_IDENT_ADDR_TYPE.
-
bool le_privacy_check_resolvable_private_address(uint8_t *rpa, uint8_t *irk)
-
Check if a given Resolvable Private Address (RPA) can be resolved using a specified Identity Resolving Key (IRK).
This function determines if a provided Resolvable Private Address (RPA) associated with Bluetooth Low Energy (BLE) privacy mechanisms can be resolved using the specified Identity Resolving Key (IRK). It achieves this by utilizing encryption and comparison methods as defined in the Bluetooth specification for privacy address resolution.
- 参数:
rpa – [in] Pointer to a 6-byte Resolvable Private Address that needs to be resolved. This address is typically a random address generated for privacy protection during BLE operations.
irk – [in] Pointer to a 16-byte Identity Resolving Key used for resolving the Resolvable Private Address.
- 返回值:
true – The Resolvable Private Address matches the IRK and successfully resolves. This indicates that the provided RPA is associated with the given IRK and should be accepted as a legitimate identity.
false – The Resolvable Private Address does not match the IRK and fails to resolve. This means that the RPA is either not associated with the given IRK or could not be resolved, indicating it is not recognized as a valid identity with the provided key.
- 返回:
-
Check result.
-
typedef T_APP_RESULT (*P_FUN_PRIVACY_CB)(uint8_t msg_type, T_LE_PRIVACY_CB_DATA msg_data)