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:

T_APP_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 T_LE_PRIVACY_PARAM_TYPE and it will set the privacy parameter. The ‘p_value’ field must point to an appropriate data type that meets the requirements for the corresponding parameter type. (For example: if required data length for parameter type is 2 octets, p_value should be cast to a pointer of uint16_t.)

Parameters:
  • 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.

Return values:
  • GAP_CAUSE_SUCCESS – Operation success.

  • Others – Operation failure.

Returns:

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 a LE privacy parameter type T_LE_PRIVACY_PARAM_TYPE and it will get the privacy parameter. The ‘p_value’ field must point to an appropriate data type that meets the requirements for the corresponding parameter type. (For example: if required data length for parameter type is 2 octets, p_value should be cast to a pointer of uint16_t.)

Parameters:
  • param[in] LE privacy parameter type T_LE_PRIVACY_PARAM_TYPE.

  • p_value[inout] Pointer to location to get the parameter value.

Return values:
  • GAP_CAUSE_SUCCESS – Operation success.

  • Others – Operation failure.

Returns:

Operation result.

void le_privacy_register_cb(P_FUN_PRIVACY_CB p_privacy_cb)

Register privacy callback to Bluetooth Host.

Parameters:

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.

T_GAP_CAUSE le_privacy_set_addr_resolution(bool enable)

Enable or disable LE privacy address resolution mode.

If sending request operation is successful, the enabling or disabling result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_RESOLUTION_STATUS_INFO.

Parameters:

enable[in] Enable or disable address resolution.

  • true: Enable address resolution.

  • false: Disable address resolution.

Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

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 Private Address.

If sending request operation is successful, the reading result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_READ_PEER_RESOLV_ADDR.

Parameters:
  • peer_identity_address_type[in] Peer identity address type T_GAP_IDENT_ADDR_TYPE.

  • peer_identity_address[in] Pointer to peer identity address.

Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

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 Private Address.

If sending request operation is successful, the reading result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_READ_LOCAL_RESOLV_ADDR.

Parameters:
  • peer_identity_address_type[in] Peer identity address type T_GAP_IDENT_ADDR_TYPE.

  • peer_identity_address[in] Pointer to peer identity address.

Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

T_GAP_CAUSE le_privacy_set_resolv_priv_addr_timeout(void)

Set resolvable private address timeout with value set by le_privacy_set_param with parameter GAP_PARAM_PRIVACY_TIMEOUT.

If sending request operation is successful, the setting result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_SET_RESOLV_PRIV_ADDR_TIMEOUT.

Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

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 resolving list.

When add device to local resolving list, APP shall select API based on the situation:

If sending request operation is successful, the modifying result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_MODIFY_RESOLV_LIST.

Parameters:
Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

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.

If sending request operation is successful, the adding result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_MODIFY_RESOLV_LIST.

Parameters:
  • peer_identity_address_type[in] Peer identity address type T_GAP_IDENT_ADDR_TYPE.

  • peer_identity_address[in] Pointer to 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.

Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

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.

If sending request operation is successful, the setting result will be returned by callback registered by le_privacy_register_cb with msg type GAP_MSG_LE_PRIVACY_SET_MODE.

Parameters:
  • peer_identity_address_type[in] Peer identity address type T_GAP_IDENT_ADDR_TYPE.

  • peer_identity_address[in] Pointer to peer identity address.

  • privacy_mode[in] Privacy mode T_GAP_PRIVACY_MODE.

Return values:
  • GAP_CAUSE_SUCCESS – Sending request operation is successful.

  • Others – Sending request operation is failed.

Returns:

The result of sending request.

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.

Parameters:

type[in] Bluetooth device address type T_GAP_REMOTE_ADDR_TYPE.

Return values:
  • GAP_IDENT_ADDR_PUBLIC – Public identity address.

  • GAP_IDENT_ADDR_RAND – Random identity address.

Returns:

Identity address type T_GAP_IDENT_ADDR_TYPE.