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.

NOTE: You can call this function 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 a LE privacy parameter.

NOTE: You can call this function with a LE Privacy Parameter type and it will get a 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 data type of param is uint16_t, p_value will be cast to 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. NOTE: You can call this function to add, remove or clear the resolvable 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.

参数:
  • 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). Note: NULL: no peer IRK, use all-zero IRK.

  • use_local_irk -- [in] Indicates whether local IRK has been distributed to peer device. False: local IRK has not been distributed to peer device True: local IRK has been distributed to 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.